在所有节点配置SSH的对等性
在安装Oracle Real Application
clusters之前,必须先配置所有节点的SSH对等性。因为在安装过程种Oracle Universal Installer
使用ssh和scp命令执行远程命令执行及copy的工作。
下面是具体的步骤:
以下步骤在所有节点上执行:
1.以oracle用户登陆
# su – oracle
2.在两个节点的oracle主目录分别创建.ssh目录,并赋予权限。
# mkdir ~/.ssh
# chmod 755 ~/.ssh
3. 在两个节点分别生成RSA key
# /usr/bin/ssh-keygen -t rsa
会出现如下提示:
■ Accept the default location for the key file.
■ Enter and confirm a pass phrase that is different from the oracle
user’s password. phrase
密码处直接回车即可
4. 生成DSA key
# /usr/bin/ssh-keygen -t dsa
出现如下提示:
■ Accept the default location for the key file.
■ Enter and confirm a pass phrase that is different from the oracle
user’s password. phrase
密码处直接回车即可
5. 以oracle用户身份,在所有节点创建authorized_keys文件,并赋予权限
# touch ~/.ssh/authorized_keys
# cd ~/.ssh
# ls
你应该可以看到你所创建的id_dsa.pub 和id_rsa.pub和authorized_keys
6.在两个节点分别将id_dsa.pub 和id_rsa.pub加入到authorized_keys
节点1:
$ ssh db01 cat ~/.ssh/id_rsa.pub >>
~/.ssh/authorized_keys
$ ssh db01 cat ~/.ssh/id_dsa.pub >>
~/.ssh/authorized_keys
$ ssh db02 cat ~/.ssh/id_rsa.pub >>
~/.ssh/authorized_keys
$ ssh db02 cat ~/.ssh/id_dsa.pub >>
~/.ssh/authorized_keys
节点2:
$ ssh db02 cat ~/.ssh/id_rsa.pub >>
~/.ssh/authorized_keys
$ ssh db02 cat ~/.ssh/id_dsa.pub >>
~/.ssh/authorized_keys
$ ssh db01 cat ~/.ssh/id_rsa.pub >>
~/.ssh/authorized_keys
$ ssh db01 cat ~/.ssh/id_dsa.pub >>
~/.ssh/authorized_keys
PS:如果提示是否连接选择yes,密码输入oracle用户的密码
7.在每个节点上分别设置authorized_keys文件的权限
# chmod 644 ~/.ssh/authorized_keys
8.防止X11转发造成的安装失败,创建~ /.ssh/config,并加入如下内容。
Host *
ForwardX11 no
9.以oracle用户身份,运行Oracle Universal
Installer的节点上执行如下命令,然后测试ssh的对等性。
# exec /usr/bin/ssh-agent $SHELL
节点1
# ssh db01 date
# ssh db02 date
节点2
# ssh db02 date
# ssh db01 date
如果都不需要密码,得到时间后。就说明ssh对等性配置成功。