使用 VMware Server 在 Oracle Enterprise Linux 上安装 Oracle RAC 10g(三)

  1. 以 root 用户身份登录并执行 system-config-network,以修改网络配置。

    IP 地址:双击每个以太网设备,并使用下面的表进行必要的更改。

    设备IP 地址子网掩码 默认网关地址
    eth0192.168.2.132255.255.255.0192.168.2.1
    eth110.10.10.32255.255.255.0

    MAC 地址:导航到 Hardware Device 选项卡,并探测每个以太网设备的新 MAC 地址。

    主机名和 DNS:使用下面的表对 DNS 选项卡中的项进行必要的更改,然后按 CTRL-S 保存。

    主机名 首选 DNS备用 DNSDNS 搜索路径
    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

5. 配置 Oracle 自动存储管理 (ASM)

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

6. 配置 Oracle 集群文件系统 (OCFS2)

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
  1. OCFS2 控制台:选择 Cluster,然后选择 Configure Nodes
  2. “集群堆栈已经启动”:单击 Close
  3. 节点配置:单击 Add
  4. 新增节点:添加以下节点,然后单击 Apply
    • 名称:rac1
    • IP 地址: 192.168.2.131
    • IP 端口: 7777
    • 名称:rac2
    • IP 地址: 192.168.2.132
    • IP 端口: 7777
  5. 验证生成的配置文件。
    # 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
    
  6. 将配置文件传播到 rac2。您可以在 rac2 上重新运行上述步骤以生成配置文件,或者在 rac1 的 OCFS2 控制台上选择 ClusterPropagate Configuration 以将配置文件传播到 rac2。

配置 O2CB 驱动程序。O2CB 是一组集群服务,负责管理节点与集群文件系统之间的通信。下面是对各个服务的说明:

  • NM:用于跟踪 cluster.conf 中的所有节点的节点管理器
  • HB:当节点加入或离开集群时向上/向下发出通知的心跳服务
  • TCP:处理节点之间的通信
  • DLM:用于跟踪所有锁、这些锁的所有者以及状态的分布式锁管理器
  • CONFIGFS:在 /config 中挂载的用户空间驱动的配置文件系统
  • DLMFS:用户空间与内核空间 DLM 的接口

在两个节点上执行下面的过程,将 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
  1. OCFS2 控制台:选择 Tasks、Format
  2. 格式:
    • 可用设备:/dev/sdb1
    • 卷标:oracle
    • 集群大小:Auto
    • 节点插槽数量: 4
    • 块大小:Auto
  3. OCFS2 控制台:按 CTRL-Q 退出。

挂载文件系统。要挂载文件系统,在两个节点上执行以下命令。

# 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 的设置。验证您可以在两个节点的共享集群文件系统上读写文件。

7. 安装 Oracle 集群件

下载后,在 rac1 上以 oracle 用户身份执行

rac1-> /u01/staging/clusterware/runInstaller
  1. 欢迎页面:单击 Next
  2. 指定 Inventory 目录和证书:
    • 输入 inventory 目录的完整路径:/u01/app/oracle/oraInventory。
    • 指定操作系统组名:oinstall。
  3. 指定 Home 详细内容:
    • 名称:OraCrs10g_home
    • /u01/app/oracle/product/10.2.0/crs_1
  4. 特定于产品的必要条件检查:
    • 忽略有关物理内存要求的警告。
  5. 指定集群配置:单击 Add
    • 公共节点名称:rac2.mycorpdomain.com
    • 专用节点名称:rac2-priv.mycorpdomain.com
    • 虚拟主机名称:rac2-vip.mycorpdomain.com
  6. 指定网络接口用法:
    • 接口名称:eth0
    • 子网: 192.168.2.0
    • 接口类型:Public
    • 接口名称:eth1
    • 子网: 10.10.10.0
    • 接口类型:Private
  7. 指定 Oracle 集群注册表 (OCR) 位置:选择 External Redundancy
    为了简单起见,这里将不镜像 OCR。在生产环境中,您可能会考虑复用 OCR 以实现更高的冗余。
    • 指定 OCR 位置:/ocfs/clusterware/ocr
  8. 指定表决磁盘位置:选择 External Redundancy
    同样,为了简单起见,我们选择不镜像表决磁盘。
    • 表决磁盘位置:/ocfs/clusterware/votingdisk
  9. 摘要:单击 Install
  10. 执行配置脚本:以 root 用户身份按顺序执行以下脚本(一次执行一个)。在当前脚本完成后,再继续执行下一个脚本。
    • 在 rac1 上执行 /u01/app/oracle/oraInventory/orainstRoot.sh。
    • 在 rac2 上执行 /u01/app/oracle/oraInventory/orainstRoot.sh。
    • 在 rac1 上执行 /u01/app/oracle/product/10.2.0/crs_1/root.sh。
    • 在 rac2 上执行 /u01/app/oracle/product/10.2.0/crs_1/root.sh。
    rac2 上的 root.sh 脚本会自动调用 VIPCA,但会因为“The given interface(s), "eth0" is not public.Public interfaces should be used to configure virtual IPs.”错误而失败。如果您的公共接口使用不可路由的 IP 地址 (192.168.x.x),则 Oracle 集群验证实用程序 (CVU) 将无法找到合适的公共接口。一种解决方法是手动运行 VIPCA。
  11. 以 root 用户身份在第二个节点上手动调用 VIPCA。
    # /u01/app/oracle/product/10.2.0/crs_1/bin/vipca
  12. 欢迎页面:单击 Next
  13. 网络接口:选择 eth0
  14. 集群节点的虚拟 IP:
    • 节点名称:rac1
    • IP 别名:rac1-vip
    • IP 地址: 192.168.2.31
    • 子网掩码: 255.255.255.0
    • 节点名称:rac2
    • IP 别名:rac2-vip
    • IP 地址: 192.168.2.32
    • 子网掩码: 255.255.255.0
  15. 摘要:单击 Finish

    图 6

  16. 配置助手进度对话框:配置完成后,单击 OK
  17. 配置结果:单击 Exit
  18. 返回到 rac1 的执行配置脚本屏幕,然后单击 OK

    图 7

  19. 配置助手:验证所有检查均成功。OUI 在最后会执行集群件安装后检查。如果 CVU 失败,请更正问题,并以 oracle 用户身份重新运行以下命令:
    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.
    
  20. 安装结束:单击 Exit
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/38542/viewspace-906232/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/38542/viewspace-906232/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值