在裸金属解决方案上安装 RAC 的最佳做法

本页面介绍了在裸金属解决方案上安装 Oracle RAC 之前要查看的最佳做法。

1.18c Oracle GI 集群名称长度错误。

Oracle GI 18C 存在一个影响裸金属解决方案的集群名称长度错误。

建议执行的操作:

集群名称长度必须少于 15 个字符,否则 root.sh 脚本将在第一步失败并显示错误 host name is too long。默认集群名称长度超过 15 个字符,因此您必须先更改该名称,然后才能运行脚本。

2.SSH

SSH 验证可能因 OPEN ssh 问题而失败。

OpenSSH_6.7: ERROR [INS-06003] Failed to setup passwordless SSH connectivity During Grid Infrastructure Install (Doc ID 2111092.1)

建议执行的操作:

Edit the `/etc/ssh/sshd_config` file to contain the following line:

KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

重启 sshd 服务以使更改生效。

/etc/init.d/sshd restart

3.VNC 服务器

诸如 VNC 等任意服务器会被默认操作系统防火墙配置阻止。请改为通过 SSH 建立 Xwindows 或 VNC 隧道:

ssh -L 5901:localhost:5901 bms-host
vncviewer localhost:1

4.根文件系统

确保根 / 文件系统有足够的可用空间。

您至少需要为主机提供 20GB 的可用空间,才能创建其根文件系统。

5. DNS

如果您未使用 Cloud DNS,请在裸金属解决方案上安装您自己的域名服务器来解析主机 IP 地址。Oracle 网格基础架构使用 nslookup 命令来获取 DNS 名称。nslookup 不使用 /etc/hosts

# install these files:
yum makecache
yum install dnsmasq

## Edit /etc/dnsmasq.conf and add these lines:
port=53
domain-needed
bogus-priv
strict-order
expand-hosts
domain=localdomain
address=/.localdomain/127.0.0.1
address=//127.0.0.1
listen-address=127.0.0.1
resolv-file=/etc/dnsmasq-resolv.conf
# Save the file.

# The files /etc/dnsmasq-resolv.conf and /etc/resolv.conf should contain only
# the following one line. Edit them if this is not the case.
nameserver 127.0.0.1

# Start the dnsmasq service:
systemctl restart dnsmasq
systemctl status dnsmasq

# verify the host names are resolved:
nslookup <host name 1>
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   <host name 1>
Address: 192.168.1.10

nslookup <host name 2>
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   <host name 2>
Address: 192.168.1.11

6.安装 NTP。

安装网络时间协议 (NTP),并确保所有 RAC 节点将时间与 jumpshot 或内部 NTP 服务器同步。

# install and start the NTP service
yum install ntp
systemctl start ntpd
# Add the following line to the /etc/ntp.conf file. In this case we are syncing
# with our bastion which is 10.x.x.x in this case. This can be your internal NTP
server. 192.x.x.x is your host.

restrict 192.x.x.x mask 255.255.255.0 nomodify notrap
server 10.x.x.x prefer

ntpdate -qu {your host name}

7. root.sh

运行 root.sh 时,请一次运行一个节点。

8. Localhost。

确保 localhost 解析为 127.0.0.1。主机不会将 localhost 放入 /etc/hosts 文件中。

9. Ulimit

确保根用户和 Oracle 用户的 ulimit 具有足够的限制。

10. SCP 文件复制需要很长时间才完成密钥更新操作。

这是由于裸金属解决方案 ssh 守护程序配置问题造成的。

建议执行的操作:

# Modify your ssh config on the host server side.
vi /etc/ssh/sshd_config

# Add this line or modify it if you already set.
ClientAliveInterval 420

# Restart SSH
service sshd restart

11. OracleASM

如果您使用的是 Oracle ASMLIB,请务必设置 ORACLEASM_SCANORDER 环境变量,这样单路径 ASM 设备就不会先被 Oracle 存储空间自动管理选取。

建议执行的操作:如下所示设置 scanorder。

ORACLEASM_SCANORDER="multipath sd"

