15. 配置第二个虚拟机,node2。
复制E:\VirtualMachine\Node1文件夹下所有内容,到相同路径,并将node1文件夹重命名为node2。
在Vmware Web界面,单击 Virtual Machine,再单击Add Virtual Machine to Inventory。
单击Configure VM ,在Virtual Machine Name处输入Node2。
启动Node2后,单击I_copied it。
启动node2节点后,新建一个终端窗口,输入system-config-network,配置网络,如下图:

将eth0和eth1放置在非激活状态,并删除,接下来编辑别名为eth0.bak和eth1.bak,将eth0.bak的IP地址改为192.168.0.12,eth1.bak的IP改为10.101.0.12,并分别单击Hardware Device 选项卡,单击probe,以便为每个以太网设备分配新 MAC 地址。将两个网卡的名字改为eth0,eth1
修改DNS选项卡中的hostname为node2.oradb.com
使用Oracle身份,编辑.bash_profile,将ORACLE_SID改为ora10g2
使用root身份,修改/etc/hosts文件,被修改的内容如下
127.0.0.1 node2.oradb.com node2
修改 /export/home/oracle/.profile。用 ora10g2替换 ORACLE_SID 的值。
16. 建立等效性
以oracle用户在node1上执行
[oracle@node1 ~]$ mkdir ~/.ssh
[oracle@node1 ~]$ chmod 700 ~/.ssh
[oracle@node1 ~]$ 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:
ce:86:57:ab:7d:70:c7:44:4d:7b:f4:17:18:6c:18:bd oracle@node1.oradb.com
[oracle@node1 ~]$ 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:
48:fc:43:72:39:3b:83:95:1d:55:40:53:c0:35:63:c2 oracle@node1.oradb.com
接下来以oracle用户在node2上执行
[oracle@node2 ~]$ mkdir ~/.ssh
[oracle@node2 ~]$ chmod 700 ~/.ssh
[oracle@node2 ~]$ 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:
e9:3a:46:e8:5b:93:12:25:d0:a0:a4:f5:b8:eb:e2:45 oracle@node2.oradb.com
[oracle@node2 ~]$ 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:
f8:c2:ab:fb:c5:c8:68:c6:ec:df:69:8c:b5:26:37:ef oracle@node2.oradb.com
接下来以oracle用户在node1上执行
[oracle@node1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@node1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[oracle@node1 ~]$ ssh node2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 'node2 (192.168.0.12)' can't be established.
RSA key fingerprint is b0:71:5f:89:e0:9a:9d:c5:16:66:ec:a9:6d:d9:66:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.0.12' (RSA) to the list of known hosts.
oracle@node2's password:
[oracle@node1 ~]$ ssh node2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
oracle@node2's password:
[oracle@node1 ~]$ scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys
oracle@node2's password:
authorized_keys 100% 2032 2.0KB/s 00:00
在每个节点上做如下测试
[oracle@node1 ~]$ssh node1 date; ssh node2 date;
[oracle@node1 ~]$ssh node1-priv date;ssh node2-priv date;
[oracle@node1 ~]$ssh node1.oradb.com date;ssh node2.oradb.com date;
[oracle@node1 ~]$ssh node1-priv.oradb.com date; ssh node2-priv.oradb.com date;
17. 配置 Oracle 自动存储管理 (ASM),在两个节点上配置
[root@node1 ~]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
在任一节点创建ASM 磁盘
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [ OK ]
[root@node1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
