程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> DB2+HADR+TSA高可用性測試--TSA環境配置

DB2+HADR+TSA高可用性測試--TSA環境配置

編輯:關於PHP編程

DB2+HADR+TSA高可用性測試--TSA環境配置



  • 配置所有節點名及Hosts文件
[root@db2-node01 ~]# more /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=db2-node01
[root@db2-node01 ~]#
[root@db2-node01 ~]# echo $HOSTNAME
db2-node01

[root@db2-node02 ~]# more /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=db2-node02
[root@db2-node02 ~]# echo $HOSTNAME
db2-node02
[root@db2-node02 ~]#

[root@db2-node01 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1localhost.localdomain localhost
#::1localhost6.localdomain6 localhost6

108.88.3.106 db2-node01
108.88.3.221 db2-node02

[root@db2-node02 ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1localhost.localdomain localhost
#::1localhost6.localdomain6 localhost6

108.88.3.106 db2-node01
108.88.3.221 db2-node02
[root@db2-node02 ~]#

  • 檢測主機名及Hosts配置
[root@db2-node01 ~]# ping db2-node01
PING db2-node01 (108.88.3.106) 56(84) bytes of data.
64 bytes from db2-node01 (108.88.3.106): icmp_seq=1 ttl=64 time=0.010 ms
64 bytes from db2-node01 (108.88.3.106): icmp_seq=2 ttl=64 time=0.046 ms
^C64 bytes from db2-node01 (108.88.3.106): icmp_seq=3 ttl=64 time=0.106 ms
--- db2-node01 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.010/0.054/0.106/0.039 ms
[root@db2-node01 ~]# ping db2-node02
PING db2-node02 (108.88.3.221) 56(84) bytes of data.
64 bytes from db2-node02 (108.88.3.221): icmp_seq=1 ttl=64 time=1.07 ms
64 bytes from db2-node02 (108.88.3.221): icmp_seq=2 ttl=64 time=0.280 ms


--- db2-node02 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.280/0.676/1.073/0.397 ms
[root@db2-node01 ~]#

  • node02上測試

[root@db2-node02 ~]# ping db2-node01
PING db2-node01 (108.88.3.106) 56(84) bytes of data.
64 bytes from db2-node01 (108.88.3.106): icmp_seq=1 ttl=64 time=1.64 ms
64 bytes from db2-node01 (108.88.3.106): icmp_seq=2 ttl=64 time=0.328 ms
--- db2-node01 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.328/0.985/1.643/0.658 ms

[root@db2-node02 ~]# ping db2-node02
PING db2-node02 (108.88.3.221) 56(84) bytes of data.
64 bytes from db2-node02 (108.88.3.221): icmp_seq=1 ttl=64 time=0.000 ms
64 bytes from db2-node02 (108.88.3.221): icmp_seq=2 ttl=64 time=0.127 ms
--- db2-node02 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.000/0.063/0.127/0.064 ms
[root@db2-node02 ~]#
  • 添加CT_MANAGEMENT_SCOPE在所有節點
[root@db2-node01 ~]# vi /etc/profile

export CT_MANAGEMENT_SCOPE=2

[root@db2-node02 ~]# vi /etc/profile

export CT_MANAGEMENT_SCOPE=2
  • 所有節點安裝RSH服務

1.1在node01安裝RSH

[root@db2-node01 ~]# rpm -qa | grep -i rsh-server
[root@db2-node01 ~]#yum install rsh-server
[root@db2-node01 ~]#chkconfig xinetd on
[root@db2-node01 ~]#chkconfig rsh on
[root@db2-node01 ~]#chkconfig rlogin on
[root@db2-node01 ~]#/etc/init.d/xinetd restart

1.2、設置RSH遠程訪問
[root@db2-node01 ~]#vi /root/.rhosts
db2-node01 root
db2-node02 root

1.3、修改kerberos中rsh

[root@db2-node01 ~]#cd /usr/kerberos/bin
[root@db2-node01 ~]#mv rsh rsh.sav
[root@db2-node01 ~]# ln -s /usr/bin/rsh rsh
[root@db2-node01 ~]#/etc/init.d/xinetd restart
[root@db2-node01 ~]# ls -al /usr/bin/rsh

1.4、添加 rsh 到 /etc/securetty 文件中

[root@db2-node01 ~]#echo rsh >>/etc/securetty

1.5、添加DB2實例用戶RSH
[root@db2-node01 ~]#vi /home/db2inst2/.rhosts
db2-node01 root
db2-node02 root

1.6、測試
[root@db2-node01 ~]#rsh db2-node01 ls
[root@db2-node01 ~]#rsh db2-node02 ls


2.1在node02安裝RSH

[root@db2-node02 ~]# rpm -qa | grep -i rsh-server
[root@db2-node02 ~]#yum install rsh-server
[root@db2-node02 ~]#chkconfig xinetd on
[root@db2-node02 ~]#chkconfig rsh on
[root@db2-node02 ~]#chkconfig rlogin on
[root@db2-node02 ~]#/etc/init.d/xinetd restart

2.2、設置RSH遠程訪問
[root@db2-node02 ~]#vi /root/.rhosts
db2-node01 root
db2-node02 root

2.3、修改kerberos中rsh

[root@db2-node01 ~]#cd /usr/kerberos/bin
[root@db2-node01 ~]#mv rsh rsh.sav
[root@db2-node01 ~]#ln -s /usr/bin/rsh rsh
[root@db2-node01 ~]#/etc/init.d/xinetd restart
[root@db2-node01 ~]# ls -al /usr/bin/rsh

2.4、添加 rsh 到 /etc/securetty 文件中

[root@db2-node01 ~]#echo rsh >>/etc/securetty


2.5、添加DB2實例用戶RSH
[root@db2-node01 ~]#vi /home/db2inst2/.rhosts
db2-node01 root
db2-node02 root

2.6、測試
[root@db2-node01 ~]#rsh db2-node01 ls
[root@db2-node01 ~]#rsh db2-node02 ls

初始化RSCT集群節點
以下操作由root用戶在db2-node01和db2-node01執行
[root@db2-node01 ~]##preprpnode db2-node01 db2-node02
[root@db2-node02 ~]##preprpnode db2-node01 db2-node02

  • 關閉所有節點防火牆及selinux
[root@db2-node01 ~]# /etc/init.d/iptables stop
[root@db2-node02 ~]# /etc/init.d/iptables stop


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved