IP 地址:双击每个以太网设备,并使用下面的表进行必要的更改。
| 设备 | IP 地址 | 子网掩码 | 默认网关地址 |
| eth0 | 192.168.2.132 | 255.255.255.0 | 192.168.2.1 |
| eth1 | 10.10.10.32 | 255.255.255.0 | <保留空白> |
MAC 地址:导航到 Hardware Device 选项卡,并探测每个以太网设备的新 MAC 地址。
主机名和 DNS:使用下面的表对 DNS 选项卡中的项进行必要的更改,然后按 CTRL-S 保存。
| 主机名 | 首选 DNS | 备用 DNS | DNS 搜索路径 |
| rac2.mycorpdomain.com | 输入 DNS IP 地址或保留空白。 | 输入 DNS IP 地址或保留空白。 | 接受默认设置或保留空白。 |
最后,激活每个以太网设备。
修改 /etc/hosts。将以下项添加到 /etc/hosts 中。
127.0.0.1 localhost
稍后,在 Oracle 集群件软件安装期间,VIPCA 将尝试使用回送地址。
修改 /export/home/oracle/.profile。用 devdb2 替换 ORACLE_SID 的值。
使用 SSH 建立用户等效性。在集群就绪服务 (CRS) 和 RAC 安装过程中,Oracle Universal Installer (OUI) 必须能够以 oracle 的身份将软件复制到所有 RAC 节点,而不提示输入口令。在 Oracle 10g 中,可以使用 ssh 代替 rsh 完成此操作。
要建立用户等效性,请在两个节点上以 oracle 用户身份生成用户的公钥和私钥。打开 rac1 的电源,在这两个节点上执行以下任务。
在 rac1 上执行
rac1-> mkdir ~/.ssh rac1-> chmod 700 ~/.ssh rac1-> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /export/home/oracle/.ssh/id_rsa. Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub. The key fingerprint is: 87:54:4f:92:ba:ed:7b:51:5d:1d:59:5b:f9:44:da:b6 oracle@rac1.mycorpdomain.com rac1-> ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /export/home/oracle/.ssh/id_dsa. Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub. The key fingerprint is: 31:76:96:e6:fc:b7:25:04:fd:70:42:04:1f:fc:9a:26 oracle@rac1.mycorpdomain.com
在 rac2 上执行
rac2-> mkdir ~/.ssh rac2-> chmod 700 ~/.ssh rac2-> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /export/home/oracle/.ssh/id_rsa. Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub. The key fingerprint is: 29:5a:35:ac:0a:03:2c:38:22:3c:95:5d:68:aa:56:66 oracle@rac2.mycorpdomain.com rac2-> ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /export/home/oracle/.ssh/id_dsa. Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub. The key fingerprint is: 4c:b2:5a:8d:56:0f:dc:7b:bc:e0:cd:3b:8e:b9:5c:7c oracle@rac2.mycorpdomain.com
在 rac1 上执行
rac1-> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys rac1-> cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys rac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys The authenticity of host 'rac2 (192.168.2.132)' can't be established. RSA key fingerprint is 63:d3:52:d4:4d:e2:cb:ac:8d:4a:66:9f:f1:ab:28:1f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'rac2,192.168.2.132' (RSA) to the list of known hosts. oracle@rac2's password: rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys oracle@rac2's password: rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys oracle@rac2's password: authorized_keys 100% 1716 1.7KB/s 00:00
在每个节点上测试连接。验证当您再次运行以下命令时,系统是否不提示您输入口令。
ssh rac1 date ssh rac2 date ssh rac1-priv date ssh rac2-priv date ssh rac1.mycorpdomain.com date ssh rac2.mycorpdomain.com date ssh rac1-priv.mycorpdomain.com date ssh rac2-priv.mycorpdomain.com date
Oracle ASM 与 Oracle 数据库紧密集成在一起,并与 Oracle 的数据管理工具套件配合工作。它可以简化数据库存储管理,并提供原始磁盘 I/O 的性能。
配置 ASMLib。以 root 用户身份在两个节点上配置 ASMLib。
# /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 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 ]
创建 ASM 磁盘。以 root 用户身份在任何一个节点上创建 ASM 磁盘。
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1 Marking disk "/dev/sdc1" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1 Marking disk "/dev/sdd1" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk VOL3 /dev/sde1 Marking disk "/dev/sde1" as an ASM disk: [ OK ] Verify that the ASM disks are visible from every node. # /etc/init.d/oracleasm scandisks Scanning system for ASM disks: [ OK ] # /etc/init.d/oracleasm listdisks VOL1 VOL2 VOL3 VOL4
OCFS2 是 Oracle 开发的一个通用集群文件系统,与 Enterprise Linux 内核集成在一起。它允许所有节点在集群文件系统上同时共享文件,因而消除了管理原始设备的需求。这里,您将在 OCFS2 文件系统中寄宿 OCR 和表决磁盘。您可以从 OCFS2 用户指南获取有关 OCFS2 的其他信息。
在 Enterprise Linux 安装期间,您应该已经安装了 OCFS2 RPM。验证 RPM 是否已经安装在两个节点上。
rac1-> rpm -qa | grep ocfs ocfs2-tools-1.2.2-2 ocfs2console-1.2.2-2 ocfs2-2.6.9-42.0.0.0.1.ELsmp-1.2.3-2
创建 OCFS2 配置文件。 在 rac1 上,以 root 用户身份执行
# ocfs2console
# more /etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 192.168.2.131
number = 0
name = rac1
cluster = ocfs2
node:
ip_port = 7777
ip_address = 192.168.2.132
number = 1
name = rac2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
配置 O2CB 驱动程序。O2CB 是一组集群服务,负责管理节点与集群文件系统之间的通信。下面是对各个服务的说明:
在两个节点上执行下面的过程,将 O2CB 配置为在引导时启动。
当系统提示您指定心跳死亡阈值时,您必须指定一个大于 7 的值,以防止节点由于较慢的 IDE 磁盘驱动器而崩溃。心跳死亡阈值是一个用于计算隔离时间的变量。
Fence time (seconds) = (heartbeat dead threshold -1) * 2
在我们的环境中,120 秒的隔离时间很合适。两个节点上的心跳死亡阈值应该完全相同。
以 root 用户身份执行
# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets ('[]'). Hitting
without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [7]: 61
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
格式化文件系统。在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有活动,因为文件系统未挂载。
# /etc/init.d/o2cb status Module "configfs": Loaded Filesystem "configfs": Mounted Module "ocfs2_nodemanager": Loaded Module "ocfs2_dlm": Loaded Module "ocfs2_dlmfs": Loaded Filesystem "ocfs2_dlmfs": Mounted Checking O2CB cluster ocfs2: Online Checking O2CB heartbeat: Not active
您只需在一个节点上格式化文件系统。在 rac1 上,以 root 用户身份执行
# ocfs2console
挂载文件系统。要挂载文件系统,在两个节点上执行以下命令。
# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs
要在引导时挂载文件系统,在两个节点的 /etc/fstab 中添加以下行。
/etc/fstab
/dev/sdb1 /ocfs ocfs2 _netdev,datavolume,nointr 0 0
创建 Oracle 集群件目录。在 OCR 和表决磁盘将驻留的 OCFS2 文件系统中创建目录。
在 rac1 上执行
# mkdir /ocfs/clusterware # chown -R oracle:dba /ocfs
现在,您已经完成了 OCFS2 的设置。验证您可以在两个节点的共享集群文件系统上读写文件。
下载后,在 rac1 上以 oracle 用户身份执行
rac1-> /u01/staging/clusterware/runInstaller


rac1-> /u01/app/oracle/product/10.2.0/crs_1/bin/cluvfy stage -post crsinst -n rac1,rac2 Performing post-checks for cluster services setup Checking node reachability... Node reachability check passed from node "rac1". Checking user equivalence... User equivalence check passed for user "oracle". Checking Cluster manager integrity... Checking CSS daemon... Daemon status check passed for "CSS daemon". Cluster manager integrity check passed. Checking cluster integrity... Cluster integrity check passed Checking OCR integrity... Checking the absence of a non-clustered configuration... All nodes free of non-clustered, local-only configurations. Uniqueness check for OCR device passed. Checking the version of OCR... OCR of correct Version "2" exists. Checking data integrity of OCR... Data integrity check for OCR passed. OCR integrity check passed. Checking CRS integrity... Checking daemon liveness... Liveness check passed for "CRS daemon". Checking daemon liveness... Liveness check passed for "CSS daemon". Checking daemon liveness... Liveness check passed for "EVM daemon". Checking CRS health... CRS health check passed. CRS integrity check passed. Checking node application existence... Checking existence of VIP node application (required) Check passed. Checking existence of ONS node application (optional) Check passed. Checking existence of GSD node application (optional) Check passed. Post-check for cluster services setup was successful.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/38542/viewspace-906232/ ,如需转载,请注明出处,否则将追究法律责任。