Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, November 24, 2014

Exadata: Configuring SSH Equivalency to use dcli

Exadata comes with many storage servers, The Cell Administration can be done on the command line as user celladmin with CellCLI,but it would be an annoying task to do all commands many times. Therefore, dcli was introduced to enable us to control multiple Cells with a single command for which you have to configure the SSH.

1- First you should know the IPs and names of your storage cells
--Celss IPs
22.168.166.13
22.168.166.14
22.168.166.15

2- Try to connect using dcli from any of DB node
[oracle@pk3-iub-rp-od01 ~]$ dcli -c  pk3_iub_cel_es01 cellcli -e list cell
Unable to connect to cells: ['pk3_iub_cel_es01']

3- Now add shh on the db node, create a simple text file having all the Cell IPs.
-- where are you now
[oracle@pk3-iub-rp-od01 ~]$ pwd
/home/oracle
--run the commands
[oracle@pk3-iub-rp-od01 ~]$ vi cell_group
[oracle@pk3-iub-rp-od01 ~]$ cat cell_group
22.168.166.13
22.168.166.14
22.168.166.15

-- push SSH keys to the storage cells:
[oracle@pk3-iub-rp-od01 ~]$ dcli -g cell_group -k
The authenticity of host '22.168.166.14 (22.168.166.14)' can't be established.
RSA key fingerprint is 87:fd:b0:34:c3:01:58:81:e6:82:b4:cc:28:33:d6:a9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '22.168.166.14' (RSA) to the list of known hosts.
celladmin@22.168.166.14's password:
The authenticity of host '22.168.166.13 (22.168.166.13)' can't be established.
RSA key fingerprint is 01:69:1a:5a:2b:b4:9b:ac:96:3f:ac:85:a3:4b:42:0c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '22.168.166.13' (RSA) to the list of known hosts.
celladmin@22.168.166.13's password:
The authenticity of host '22.168.166.15 (22.168.166.15)' can't be established.
RSA key fingerprint is e6:56:2b:88:9f:62:cf:84:b5:b6:9d:27:97:41:ee:0a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '22.168.166.15' (RSA) to the list of known hosts.
celladmin@22.168.166.15's password:
22.168.166.13: ssh key added
22.168.166.14: ssh key added
22.168.166.15: ssh key added


-- connect from the DB node to a specific cell
[oracle@pk3-iub-rp-od01 ~]$ dcli -c 22.168.166.13 cellcli -e list cell
22.168.166.13: pk3_iub_cel_es01  online

--check with all cells
[oracle@pk3-iub-rp-od01 ~]$ dcli -g cell_group cellcli -e list cell
22.168.166.13: pk3_iub_cel_es01  online
22.168.166.14: pk3_iub_cel_es02  online
22.168.166.15: pk3_iub_cel_es03  online
-- check how many Cells
[oracle@pk3-iub-rp-od01 ~]$ dcli -g cell_group -t
Target cells: ['22.168.166.13', '22.168.166.14', '22.168.166.15']
-- connect to DB Nodes
[oracle@pk3-iub-rp-od01 ~]$ dcli -g dbs_group -k -l oracle
192.167.162.11: ssh key already exists
192.167.162.12: ssh key already exists
-- checking on DB Nodes
[oracle@pk3-iub-rp-od01 ~]$ dcli -g dbs_group -l oracle ps -eaf | grep OSW
192.167.162.11: root      20566      1  0 04:02 ?        00:00:03 /bin/ksh ./OSWatcher.sh 15 168 bzip2 3
192.167.162.11: root      21141  20566  0 04:02 ?        00:00:03 /bin/ksh ./OSWatcherFM.sh 168 3
192.167.162.11: oracle    79129  54972  0 11:41 pts/1    00:00:00 grep OSW
192.167.162.12: root     126332      1  0 04:02 ?        00:00:01 /bin/ksh ./OSWatcher.sh 15 168 bzip2 3

192.167.162.12: root     126640 126332  0 04:02 ?        00:00:02 /bin/ksh ./OSWatcherFM.sh 168 3
-- -c option for the specific cells, even you can use the DB Nodes also but then use -l option as well because by default -c connects with celladmin user.

[oracle@pk3-iub-rp-od01 ~]$ dcli -c 22.168.166.14 ps -eaf | grep OSW
22.168.166.14: root     26573     1  0 04:02 ?        00:00:05 /bin/ksh ./OSWatcher.sh 15 168 bzip2 3
22.168.166.14: root     26761 26573  0 04:02 ?        00:00:04 /bin/ksh ./OSWatcherFM.sh 168 3


[oracle@pk3-iub-rp-od01 ~]$ dcli -l oracle  -c 192.168.166.12 /u01/app/11.2.0.4/grid/bin/crsctl status res ora.asm -t

192.167.162.12: --------------------------------------------------------------------------------
192.167.162.12: NAME           TARGET  STATE        SERVER                   STATE_DETAILS
192.167.162.12: --------------------------------------------------------------------------------
192.167.162.12: Local Resources
192.167.162.12: --------------------------------------------------------------------------------
192.167.162.12: ora.asm
192.167.162.12: ONLINE  ONLINE       pk3-iub-rp-od01          Started
192.167.162.12: ONLINE  ONLINE       pk3-iub-rp-od02          Started

-- -n, which simply shows OK after a successful execution so you get abbreviated output[oracle@pk3-iub-rp-od01 ~]$ dcli -g cell_group -n cellcli -e list cell
OK: ['20.168.166.13', '20.168.166.14', '20.168.166.15']


-- The -r option allows you to enter a regular expression that will not be matched. It’s a quick check on abnormal conditions.
[oracle@pk3-iub-rp-od01 ~]$ dcli -r '.* active' -g cell_group cellcli -e "list griddisk"
.* active: ['20.168.166.13', '20.168.166.14', '20.168.166.15']


-- you can create the scripts also to be run by dcli, use -x to run the script
[oracle@pk3-iub-rp-od01 ~]$ cat exaCommands.dcl
cellcli -e list cell

[oracle@pk3-iub-rp-od01 ~]$ chmod u+x exaCommands.dcl
[oracle@pk3-iub-rp-od01 ~]$ dcli -g cell_group -x exaCommands.dcl
20.168.166.13: pk3_iub_cel_es01  online
20.168.166.14: pk3_iub_cel_es02  online
20.168.166.15: pk3_iub_cel_es03  online
-- -f Copies the files to the other cells but does not execute them. eg; copying cell_group file from one DB Node to all DB Nodes
[oracle@pk3-iub-rp-od01 ~]$ dcli -f cell_group -g dbs_group -l oracle
[oracle@pk3-iub-rp-od01 ~]$ dcli -l oracle -g dbs_group ls
192.167.162.11: cell_group
192.167.162.12: cell_group


No comments: