13. 注意:此处一定要选中 Allocate all disk space now,即首先分配足额的磁盘空间,避免后期需要使用时
再分配,可能会造成虚拟机崩溃。
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289
49. Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0
[ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
提示:此时两机使用 4 个 IP 或 4 个别名互 ping 应该都是通的了,如果不通,建议按照上述的操作步骤 ,
检查一下网络的配置。
3、修改 oracle 用户下的环境变量等
[root@node2 network-scripts]# vi /home/oracle/.bash_profile
将 ORACLE_SID=RACDB1 改为 ORACLE_SID=RACDB2
统统设置完成后,建议重启一下第 2 个节点。
六、配置 Clusterware 安装环境
1、设置 ssh
在 clusterware (CRS) 和 Rac Database 安装过程中,Oracle Universal Installer (OUI) 必须能够以 oracle
的身份自动将软件复制到所有 RAC 节点。这里我们通过配置 ssh 让 oracle 用户拥有不输入密码即可访问
各节点的能力。
首先两个节点间互 ping,要确保都是通的
[root@node1 ~]# ping 192.168.100.102
[root@node1 ~]# ping 10.10.17.222
要建立用户等效性, 需要在两个节点上以 oracle 用户身份生成用户的公钥和私钥, 首先在 node1 执行 :
[root@node1 opt]# su - oracle
[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:
d2:69:eb:ac:86:62:27:50:99:ff:e8:1e:a2:e6:5d:7f oracle@node1
[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):
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289
50. 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:
0a:9a:20:46:a2:28:ec:72:23:82:f2:9d:f8:62:9b:d1 oracle@node1
然后换 node2 执行
[root@node2 ~]# ping 192.168.100.102
[root@node2 ~]# ping 10.10.17.222
[root@node2 opt]# su - oracle
[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:
dd:be:7a:37:e4:b5:f0:b2:24:95:50:61:ea:a1:61:07 oracle@node2
[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:
bc:b5:cb:43:c7:19:53:d6:f7:16:69:85:12:7f:aa:be oracle@node2
切换回 node1,接着执行:
[oracle@node1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@node1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
提示:下列命令会提示你输入 node2 的 oracle 密码,按照提示输入即可,如果失败可重新尝试执行命
令。
[oracle@node1 ~]$ ssh node2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 'node2 (192.168.100.102)' can't be established.
RSA key fingerprint is 92:d1:ce:5b:c8:a1:52:d5:ac:00:5f:48:5d:12:06:e4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.100.102' (RSA) to the list of known hosts.
oracle@node2's password:
[oracle@node1 ~]$ ssh node2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289
51. oracle@node2's password:
[oracle@node1 ~]$ scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys
oracle@node2's password:
authorized_keys 100% 1992 2.0KB/s 00:00
两机相互执行,看看是否还需要输入密码
[oracle@node1 ~]$ ssh node1 date
[oracle@node1 ~]$ ssh node2 date
[oracle@node1 ~]$ ssh node1-priv date
[oracle@node1 ~]$ ssh node2-priv date
切换至 node2 执行
[oracle@node2 ~]$ ssh node1 date
[oracle@node2 ~]$ ssh node2 date
[oracle@node2 ~]$ ssh node1-priv date
[oracle@node2 ~]$ ssh node2-priv date
提示:
注意命令的返回信息,由于 rac 对节点间时间较敏感,因此如果此处显示节点单时间不一至,建议同
步(一般相隔超过 20 秒就需要同步时间了)。
2、配置 asm
注意:必须以 root 身份进行
首先在 node1 执行:
[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
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
提示:如果本步执行出错(可能出错机率最高的是在 Scanning system for ASM),不妨将转换一下命令行
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289
52. 的执行方式,改成:
[root@node1 ~]# sh /etc/init.d/oracleasm configure
有可能解决你的问题!
然后切换至 node2 执行
[root@node2 ~]# /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
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
再切换回 node1 执行
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
[root@node1 linux-patch]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
查看一下当前的磁盘组:
Scanning system for ASM disks: [ OK ]
[root@node1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
Node2 上也查看一下当前磁盘组:
[root@node2 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@node2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289
53. Ok,配置完成,准备进入到 crs 的安装阶段
七、安装 Clusterware
注意,在这项配置中,除非特别说明,所有操作都是基于 oracle 用户的。
1、检查安装环境
在安装 crs 之前,建议先利用 CVU(Cluster Verification Utility)检查 CRS 的安装前环境
[oracle@node1 cluvfy]$ /data/rhel5/clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n node1,node2 -
verbose
返回信息太多,这里就不贴俺执行的结果了。
需要注意几点,其返回的信息中有几个错误可忽略~~
A).与 VIP 查找一组适合的接口有关,错误信息如下:
错误信息如下:
ERROR:
Could not find a suitable set of interfaces for VIPs.
这是一个 bug,Metalink 中有详细说明,doc.id:338924.1,如说明中所述,可以忽略该错误,没什么问
题。
B).有一堆包的验证会出现错误,要么提示找不到,要么是版本不对。例如:
Check: Package existence for "compat-gcc-7.3-2.96.128"
Node Name Status Comment
------------------------------ ------------------------------ ----------------
node2 missing failed
node1 missing failed
Result: Package existence check failed for "compat-gcc-7.3-2.96.128".
Check: Package existence for "compat-gcc-c++-7.3-2.96.128"
Node Name Status Comment
------------------------------ ------------------------------ ----------------
node2 missing failed
node1 missing failed
Result: Package existence check failed for "compat-gcc-c++-7.3-2.96.128".
...........
...........
这之类的吧
不用管它们,这也是一个 BUG,只要确认节点中都已经安装了正确版本的 compat-* 包即可。
C).内存检查失败
可以忽略的错误,内存差一点并不会影响到 crs 的安装,只是慢一些而已。当然如果人家要求 512M,
[三思笔记]-手把手教你用 VMware 在 linux 下安装 Oracle10g RAC http://www.5ienet.com/ QQ:5454589 君三思 群:59666289