在 Bare Metal 解決方案上安裝 RAC 的最佳做法
本頁面提供在 Bare Metal 解決方案上安裝 Oracle RAC 前,應先查看的最佳做法。
1. 18c Oracle GI 叢集名稱長度錯誤。
Oracle GI 18C 有叢集名稱長度錯誤,會影響 Bare Metal 解決方案。
建議做法:
叢集名稱長度不得超過 15 個半形字元,否則 root.sh
指令碼會在第一個步驟失敗,並顯示 host name is too long
錯誤。預設叢集名稱的長度超過 15 個字元,因此您必須先變更叢集名稱,再執行指令碼。
2. SSH
OPEN ssh
問題可能會導致 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 伺服器
預設的 OS 防火牆設定會封鎖 VNC 等任意伺服器。請改為透過 SSH 建立 Xwindows 或 VNC 通道:
ssh -L 5901:localhost:5901 bms-host
vncviewer localhost:1
4. 根目錄檔案系統
確認根 /
檔案系統有足夠的可用空間。
主機至少需要 20 GB 的空間才能建立根檔案系統。
5. DNS
如果您未使用 Cloud DNS,請在 Bare Metal 解決方案上安裝可解析主機 IP 位址的專屬名稱伺服器。Oracle Grid Infrastructure 會使用 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
解析為 127.0.0.1
。主機未將 localhost 放入 /etc/hosts
檔案。
9. Ulimit
請確認根目錄和 Oracle 使用者的 ulimit 有足夠的限制。
10. 使用 SCP 檔案複製功能時,重新設定金鑰的作業會耗費很長的時間。
這是因為 Bare Metal 解決方案的 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 環境變數,以便 Oracle Automatic Storage Management 不會優先選取單一路徑的 ASM 裝置。
建議做法:請將 scanorder 設為下列值。
ORACLEASM_SCANORDER="multipath sd"
12. CRS root.sh 或 OCSSD 失敗,並顯示 No Network HB
錯誤。
如果節點可以對 169.254.169.254
IP 位址執行 ping 作業,則使用 Oracle 叢集就緒服務 (CRS) 時,root.sh
指令碼可能會失敗。169.254.169.254
是 Google Cloud 中繼資料服務,可在 Google Cloud中註冊執行個體。 Google Cloud 如果您封鎖這個 IP 位址,VM 就無法啟動。不過,Bare Metal Solution 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 kernel 錯誤
當電腦連接許多 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 Grid Infrastructure(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 Grid Infrastructure 問題。
12C Grid Infrastructure 可能會因 Rejecting connection from node 2 as
MultiNode RAC isn't supported or certified in this configuration
而失敗。
原因:
IP 169.254.169.254
會轉送至雲端 VM 的本機中繼資料服務,讓 Bare Metal 解決方案主機看起來像是雲端 VM。這類設定也會洩漏雲端 VM 的私人服務帳戶金鑰。
建議做法:
請考量 NAT 設定的安全性影響,並盡可能限制外部網路存取權。
禁止存取雲端 VM 上的中繼資料服務:
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