如何为Oracle RAC配置SSH

众所周知,在安装Oracle Clusterware(Former Oracle CRS)之前,有一些必备的条件,比如双网卡,同版本的操作系统,一些必需的补丁等等,还有一些比如同样ID的组和用户,这些都可以通过clusterware附带的一个检查工具cluvfy进行检查。详细的列表和检查方法可以参考oracle的官方安装文档
除此之外,安装之前另外一个重要的前提就是ssh或者rsh的配置,这就是oracle在节点之间进行文件copy时候必须的,下面就分十个步骤介绍如何进行ssh的配置。

1. Login as oracle user
2. create .ssh directory in the oracle user’s home directory
$cd
$mkdir ~/.ssh
$chmod 700 ~/.ssh

3. Generate an RSA and DSA key for SSH
$/usr/bin/ssh-keygen -t rsa
$/usr/bin/ssh-keygen -t dsa

4. After this, four files generated
~/.ssh/id_rsa.pub
~/.ssh/id_rsa
~/.ssh/id_dsa.pub
~/.ssh/id_dsa

5. Create an authorized key file
$touch ~/.ssh/authorized_keys
$cd ~/.ssh
$ls

6. Copy the contents of rsa.pub and dsa.pub files to authrorized file
[oracle@node1 .ssh]$ ssh node1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node1’s password:
[oracle@node1 .ssh]$ ssh node1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
[oracle@node1 .ssh$ ssh node2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node2’s password:
[oracle@node1 .ssh$ ssh node2 cat /home/oracle/.ssh/id_dsa.pub >>authorized_keys
oracle@node2’s password:

7. Use scp to copy the authorized file to other nodes in ~/.ssh
[oracle@node1 .ssh]scp authorized_keys node2:/home/oracle/.ssh/

8. Change the permissions on the oracle user’s authorized file on all cluster nodes
$ chmod 600 ~/.ssh/authorized_keys

9. Enable OUI to use ssh and scp
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add

10. Verify ssh configuration on all nodes
$ ssh nodename1 date
$ ssh nodename2 date

其他的具体步骤可以参考oracle的手册B28264-03,地址如下:
http://download.oracle.com/docs/cd/B28359_01/install.111/b28264/toc.htm

This entry was posted in 数据库 and tagged . Bookmark the permalink.

One Response to 如何为Oracle RAC配置SSH

Leave a Reply

Your email address will not be published. Required fields are marked *