操作系统:linux suse enterprise sp11
数据库版本:oracle 11.2.0.3 RAC
问题描述:在有的操作系统上安装oracle 11g rac环境的时候,会出现节点之间的ssh信任自动配置不通过,这里可能就要用老办法手动这只一下。在安装grid和数据库软件的时候可能都会出现这个问题,我这里已安装数据库软件oracle用户测试,如果安装grid的时候需要手动配置,换成grid用户即可:
在节点一的oracle用户执行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
oracle@rac1:~> pwd /home/oracle oracle@rac1:~> mkdir .ssh oracle@rac1:~> chmod 755 .ssh/ oracle@rac1:~> /usr/bin/ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: 4a:1d:a3:ee:c7:21:19:8e:56:82:77:37:64:4f:6d:bf oracle@rac1 The key's randomart image is: +--[ RSA 2048]----+ | . | | o . o | | . ooo . . | | . o +ooo. . | | . *o+S. . | | oo+.. E | | . oo . | | . o | | .. | +-----------------+ oracle@rac1:~> /usr/bin/ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/oracle/.ssh/id_dsa. Your public key has been saved in /home/oracle/.ssh/id_dsa.pub. The key fingerprint is: 58:1b:26:c3:a0:67:0a:bf:ec:17:37:3a:79:b2:0e:37 oracle@rac1 The key's randomart image is: +--[ DSA 1024]----+ | . | | . o | |. . o + + | | o + * o | | o . S | | . .. o | | + E= . | | . o*.. | | .oo= | +-----------------+ oracle@rac1:~> touch .ssh/authorized_keys |
然后登陆节点二的oracle用户执行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
oracle@rac2:~> pwd /home/oracle oracle@rac2:~> mkdir .ssh oracle@rac2:~> chmod 755 .ssh/ oracle@rac2:~> /usr/bin/ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: 5d:14:f1:41:53:e0:a3:cb:dd:e9:93:de:fc:4e:50:46 oracle@rac2 The key's randomart image is: +--[ RSA 2048]----+ | ++=oE| | . o + | | . + o| | . . . + | | S . . . | | . o o.| | o ..+| | .=.| | .+B| +-----------------+ oracle@rac2:~> /usr/bin/ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/oracle/.ssh/id_dsa. Your public key has been saved in /home/oracle/.ssh/id_dsa.pub. The key fingerprint is: 7a:a0:e8:19:5f:65:7a:de:6b:50:26:ab:45:62:1e:b7 oracle@rac2 The key's randomart image is: +--[ DSA 1024]----+ | | | | | | | + + o | | o.=S* | | . ..*E | | o . +oo. | | . + ..+ .. | | o . ..o. | +-----------------+ |
切换到节点一的oracle用户执行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
oracle@rac1:~> ssh rac1 cat /home/oracle/.ssh/id_rsa.pub >> .ssh/authorized_keys The authenticity of host 'rac1 (192.168.207.135)' can't be established. RSA key fingerprint is dc:48:0c:73:57:32:33:3f:54:ee:f1:35:db:47:f3:14. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'rac1,192.168.207.135' (RSA) to the list of known hosts. Password: oracle@rac1:~> ssh rac1 cat /home/oracle/.ssh/id_dsa.pub >> .ssh/authorized_keys oracle@rac1:~> ssh rac2 cat /home/oracle/.ssh/id_rsa.pub >> .ssh/authorized_keys Password: oracle@rac1:~> ssh rac2 cat /home/oracle/.ssh/id_dsa.pub >> .ssh/authorized_keys Password: oracle@rac1:~> scp .ssh/authorized_keys rac2:/home/oracle/.ssh/ Password: authorized_keys 100% 1988 1.9KB/s 00:00 oracle@rac1:~> chmod 600 .ssh/authorized_keys oracle@rac1:~> exec /usr/bin/ssh-agent $SHELL oracle@rac1:~> /usr/bin/ssh-add Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa) Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa) |
再次切换到节点二的oracle用户执行:
1 2 3 4 5 |
oracle@rac2:~> chmod 600 .ssh/authorized_keys oracle@rac2:~> exec /usr/bin/ssh-agent $SHELL oracle@rac2:~> /usr/bin/ssh-add Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa) Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa) |
ok,此时再setup一次,test就可以通过了。
- 本文固定链接: http://www.savedba.com/?p=183
- 转载请注明: 版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!