Saturday, 9 November 2013

ssh configuration for RAC Implementation



In order to start the installation of oracle RAC cluster, you have to first setup password-less ssh connection between same user on different node. This is require in order for installer to proceed with installing binary on remote host using ssh connection.

Please follow the step below to generate key and exchange with other nodes identified as part of cluster RAC.

Step 1 : make a .ssh directory under user home directory on all nodes

mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh

Step 2 : Generate the rsa key on all nodes

ssh-keygen -t rsa -N '' -f id_rsa

The above command will create two files rsa_id and rsa_id.pub

-rw------- 1 oracle oinstall 1675 Oct 26 21:51 id_rsa
-rw-r--r-- 1 oracle oinstall  410 Oct 26 21:51 id_rsa.pub
copy the content of public key in authorized_keys file

$ cat id_rsa.pub > authorized_keys

Step 3 : exchange id_rsa.pub from each host to other host and append in authorized keys

open authorized_keys using vi editor and copy content from one host to all other hosts. This will ensure each host authorized_keys contain keys from every other hosts in cluster.
 
Step 4 : run ssh command on each host to ensure password-less ssh works
 
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
 
ssh host1  date                 ( host1/2 is actual hostname )
ssh host2  date                
ssh host1.domain date       ( domain --> is actual domain name )
ssh host2.domain date
 
Note:-> Press <Enter> Key for any input during above command run.
 
at the end, your ~/.ssh directory should have files/permission like below
 
-rw------- 1 oracle oinstall 1230 Oct 26 22:09 authorized_keys
-rw------- 1 oracle oinstall 1675 Oct 26 21:51 id_rsa
-rw-r--r-- 1 oracle oinstall  410 Oct 26 21:51 id_rsa.pub
-rw------- 1 oracle oinstall 1618 Oct 26 22:11 known_hosts
 
Brief Summary about SSH

The command ssh-keygen -N '' -t rsa initiated the creation of the key pair without any password.
 
The private key was saved in .ssh/id_rsa. This file is read-only and only for you. No one else
must see the content of that file, as it is used to decrypt all correspondence encrypted with
the public key.
 
The public key is save in .ssh/id_rsa.pub. It is one line in length.
 
Its content is then copied in file .ssh/authorized_keys of the system you wish to SSH to without being prompted for a password.

No comments: