首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> 網頁程式設計 >> PHP 程式設計 >> PHP 相關知識

DB2 HADR + TSA 高可用架構實戰(一):TSA 環境配置完整步驟

     編輯:PHP 相關知識

架構概覽

雙節點 DB2 HADR(Primary/Standby)搭配 IBM Tivoli System Automation (TSA) 實現自動故障轉移。本文記錄 TSA 叢集環境前置配置全過程。

1. 主機名與 /etc/hosts 設定

# node01
hostname db2-node01
# /etc/hosts
127.0.0.1   localhost
10.0.0.1    db2-node01
10.0.0.2    db2-node02

# node02
hostname db2-node02
# /etc/hosts 同上

驗證雙向 ping 通暢。

2. 環境變數 CT_MANAGEMENT_SCOPE

# 兩節點皆執行
echo 'export CT_MANAGEMENT_SCOPE=2' >> /etc/profile
source /etc/profile

3. 安裝並配置 RSH 無密碼互信

3.1 安裝套件

yum install -y rsh-server xinetd

3.2 啟用服務

chkconfig xinetd on
chkconfig rsh on
chkconfig rlogin on
service xinetd restart

3.3 設定 .rhosts(root 與 db2inst2)

# /root/.rhosts
db2-node01 root
db2-node02 root

# /home/db2inst2/.rhosts
db2-node01 root
db2-node02 root
chown db2inst2:db2iadm1 /home/db2inst2/.rhosts
chmod 600 /home/db2inst2/.rhosts

3.4 修正 Kerberos 衝突

cd /usr/kerberos/bin
mv rsh rsh.sav
ln -s /usr/bin/rsh rsh
service xinetd restart

3.5 加入 /etc/securetty

echo 'rsh' >> /etc/securetty

3.6 測試無密碼執行

rsh db2-node01 hostname
rsh db2-node02 hostname

4. 初始化 RSCT 叢集節點

# 兩節點皆以 root 執行
preprpnode db2-node01 db2-node02

5. 關閉防火牆與 SELinux

service iptables stop
chkconfig iptables off
# SELinux 設為 Disabled 或 Permissive
vim /etc/selinux/config
# SELINUX=disabled
reboot

驗證清單

  • [ ] 雙節點主機名解析正確
  • [ ] CT_MANAGEMENT_SCOPE=2 生效
  • [ ] RSH 雙向無密碼登入成功(root & db2inst2)
  • [ ] preprpnode 無錯誤完成
  • [ ] 防火牆/SELinux 已關閉

下一步

完成 TSA 環境基礎建設後,將進入 db2haicu 互動式配置 HADR 資料庫自動故障轉移與虛擬 IP (VIP) 浮動,請參考系列下一篇。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved