linux下Oracle11g RAC搭建(五)

四、建立主机间的信任关系(node1、node2)

建立节点之间oracle 、grid 用户之间的信任(通过ssh 建立公钥和私钥)

分别在node1和node2创建

=====Oracle用户=========================

在oracle用户下操作:

[[email protected] /]# su - oracle

[[email protected] ~]$ mkdir .ssh       创建一个.ssh的隐藏目录

[[email protected] ~]$ ls -al

total 44

-rw-r--r-- 1 oracle oinstall   33 Jul 12 17:05 .bash_logout

-rw-r--r-- 1 oracle oinstall  438 Jul 12 18:03 .bash_profile

drwxr-xr-x 4 oracle oinstall 4096 Jul 1217:05 .mozilla

drwx------ 2 oracle oinstall 4096 Jul 1218:05 .ssh

-rw------- 1 oracle oinstall  657 Jul 12 18:03 .viminfo

1)生成密钥对(rsa+dsa)(node1、node2)

node1生成密钥rsa类型

id_rsa为私钥,自动保存到.ssh下

id_rsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen -t rsa  

Generating public/private rsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_rsa):  enter

Enter passphrase (empty for nopassphrase):  enter

Enter same passphrase again:  enter

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:

64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:[email protected]

node1生成密钥dsa类型

id_dsa为私钥,自动保存到.ssh下

id_dsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen -t dsa

Generating public/private dsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter 

Enter passphrase (empty for no passphrase):enter

Enter same passphrase again: enter

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:

7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:[email protected]

node2生成密钥rsa类型

id_rsa为私钥,自动保存到.ssh下

id_rsa.pub为公钥,自动保存到.ssh下

[[email protected] asm]# su - oracle

[[email protected] ~]$ mkdir .ssh

[[email protected] ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_rsa):  enter

Enter passphrase (empty for nopassphrase):  enter

Enter same passphrase again:  enter

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:

64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:[email protected]

node2生成密钥dsa类型

id_dsa为私钥,自动保存到.ssh下

id_dsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen -tdsa    

Generatingpublic/private dsa key pair.

Enter file inwhich to save the key (/home/oracle/.ssh/id_dsa): enter 

Enter passphrase(empty for no passphrase): enter

Enter samepassphrase again: enter

Youridentification has been saved in /home/oracle/.ssh/id_dsa.

Your public keyhas been saved in /home/oracle/.ssh/id_dsa.pub.

The keyfingerprint is:

7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:[email protected]

2)配置信任关系(node1、node2)

为node1配置信任

[[email protected] ~]$ ls .ssh

id_dsa       id_rsa             id_dsa.pub   id_rsa.pub

//rsa和dsa为私钥                .pub的为公钥

//ssh下文件authorized_keys是专门存储公钥信息的

//把rsa、dsa类型的公钥文件都放入到authorized_keys文件里

// “ssh  node2”命令代表登陆到节点2下操作

//把两种类型的公钥信息都放到节点2的authorized_keys文件里

[[email protected] ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ ssh node2  cat .ssh/id_rsa.pub>>.ssh/authorized_keys

[email protected]‘s password:

[[email protected] ~]$ ssh
node2  cat .ssh/id_dsa.pub>>.ssh/authorized_keys

[email protected]‘s password:  oracle的密码

为node2配置信任

可以把node1中的authorized_keys(密钥文件)复制到node2中

[[email protected] ~]$ scp.ssh/authorized_keys   node2:~/.ssh

[email protected]‘s password: oracle的密码

3)验证信任关系(node1、node2)

node1上验证信任

[[email protected] ~]$ ssh
node2date

[[email protected] ~]$ ssh
node2-privdate    
//私有ip地址验证

[[email protected] ~]$ ssh
node1date

[[email protected] ~]$ ssh
node1-privdate    

详细操作如下:

[[email protected] ~]$ ssh node2date

Thu May  214:46:30 CST 2013

[[email protected] ~]$ sshnode2-priv date                 //不要求输入密码代表信任成功

The authenticity of host ‘node2-priv (10.10.10.2)‘can‘t be established.

RSA key fingerprint is16:28:88:50:27:30:92:cb:49:be:55:61:f6:c2:a1:3f.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘node2-priv,10.10.10.2‘(RSA) to the list of known hosts.

Thu May  214:47:03 CST 2013

[[email protected] ~]$ sshnode2-priv date

Thu May  214:47:05 CST 2013

[[email protected] ~]$ ssh node1date

Thu May  214:48:19 CST 2013

[[email protected] ~]$ sshnode1-priv date

The authenticity of host ‘node1-priv (10.10.10.1)‘can‘t be established.

RSA key fingerprint is39:04:88:3b:54:34:3c:34:d2:df:74:37:fe:5f:92:2d.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘node1-priv,10.10.10.1‘(RSA) to the list of known hosts.

Thu May  214:48:35 CST 2013

[[email protected] ~]$ sshnode1-priv date

Thu May  214:48:36 CST 2013

node2上验证信任

[[email protected] ~]$ ssh
node1date

[[email protected]~]$ ssh
node1-priv date    

[[email protected] ~]$ ssh
node2date

[[email protected]~]$ ssh
node2-priv date    

=====Grid 用户==========================

步骤同oracle
一样,可参考oracle用户下设置

在grid用户下操作:

[[email protected] /]# su– grid

[[email protected] ~]$mkdir .ssh       创建一个.ssh的隐藏目录

[[email protected] ~]$ ls-al

1)生成密钥对(rsa+dsa)(node1、node2)

node1生成密钥rsa类型

id_rsa为私钥,自动保存到.ssh下

id_rsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen-t rsa     

Generating public/private rsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_rsa): 
enter

Enter passphrase (empty for no passphrase):  enter

Enter same passphrase again:  enter

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:

64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:[email protected]

node1生成密钥dsa类型

id_dsa为私钥,自动保存到.ssh下

id_dsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen-t dsa    

Generating public/private dsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter

Enter passphrase (empty for no passphrase): enter

Enter same passphrase again: enter

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:

7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:[email protected]

node2生成密钥rsa类型

id_rsa为私钥,自动保存到.ssh下

id_rsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]# su – grid

[[email protected] ~]$ mkdir .ssh

[[email protected] ~]$ ssh-keygen-t rsa     

Generating public/private rsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_rsa): 
enter

Enter passphrase (empty for no passphrase):  enter

Enter same passphrase again:  enter

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:

64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:[email protected]

node2生成密钥dsa类型

id_dsa为私钥,自动保存到.ssh下

id_dsa.pub为公钥,自动保存到.ssh下

[[email protected] ~]$ ssh-keygen -t dsa    

Generating public/private dsa key pair.

Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter

Enter passphrase (empty for no passphrase): enter

Enter same passphrase again: enter

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:

7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:[email protected]

2)配置信任关系(node1、node2)

为node1配置信任

[[email protected] ~]$ ls .ssh

id_dsa       id_rsa             id_dsa.pub   id_rsa.pub      known_hosts

rsa和dsa为私钥                .pub的为公钥

[[email protected] ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ ssh node2  cat .ssh/id_rsa.pub>>.ssh/authorized_keys

[email protected]‘s password:

[[email protected] ~]$ ssh
node2  cat .ssh/id_dsa.pub >>.ssh/authorized_keys

[email protected]‘s password: grid的密码

为node2配置信任

可以把node1中的authorized_keys(密钥文件)复制到node2中

[[email protected] ~]$ scp.ssh/authorized_keys  
node2:~/.ssh

[email protected]‘s password: grid的密码

authorized_keys                             100% 1992     2.0KB/s  00:00

3)验证信任关系(node1、node2)

node1上验证信任

[[email protected] ~]$ ssh
node2date

[[email protected] ~]$ ssh
node2-privdate    

[[email protected] ~]$ ssh
node1date

[[email protected] ~]$ ssh
node1-privdate    

详细操作如下:

[[email protected] ~]$ ssh node2date

Thu May  214:46:30 CST 2013

[[email protected] ~]$ sshnode2-priv date                  //不要输入密码为信任成功

The authenticity of host ‘node2-priv (10.10.10.2)‘can‘t be established.

RSA key fingerprint is 16:28:88:50:27:30:92:cb:49:be:55:61:f6:c2:a1:3f.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘node2-priv,10.10.10.2‘(RSA) to the list of known hosts.

Thu May  214:47:03 CST 2013

[[email protected] ~]$ sshnode2-priv date

Thu May  214:47:05 CST 2013

[[email protected] ~]$ ssh node1date

Thu May  214:48:19 CST 2013

[[email protected] ~]$ sshnode1-priv date

The authenticity of host ‘node1-priv (10.10.10.1)‘can‘t be established.

RSA key fingerprint is39:04:88:3b:54:34:3c:34:d2:df:74:37:fe:5f:92:2d.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘node1-priv,10.10.10.1‘(RSA) to the list of known hosts.

Thu May  214:48:35 CST 2013

[[email protected] ~]$ sshnode1-priv date

Thu May  214:48:36 CST 2013

node2上验证信任

[[email protected] ~]$ ssh
node1date

[[email protected]~]$ ssh
node1-priv date    

[[email protected] ~]$ ssh
node2date