12. CRS root.sh 或 OCSSD 失败,并显示 No Network HB 错误。

使用 Oracle Cluster Ready Services (CRS) 时,如果节点可以与 169.254.169.254 IP 地址进行 ping 连接,则 root.sh 脚本可能会失败。169.254.169.254 是一种 Google Cloud 元数据服务,用于在 Google Cloud中注册实例。 Google Cloud 如果您屏蔽此 IP 地址,虚拟机将无法启动。但是,裸金属解决方案 RAC 服务器将遇到 HAIP 通信问题,因为它可能会中断 HAIP 通信路由。在这种情况下,您可能需要屏蔽该 IP 地址或停用 HAIP。以下示例展示了如何使用路由语句来阻止 IP 地址。Linux 路由语句不是永久性的,因此您需要将其添加到网络或 rc 脚本中。

建议执行的操作:在所有节点上运行以下命令,然后再重新运行 root.sh

/sbin/route add -host 169.254.169.254 reject

# To make a permanent change, add the route statement to rc script.
chmod +x /etc/rc.d/rc.local

# Edit /etc/rc.d/rc.local and add this line:
/sbin/route add -host 169.254.169.254 reject

# Enable rc-local service
systemctl status rc-local.service
systemctl enable rc-local.service
systemctl start rc-local.service

13. Linux 内核错误

如果 Redhat、OVM、SUSIE LINUX 上挂接了过多 LUN,则重启会挂起。

建议执行的操作:增加监控定时器默认超时值:

# Under /etc/systemd create a folder named: system.conf.d
# In this folder, create a *.conf file, example:
/etc/systemd/system.conf.d/kernel-reboot-workaround.conf

# The file needs to contain the following information:

[Manager]

RuntimeWatchdogSec=5min

ShutdownWatchdogSec=5min

使用以下替代解决方法:

# Edit the /etc/default/grub file.

# remove quote from settings, then add the following after this parameter
# GRUB_CMDLINE_LINUX :
acpi_no_watchdog DefaultTimeoutStartSec=900s DefaultTimeoutStopSec=900s

2-3. Rebuild the grub
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

14. Max_sector_kb 问题。

Oracle 网格基础架构 (GI) 安装可能因 CRS 安装日志和 /var/log/messages 中的 exceed Max_sector_size 错误而失败。

建议执行的操作:

# Add max_sectors_kb 1024 under the multipath entry for all the devices (WWIDs)
# that need the setting modified (under multipaths). All of them should look 
# similar to the following: multipath
{ wwid xxxxxyyyyyzzzz1111222
alias asm-data1
max_sectors_kb 1024 }

# Delete the map (multipath -f ). This needs to be done for all devices that
# need the setting modified Ex: multipath -f casm-dat001

# Reload the map: multipath -r

# In order to make this setting persistent across reboots, `initramfs` needs to
# be regenerated (the following command will regenerate all kernel versions):

KERNELS=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
 for kernel_version in $KERNELS
 do
 dracut -v -f -a multipath /boot/initramfs-$kernel_version.img
 done

15. 12C 网格基础架构问题。

12C 网格基础架构可能失败并显示 Rejecting connection from node 2 as MultiNode RAC isn't supported or certified in this configuration

原因:

IP 169.254.169.254 转发到云虚拟机的本地元数据服务,因此裸金属解决方案主机看起来像是云虚拟机。此类配置还会泄露云虚拟机的私有服务账号密钥。

建议执行的操作:

考虑 NAT 配置的安全隐患,并尽可能限制外部网络访问。

禁止访问云虚拟机上的元数据服务:

firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -d 169.254.169.254 -j REJECT --reject-with icmp-host-unreachable
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -d 169.254.169.254 -j REJECT --reject-with icmp-host-unreachable

禁止访问 BMS 主机上的元数据服务:

firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d 169.254.169.254 -j REJECT --reject-with icmp-host-unreachable
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -d 169.254.169.254 -j REJECT --reject-with icmp-host-unreachable