为远程访问配置 RAC 节点
当在一个 RAC 节点上运行 Oracle Installer 时,它将使用 rsh 命令把 Oracle 软件复制到 RAC 集群中的所有其他节点。在运行 Oracle Installer 的节点上的 oracle UNIX 帐号 ( runIntaller ) 必须为您 RAC 集群中的所有其他节点所信任。这意味着您应该能够在此 RAC 节点上不需要口令而根据其他 RAC 节点来运行 r* 命令,如 rsh 、 rcp 和 rlogin 等。 rsh 后台程序使用在用户 (oracle) 的主目录中所找到的 /etc/hosts.equiv 文件和 .rhosts 文件来验证用户。不幸的是,它不支持 SSH 。
首先,让我们确认已经在 RAC 集群中的每个节点上安装了 rsh RPM :
# rpm -q rsh rsh-server
rsh-0.17-19
rsh-server-0.17-19
根据以上情况,我们可以了解到已经安装了 rsh 和 rsh-server 。
注意: 如果没有安装 rsh ,则运行以下命令:
# su -
# rpm -ivh rsh-0.17-5.i386.rpm rsh-server-0.17-5.i386.rpm
要启动 “rsh” 服务,必须将 /etc/xinetd.d/rsh 文件中的 “disable” 属性设置为 “ no ” ,并且必须刷新 xinetd 。通过运行以下命令可以完成此工作:
# su -
# chkconfig rsh on
# chkconfig rlogin on
# service xinetd reload
Reloading configuration:[ OK ]
要使得 “oracle”UNIX 用户帐号在 RAC 节点中获得信任,需要创建 /etc/hosts.equiv 文件:
# su -
# touch /etc/hosts.equiv
# chmod 600 /etc/hosts.equiv
# chown root.root /etc/hosts.equiv
现在将所有 RAC 节点添加到类似于以下示例的 /etc/hosts.equiv 文件中:
# cat /etc/hosts.equiv
+linux1 oracle
+linux2 oracle
+int-linux1 oracle
+int-linux2 oracle
请确保您的 RAC 集群中的所有节点上都存在 /etc/hosts.equiv 文件!
注意: 在以上示例中,第二个字段只允许 oracle 用户帐号在所指定的节点上运行 rsh 命令。由于安全原因, /etc/hosts.equiv 文件应该由 root 所拥有,并应该将权限设置为 600 。实际上,某些系统只有在该文件的所有者为 root 并且权限被设置为 600 时才接受此文件的内容。
注意: 在尝试测试您的 rsh 命令之前,请确保您正在使用正确版本的 rsh 。在默认情况下, Red Hat Linux 将 /usr/kerberos/sbin 放在 $PATH 变量的前面。这会导致执行 rsh 的 Kerberos 版本。
我通常会重命名 rsh 的 Kerberos 版本,以便使用正常的 rsh 命令。使用以下命令:
# su -
# which rsh
/usr/kerberos/bin/rsh
# cd /usr/kerberos/bin
# mv rsh rsh.original
# which rsh
/usr/bin/rsh
您现在应该测试您的连接并根据每个 RAC 来运行 rsh 命令。我使用节点 linux1 来执行安装。
# su - oracle
$ rsh int-linux1 ls -l /etc/hosts.equiv
-rw------- 1 root root 68 May 2 14:45 /etc/hosts.equiv
$ rsh int-linux2 ls -l /etc/hosts.equiv
-rw------- 1 root root 68 May 2 14:45 /etc/hosts.equiv
用于每个 RAC 节点的所有启动命令(用于两个节点)
到现在为止,我们已经详细讨论了在我们的 Oracle9 i RAC 配置中需要在两个节点上进行配置的参数和资源。在本部分中,我们将稍事调整,简要复述这些参数、命令和项目(在本文前面的章节中已出现),当启动机器时需要在每个节点上执行它们。
在本部分中,我提供了到目前为止我们已经讨论过的所有命令、参数和项目,它们需要被包括在 RAC 集群中每个 Linux 节点的所有启动脚本中。以下的每个启动文件中,对于那些为建立成功运行的 RAC 节点而应当在每个文件中包含的项目,都用粗体显示。
文件: /etc/modules.conf —
需要配置的所有内核参数和模块。
alias eth0 tulip
alias usb-controller usb-uhci
alias usb-controller1 ehci-hcd
alias ieee1394-controller ohci1394
alias sound-slot-0 cmpci
options sbp2 sbp2_exclusive_login=0
post-install sbp2 insmod sd_mod
post-remove sbp2 rmmod sd_mod
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :
alias eth1 8139too
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
文件: /etc/sysctl.conf
我们希望为互联而调整默认的和最大的发送缓冲区大小以及默认的和最大的接收缓冲区大小。
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Default setting in bytes of the socket receive buffer
net.core.rmem_default=262144
# Default setting in bytes of the socket send buffer
net.core.wmem_default=262144
# Maximum socket receive buffer size which may be set by using
# the SO_RCVBUF socket option
net.core.rmem_max=262144
# Maximum socket send buffer size which may be set by using
# the SO_SNDBUF socket option
net.core.wmem_max=262144
文件: /etc/hosts
我们的 RAC 集群中的节点的所有机器 /IP 项。
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.100 linux1
192.168.2.100 int-linux1
192.168.1.101 linux2
192.168.2.101 int-linux2
192.168.1.102 alex
192.168.1.105 bartman
文件: /etc/hosts.equiv
允许在不需要口令的情况下以 oracle 用户帐号登录到每个节点。
+linux1 oracle
+linux2 oracle
+int-linux1 oracle
+int-linux2 oracle
文件: /etc/grub.conf
确定在启动节点时使用哪个内核。
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:You have a /boot partition.This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core ( 2.4.21 -9.0.1.ELorafw1)
root (hd0,0)
kernel /vmlinuz- 2.4.21 -9.0.1.ELorafw1 ro root=LABEL=/ rhgb
initrd /initrd- 2.4.21 -9.0.1.ELorafw1.img
title Fedora Core ( 2.4.22 -1.2115.nptl)
root (hd0,0)
kernel /vmlinuz- 2.4.22 -1.2115.nptl ro root=LABEL=/ rhgb
initrd /initrd- 2.4.22 -1.2115.nptl.img