[[email protected]~]$ ssh
node2-priv date    

声明:

原创作品,出自 “深蓝的blog” 博客,允许转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

关于涉及版权事宜,作者有权追究法律责任。

************************** 未完待续 敬请关注 **************************************

linux下Oracle11g RAC搭建(五)

时间: 2024-12-08 09:08:43

linux下Oracle11g RAC搭建(五)的相关文章

linux下Oracle11g RAC搭建(八)

七.安装oracle软件   直接在图形界面里安装oracle,在node1操作 在虚拟机界面中,直接切换到oracle用户下: [[email protected] grid]$ su – oracle [[email protected] ~]$ cd /soft/database [[email protected] database] $  ./runInstaller 出现集群环境 以root用户在node1和node2分别运行脚本 [[email protected] ~]#  /u

linux下Oracle11g RAC搭建(七)

六.安装Grid 启动GRID安装界面 方式一:redhat下调整分辨率 [[email protected] ~]# xhost +       //授权 [[email protected] ~]#su - grid [[email protected] ~]$cd /soft/grid [[email protected] ~]$ls [[email protected] ~]$./runInstaller 方式二:设置vnc 启动vnc服务 [[email protected] yum.

linux下Oracle11g RAC搭建(三)

二.配置安装环境 (node1.node2) 建立组.用户.目录并修改权限(node1.node2) node1上建立组.用户.初始密码 建立组:#groupadd [-g] [gid] [组名] 建立用户:#useradd [-u] [uid] [ -g][ 用户的主组] [ –G] [用户的副组] [用户名] 执行脚本:#sh mkuser.sh groupadd  -g 200oinstall groupadd  -g 201dba groupadd  -g 202oper groupad

linux下Oracle11g RAC搭建(九)

八.创建ASM仓储 同样在图形化界面操作 [[email protected] ~]#  su - grid [[email protected] ~]$ asmca   //创建两个磁盘组:数据文件磁盘组和快速恢复区磁盘组 [[email protected] ~]$ cd /u01/11.2.0/grid/bin                 //asmca的路径 [[email protected] ~]$ asmca -bash: asmca: command not found //

linux下Oracle11g RAC搭建(一)

文档说明 作者    深蓝 项目 Visualbox下模拟RAC搭建(双节点)(Redhat5+Oracle11G) 环境 RedHat Enterprise5.5.Oracle 11g 11.2.0 日期 2014年4月12日 版本 v1.1 说明 准备两台虚拟机,node1(节点1),node2(节点2) ,均已安装好linux操作系统 另:由于是搭建结束后整理的文档,其中节点1.节点2的命名细节上会有不统一的,参阅时请您注意.由于时间关系,会逐渐完善. RAC基础知识 Cluster 通过

linux下Oracle11g RAC搭建(六)

五.校验安装前的环境 root身份下完毕解压grid.database安装包 [[email protected] soft]$ su - Password: [[email protected] ~]# cd /soft [[email protected] soft]# ls asm linux_11gR2_database_1of2.zip linux_11gR2_database_2of2.zip linux_11gR2_grid.zip [[email protected] soft]

linux下Oracle11g RAC搭建(四)

1.进入短信界面 2.菜单-设置 3.修改短信中心号码(Set the SIM's smsc number) 保存 [测试结果]:提示保存成功,但是号码没有改变,退出重新进入设置才会看到号码更新 [预期结果]:提示保存成功,号码变为修改过的号码 相关Activity:通过Logcat中I/ActivityManager( 896):我们可以定位到该类-MessagingPreferenceActivity: 相关控件:mSmscPrefList.add(pref); 根据分析我们发现在Messa

linux下oracle11G DG搭建(四):后续验证操作

环境 名称 主库 备库 主机名 bjsrv shsrv 软件版本 RedHat Enterprise5.5.Oracle 11g 11.2.0.1 RedHat Enterprise5.5.Oracle 11g 11.2.0.1 主库下 $ tail -f /u01/app/oracle/diag/rdbms/bjdb/TestDB12/trace/alert_TestDB12.log 对于DG,一定要打开告警日志. 备库下 $ tail -f/u01/app/oracle/diag/rdbms

Linux下Oracle11G RAC报错:在安装oracle软件时报file not found一例

Linux下Oracle11G RAC报错:在安装oracle软件时报file notfound一例 1.现象 之前安装一切都比較顺利,安装oracle软件时,进度到30%时报错:file not found(/u01/app/oracle/product/11.2.0/db_1/owb/external/oc4j_applications/applications/WFMLRSVCApp.ear) 2.应对策略 1.  改变选择语言处.仅仅选择"English": 2.  又一次解压