虛擬機(jī)Linux上部署DB2pureScale過(guò)程
在Linux操作系統(tǒng)中,可在虛擬機(jī)上搭建DB2 pureScale,那么搭建的步驟是怎么樣的呢?DB2 pureScale又有什么用呢?下面隨學(xué)習(xí)啦小編一起來(lái)了解下Linux系統(tǒng)如何在虛擬機(jī)上部署DB2 pureScale。
在虛擬機(jī)Linux上部署DB2pureScale實(shí)踐過(guò)程
1、環(huán)境準(zhǔn)備
硬件環(huán)境:3 臺(tái) x86-64虛擬機(jī),內(nèi)存要求 1.5G 或以上(主要針對(duì)虛擬機(jī),內(nèi)存過(guò)低會(huì)造成數(shù)據(jù)庫(kù)實(shí)例啟動(dòng)失敗)
操作系統(tǒng):Suse Linux Enterprise Server 11.3
DB2 版本:DB2 v10.5
機(jī)器名:node01 node02 node03
IP:192.168.18.201 192.168.18.202 192.168.18.203
網(wǎng)關(guān):192.168.18.2
利用iscsi服務(wù)來(lái)做共享存儲(chǔ)功能,其中node01 作為 iscsi 的 Server,node01、node02和 node03 作為 iscsi Client,這樣三臺(tái)虛擬機(jī)上都能看到相同的磁盤了(按照developer workers上的文章:非 InfiniBand 環(huán)境下搭建 DB2 pureScale,我用DB2 v10.5時(shí)啟動(dòng)實(shí)例失敗,可能10.5做了限制,CF與member在同一臺(tái)機(jī)器啟動(dòng)失敗,幫多了一臺(tái)虛擬機(jī))。
2、操作系統(tǒng)安裝:
Node01預(yù)留出一塊分區(qū),不進(jìn)行格式化(文件類型為0x83 Linux)做為 pureScale 集群的 Sharing Disk 使用,Node02與Node03跟node01其它相同就可,
安裝必要的包:
libstdc++(32 位和 64 位庫(kù))
glibc(32 位和 64 位庫(kù))
cpp
gcc
gcc-c++
kernel-source
binutils
ksh-93u-0.8.1
openssh
ntp
完成SUSE 11 SP3的安裝。
驗(yàn)證:檢查/lib/modules/3.0.76-0.11-default/build/include/linux有無(wú)autoconf.h,如果沒(méi)有autoconf.h,安裝DB2時(shí)會(huì)報(bào)Compiling GPL :.......Failure錯(cuò)誤。
解決方法:cp –v /usr/src/linux-3.0.76-0.11-obj/x86_64/default/include/generated /lib/modules/3.0.76-0.11-default/build/include/linux
3、添加用戶和用戶組
三臺(tái)機(jī)器全部執(zhí)行如下命令(如果不做特殊說(shuō)明,以#表示root身份登錄,以$表示db2inst1身份,以下相同)。
#groupadd -g 1001 db2fadm1
#groupadd -g 1002 db2iadm1
#useradd -g db2fadm1 -u 1001 -m -d /home/db2fenc1 -p db2fenc1 db2fenc1
#useradd -g db2iadm1 -u 1002 -m -d /home/db2inst1 -p db2inst1 db2inst1
#mkdir /root/.ssh
# su - db2inst1 -c "mkdir -p /home/db2inst1/.ssh"
4、配置ssh 信任連接
ssh信任通俗的說(shuō)就是直接ssh不用輸入密碼
在/etc/hosts添加另外兩臺(tái)機(jī)器的IP地址及機(jī)器名(確保3臺(tái)機(jī)器名與ip地址全部出現(xiàn)在hosts文件中)
例如我的機(jī)器hosts如下:
127.0.0.1 localhost
192.168.18.201 node01.site node01
192.168.18.202 node02.site node02
192.168.18.203 node03.site node03
node01執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id01
#scp /root/.ssh/id01 node02:/root/.ssh
#scp /root/.ssh/id01 node03:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id01
$scp /home/db2inst1/.ssh/id01 node02:/home/db2inst1/.ssh
$scp /home/db2inst1/.ssh/id01 node03:/home/db2inst1/.ssh
node02執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id02
#scp /root/.ssh/id02 node01:/root/.ssh/
#scp /root/.ssh/id02 node03:/root/.ssh/
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id02
$scp /home/db2inst1/.ssh/id02 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id02 node03:/home/db2inst1/.ssh/
node03執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id03
#scp /root/.ssh/id03 node01:/root/.ssh
#scp /root/.ssh/id03 node02:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id03
$scp /home/db2inst1/.ssh/id03 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id03 node02:/home/db2inst1/.ssh/
分別在node01、node02、node03執(zhí)行如下命令
#cd /root/.ssh
#cat id01 id02 id03 > authorized_keys
#chmod 600 authorized_keys
#su - db2inst1
$cd /home/db2inst1/.ssh
$ cat id01 id02 id03 > authorized_keys
測(cè)試是否配置成功
3臺(tái)機(jī)器分別以root與db2inst1執(zhí)行:
#ssh node01 ls
#ssh node02 ls
#ssh node03 ls
#su - db2inst1
$ssh node01 ls
$ssh node02 ls
$ssh node03 ls
確保不用輸入密碼,則配置成功。
5、ISCSI 共享存儲(chǔ)配置
Iscsi server端配置(node01上執(zhí)行):
修改/etc/ietd.conf,添加如下內(nèi)容:
Target iqn.2014-03.node01.site:scsidisk01
Lun 0 Path=/dev/sda4,Type=fileio
注意:我的未分區(qū)硬盤為/dev/sda4,你的可能不一樣的@_@~~~~
添加自啟動(dòng)
#chkconfig -a iscsitarget
檢查是否成功
#chkconfig -l iscsitarget
結(jié)果:iscsitarget 0:off 1:off 2:off 3:on 4:off 5:on 6:off
重啟iscsitarget服務(wù)
# /etc/init.d/iscsitarget restart
iscsi client端配置(node01、node02、node03執(zhí)行,):
iscsitarget文件內(nèi)容如下:
#! /bin/sh
### BEGIN INIT INFO
# Provides: iscsiclsetup
#node02與node03上如果未裝iscsitarget需將下下行的$iscsitarget
# Required-Start: $network $syslog $iscsitarget $remote_fs smartd
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: ISCSI client setup
### END INIT INFO
case " class="main">
虛擬機(jī)Linux上部署DB2pureScale過(guò)程
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.18.201 --discover
iscsiadm --m node --targetname iqn.2014-03.node01.site:scsidisk01 --portal 192.168.18.201:3260 --login
;;
stop)
iscsiadm -m node -T iqn.2014-03.node01.site:scsidisk01 -p 192.168.18.201 --logout
;;
restart) ## Stop the service and regardless of whether it was ## running or not, start it again.
虛擬機(jī)Linux上部署DB2pureScale過(guò)程
在Linux操作系統(tǒng)中,可在虛擬機(jī)上搭建DB2 pureScale,那么搭建的步驟是怎么樣的呢?DB2 pureScale又有什么用呢?下面隨學(xué)習(xí)啦小編一起來(lái)了解下Linux系統(tǒng)如何在虛擬機(jī)上部署DB2 pureScale。
在虛擬機(jī)Linux上部署DB2pureScale實(shí)踐過(guò)程
1、環(huán)境準(zhǔn)備
硬件環(huán)境:3 臺(tái) x86-64虛擬機(jī),內(nèi)存要求 1.5G 或以上(主要針對(duì)虛擬機(jī),內(nèi)存過(guò)低會(huì)造成數(shù)據(jù)庫(kù)實(shí)例啟動(dòng)失敗)
操作系統(tǒng):Suse Linux Enterprise Server 11.3
DB2 版本:DB2 v10.5
機(jī)器名:node01 node02 node03
IP:192.168.18.201 192.168.18.202 192.168.18.203
網(wǎng)關(guān):192.168.18.2
利用iscsi服務(wù)來(lái)做共享存儲(chǔ)功能,其中node01 作為 iscsi 的 Server,node01、node02和 node03 作為 iscsi Client,這樣三臺(tái)虛擬機(jī)上都能看到相同的磁盤了(按照developer workers上的文章:非 InfiniBand 環(huán)境下搭建 DB2 pureScale,我用DB2 v10.5時(shí)啟動(dòng)實(shí)例失敗,可能10.5做了限制,CF與member在同一臺(tái)機(jī)器啟動(dòng)失敗,幫多了一臺(tái)虛擬機(jī))。
2、操作系統(tǒng)安裝:
Node01預(yù)留出一塊分區(qū),不進(jìn)行格式化(文件類型為0x83 Linux)做為 pureScale 集群的 Sharing Disk 使用,Node02與Node03跟node01其它相同就可,
安裝必要的包:
libstdc++(32 位和 64 位庫(kù))
glibc(32 位和 64 位庫(kù))
cpp
gcc
gcc-c++
kernel-source
binutils
ksh-93u-0.8.1
openssh
ntp
完成SUSE 11 SP3的安裝。
驗(yàn)證:檢查/lib/modules/3.0.76-0.11-default/build/include/linux有無(wú)autoconf.h,如果沒(méi)有autoconf.h,安裝DB2時(shí)會(huì)報(bào)Compiling GPL :.......Failure錯(cuò)誤。
解決方法:cp –v /usr/src/linux-3.0.76-0.11-obj/x86_64/default/include/generated /lib/modules/3.0.76-0.11-default/build/include/linux
3、添加用戶和用戶組
三臺(tái)機(jī)器全部執(zhí)行如下命令(如果不做特殊說(shuō)明,以#表示root身份登錄,以$表示db2inst1身份,以下相同)。
#groupadd -g 1001 db2fadm1
#groupadd -g 1002 db2iadm1
#useradd -g db2fadm1 -u 1001 -m -d /home/db2fenc1 -p db2fenc1 db2fenc1
#useradd -g db2iadm1 -u 1002 -m -d /home/db2inst1 -p db2inst1 db2inst1
#mkdir /root/.ssh
# su - db2inst1 -c "mkdir -p /home/db2inst1/.ssh"
4、配置ssh 信任連接
ssh信任通俗的說(shuō)就是直接ssh不用輸入密碼
在/etc/hosts添加另外兩臺(tái)機(jī)器的IP地址及機(jī)器名(確保3臺(tái)機(jī)器名與ip地址全部出現(xiàn)在hosts文件中)
例如我的機(jī)器hosts如下:
127.0.0.1 localhost
192.168.18.201 node01.site node01
192.168.18.202 node02.site node02
192.168.18.203 node03.site node03
node01執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id01
#scp /root/.ssh/id01 node02:/root/.ssh
#scp /root/.ssh/id01 node03:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id01
$scp /home/db2inst1/.ssh/id01 node02:/home/db2inst1/.ssh
$scp /home/db2inst1/.ssh/id01 node03:/home/db2inst1/.ssh
node02執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id02
#scp /root/.ssh/id02 node01:/root/.ssh/
#scp /root/.ssh/id02 node03:/root/.ssh/
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id02
$scp /home/db2inst1/.ssh/id02 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id02 node03:/home/db2inst1/.ssh/
node03執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id03
#scp /root/.ssh/id03 node01:/root/.ssh
#scp /root/.ssh/id03 node02:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id03
$scp /home/db2inst1/.ssh/id03 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id03 node02:/home/db2inst1/.ssh/
分別在node01、node02、node03執(zhí)行如下命令
#cd /root/.ssh
#cat id01 id02 id03 > authorized_keys
#chmod 600 authorized_keys
#su - db2inst1
$cd /home/db2inst1/.ssh
$ cat id01 id02 id03 > authorized_keys
測(cè)試是否配置成功
3臺(tái)機(jī)器分別以root與db2inst1執(zhí)行:
#ssh node01 ls
#ssh node02 ls
#ssh node03 ls
#su - db2inst1
$ssh node01 ls
$ssh node02 ls
$ssh node03 ls
確保不用輸入密碼,則配置成功。
5、ISCSI 共享存儲(chǔ)配置
Iscsi server端配置(node01上執(zhí)行):
修改/etc/ietd.conf,添加如下內(nèi)容:
Target iqn.2014-03.node01.site:scsidisk01
Lun 0 Path=/dev/sda4,Type=fileio
注意:我的未分區(qū)硬盤為/dev/sda4,你的可能不一樣的@_@~~~~
添加自啟動(dòng)
#chkconfig -a iscsitarget
檢查是否成功
#chkconfig -l iscsitarget
結(jié)果:iscsitarget 0:off 1:off 2:off 3:on 4:off 5:on 6:off
重啟iscsitarget服務(wù)
# /etc/init.d/iscsitarget restart
iscsi client端配置(node01、node02、node03執(zhí)行,):
iscsitarget文件內(nèi)容如下:
#! /bin/sh
### BEGIN INIT INFO
# Provides: iscsiclsetup
#node02與node03上如果未裝iscsitarget需將下下行的$iscsitarget
# Required-Start: $network $syslog $iscsitarget $remote_fs smartd
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: ISCSI client setup
### END INIT INFO
case " class="main">
stop
虛擬機(jī)Linux上部署DB2pureScale過(guò)程
在Linux操作系統(tǒng)中,可在虛擬機(jī)上搭建DB2 pureScale,那么搭建的步驟是怎么樣的呢?DB2 pureScale又有什么用呢?下面隨學(xué)習(xí)啦小編一起來(lái)了解下Linux系統(tǒng)如何在虛擬機(jī)上部署DB2 pureScale。
在虛擬機(jī)Linux上部署DB2pureScale實(shí)踐過(guò)程
1、環(huán)境準(zhǔn)備
硬件環(huán)境:3 臺(tái) x86-64虛擬機(jī),內(nèi)存要求 1.5G 或以上(主要針對(duì)虛擬機(jī),內(nèi)存過(guò)低會(huì)造成數(shù)據(jù)庫(kù)實(shí)例啟動(dòng)失敗)
操作系統(tǒng):Suse Linux Enterprise Server 11.3
DB2 版本:DB2 v10.5
機(jī)器名:node01 node02 node03
IP:192.168.18.201 192.168.18.202 192.168.18.203
網(wǎng)關(guān):192.168.18.2
利用iscsi服務(wù)來(lái)做共享存儲(chǔ)功能,其中node01 作為 iscsi 的 Server,node01、node02和 node03 作為 iscsi Client,這樣三臺(tái)虛擬機(jī)上都能看到相同的磁盤了(按照developer workers上的文章:非 InfiniBand 環(huán)境下搭建 DB2 pureScale,我用DB2 v10.5時(shí)啟動(dòng)實(shí)例失敗,可能10.5做了限制,CF與member在同一臺(tái)機(jī)器啟動(dòng)失敗,幫多了一臺(tái)虛擬機(jī))。
2、操作系統(tǒng)安裝:
Node01預(yù)留出一塊分區(qū),不進(jìn)行格式化(文件類型為0x83 Linux)做為 pureScale 集群的 Sharing Disk 使用,Node02與Node03跟node01其它相同就可,
安裝必要的包:
libstdc++(32 位和 64 位庫(kù))
glibc(32 位和 64 位庫(kù))
cpp
gcc
gcc-c++
kernel-source
binutils
ksh-93u-0.8.1
openssh
ntp
完成SUSE 11 SP3的安裝。
驗(yàn)證:檢查/lib/modules/3.0.76-0.11-default/build/include/linux有無(wú)autoconf.h,如果沒(méi)有autoconf.h,安裝DB2時(shí)會(huì)報(bào)Compiling GPL :.......Failure錯(cuò)誤。
解決方法:cp –v /usr/src/linux-3.0.76-0.11-obj/x86_64/default/include/generated /lib/modules/3.0.76-0.11-default/build/include/linux
3、添加用戶和用戶組
三臺(tái)機(jī)器全部執(zhí)行如下命令(如果不做特殊說(shuō)明,以#表示root身份登錄,以$表示db2inst1身份,以下相同)。
#groupadd -g 1001 db2fadm1
#groupadd -g 1002 db2iadm1
#useradd -g db2fadm1 -u 1001 -m -d /home/db2fenc1 -p db2fenc1 db2fenc1
#useradd -g db2iadm1 -u 1002 -m -d /home/db2inst1 -p db2inst1 db2inst1
#mkdir /root/.ssh
# su - db2inst1 -c "mkdir -p /home/db2inst1/.ssh"
4、配置ssh 信任連接
ssh信任通俗的說(shuō)就是直接ssh不用輸入密碼
在/etc/hosts添加另外兩臺(tái)機(jī)器的IP地址及機(jī)器名(確保3臺(tái)機(jī)器名與ip地址全部出現(xiàn)在hosts文件中)
例如我的機(jī)器hosts如下:
127.0.0.1 localhost
192.168.18.201 node01.site node01
192.168.18.202 node02.site node02
192.168.18.203 node03.site node03
node01執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id01
#scp /root/.ssh/id01 node02:/root/.ssh
#scp /root/.ssh/id01 node03:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id01
$scp /home/db2inst1/.ssh/id01 node02:/home/db2inst1/.ssh
$scp /home/db2inst1/.ssh/id01 node03:/home/db2inst1/.ssh
node02執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id02
#scp /root/.ssh/id02 node01:/root/.ssh/
#scp /root/.ssh/id02 node03:/root/.ssh/
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id02
$scp /home/db2inst1/.ssh/id02 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id02 node03:/home/db2inst1/.ssh/
node03執(zhí)行如下命令:
#ssh-keygen -t rsa
#cp -v /root/.ssh/id_rsa.pub /root/.ssh/id03
#scp /root/.ssh/id03 node01:/root/.ssh
#scp /root/.ssh/id03 node02:/root/.ssh
#su - db2inst1
$ssh-keygen -t rsa
$cp -v /home/db2inst1/.ssh/id_rsa.pub /home/db2inst1/.ssh/id03
$scp /home/db2inst1/.ssh/id03 node01:/home/db2inst1/.ssh/
$scp /home/db2inst1/.ssh/id03 node02:/home/db2inst1/.ssh/
分別在node01、node02、node03執(zhí)行如下命令
#cd /root/.ssh
#cat id01 id02 id03 > authorized_keys
#chmod 600 authorized_keys
#su - db2inst1
$cd /home/db2inst1/.ssh
$ cat id01 id02 id03 > authorized_keys
測(cè)試是否配置成功
3臺(tái)機(jī)器分別以root與db2inst1執(zhí)行:
#ssh node01 ls
#ssh node02 ls
#ssh node03 ls
#su - db2inst1
$ssh node01 ls
$ssh node02 ls
$ssh node03 ls
確保不用輸入密碼,則配置成功。
5、ISCSI 共享存儲(chǔ)配置
Iscsi server端配置(node01上執(zhí)行):
修改/etc/ietd.conf,添加如下內(nèi)容:
Target iqn.2014-03.node01.site:scsidisk01
Lun 0 Path=/dev/sda4,Type=fileio
注意:我的未分區(qū)硬盤為/dev/sda4,你的可能不一樣的@_@~~~~
添加自啟動(dòng)
#chkconfig -a iscsitarget
檢查是否成功
#chkconfig -l iscsitarget
結(jié)果:iscsitarget 0:off 1:off 2:off 3:on 4:off 5:on 6:off
重啟iscsitarget服務(wù)
# /etc/init.d/iscsitarget restart
iscsi client端配置(node01、node02、node03執(zhí)行,):
iscsitarget文件內(nèi)容如下:
#! /bin/sh
### BEGIN INIT INFO
# Provides: iscsiclsetup
#node02與node03上如果未裝iscsitarget需將下下行的$iscsitarget
# Required-Start: $network $syslog $iscsitarget $remote_fs smartd
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: ISCSI client setup
### END INIT INFO
case " class="main">
start;;
*)
Esac
保存后執(zhí)行:#/etc/init.d/iscsiclient restart
驗(yàn)證iscsiclient是否啟動(dòng)成功:
#fdisk -l
檢查有無(wú)/dev/sdb出現(xiàn)
6、配置Linux環(huán)境變量
/etc/profie.local添加內(nèi)容
alias sl='tail -f /var/log/messages'
alias fc='fcslogrpt /var/log/messages'
export PATH=/root/bin:/usr/sbin/rsct/bin:/opt/ibm/db2/v10.5/bin:$PATH
export PATH=/usr/lpp/mmfs/bin:$PATH
export DB2USENONIB=TRUE
export DB2_CFS_GPFS_NO_REFRESH_DATA=true
然后執(zhí)行# . /etc/profile.local,完成后你就可以安裝purescale了,我猜測(cè)應(yīng)該是設(shè)置了變量DB2USENONIB,使purescale不再要求你強(qiáng)制InfiniBand或萬(wàn)兆網(wǎng)卡,使我等窮人可以有機(jī)會(huì)玩這種高檔、洋氣、上檔次的數(shù)據(jù)庫(kù)。。。
7、DB2 V10.5 的安裝:
node01:~/server_t # ./db2_install
DBI1324W Support of the db2_install command is deprecated. For
more information, see the DB2 Information Center.
Default directory for installation of products - /opt/ibm/db2/V10.5
***********************************************************
Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no]
yes
Specify one of the following keywords to install DB2 products.
SERVER
CONSV
EXP
CLIENT
RTCL
Enter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
server
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no]
Yes
曾經(jīng)出現(xiàn)的錯(cuò)誤:
ERROR: An error occurred while compiling IBM General Parallel File System
(GPFS) Portability Layer (GPL) on host "node01". Return code "2". GPL
compilation log file location "/tmp/compileGPL.log.000". The GPFS file system
cannot be mounted properly until the GPL module is successfully compiled on
this host. For details, see the specified GPL compilation log. After fixing
the problems shown in the log file, re-run the DB2 installer. For information
regarding the GPFS GPL module compile, see DB2 Information Center.
Compiling GPL :.......Failure
ERROR: A major error occurred while installing "DB2 Server Edition " on this
computer.
解決方案:
查看錯(cuò)誤日志:compileGPL.log.000,為以下內(nèi)容:
cd /usr/lpp/mmfs/src/config; ./configure --genenvonly; if [ $? -eq 0 ]; then /usr/bin/cpp -P def.mk.proto > ./def.mk; exit $? || exit 1; else exit $?; fi
手工執(zhí)行時(shí)會(huì)發(fā)現(xiàn)在./configure --genenvonly; 這一步報(bào)找不到
/usr/bin/diff: /lib/modules/3.0.76-0.11-default/build/include/linux/autoconf.h: No such file or directory
Kernel source tree does not have the correct autoconf.h file.
See /usr/lpp/mmfs/src/README for further information
手工拷唄一下autoconf.h文件即可
#cp –v /usr/src/linux-3.0.76-0.11-obj/x86_64/default/include/generated/autoconf.h /lib/modules/3.0.76-0.11-default/build/include/linux/
GPFS 文件系統(tǒng)配置與掛載
方法1:使用db2cluster_prepare
node01上執(zhí)行:
#/opt/ibm/db2/v10.5/instance/db2cluster_prepare -instance_shared_dev /dev/sdb
DBI1446I The db2cluster_prepare command is running.
DB2 installation is being initialized.
Total number of tasks to be performed: 1
Total estimated time for all tasks to be performed: 60 second(s)
Task #1 start
Description: Creating IBM General Parallel File System (GPFS) Cluster and Filesystem
Estimated time 60 second(s)
Task #1 end
The execution completed successfully.
For more information see the DB2 installation log at
"/tmp/db2cluster_prepare.log".
DBI1070I Program db2cluster_prepare completed successfully.
此時(shí)df -l查看一下會(huì)發(fā)現(xiàn)多了一個(gè)掛載點(diǎn)
node01:/opt/ibm/db2/V10.5/instance # df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 19599036 8122392 10481060 44% /
udev 958688 120 958568 1% /dev
tmpfs 958688 76 958612 1% /dev/shm
/dev/sda3 10327940 154460 9648836 2% /home
/dev/db2fs1 15728640 627712 15100928 4% /db2sd_20140401103940
曾經(jīng)出現(xiàn)報(bào)錯(cuò):
DBI20022E The DB2 installer detected that the variable record "GPFS_CLUSTER" is
defined in the global registry. However, the GPFS cluster does not exist on
host "node01".
Creating IBM General Parallel File System (GPFS) Cluster and Filesystem :.......Failure
查看/tmp/ibm.db2.cluster.GuOypP發(fā)現(xiàn)有如下內(nèi)容報(bào)錯(cuò):
014-04-01-10.26.12.358494+480 I5385E400 LEVEL: Warning
PID : 7469 TID : 139670848014112 PROC : db2cluster
INSTANCE: NODE : 000
HOSTNAME: node01
FUNCTION: DB2 UDB, oper system services, sqloMessage, probe:1
MESSAGE : Cannot obtain registry variables
DATA #1 : Hexdump, 4 bytes
0x00007FFF17631758 : B400 0F87
解決方案:由于此前我在此機(jī)器上試過(guò)N次db2cluster_prepare,包括V9.8、V10.1,V10.5安裝,導(dǎo)致全局注冊(cè)表變量沒(méi)有刪除干凈,使用db2greg -dump
V,GPFS_CLUSTER,NAME,db2cluster_20140403105617.site,-,DB2_CREATED將其刪除。
#cp -v /var/db2/global.reg /var/db2/global.reg_20140401
#db2delgreg -delvarrec service= GPFS_CLUSTER
總結(jié):db2cluster_prepare這個(gè)命令失敗時(shí)
檢查iscsi client是否準(zhǔn)備好,fdisk -l查看一下是否有/dev/sdb
全局注冊(cè)表變量是否未刪除干凈 ,db2greg -dump查看
檢查一下是否tsa的domain存在,lsrpdomain,使用rmrpdomain將其刪掉,如果其node為活動(dòng)需先將其node停掉。具體參考tsa相關(guān)命令,
檢查一下gpfs cluster domain是否未清理干凈,如果未清理干凈,需要使用將fs、nsd、node清理掉,具體命令參考gpfs信息中心。
方法2:手工掛載GPFS
遇到過(guò)使用db2cluster_prepare時(shí)無(wú)法成功,手工安裝(不確定是否遇到了傳說(shuō)中的bug)。
創(chuàng)建cluster,不加-filesystem -disk選項(xiàng):
node01:
#db2cluster -cfs -create -domain mydomain -host node01
#db2cluster -cfs -add -host node02
# db2cluster -cfs -add -host node03
說(shuō)明:上面如果不出故障當(dāng)然可以加上-filesystem –disk參數(shù),當(dāng)然也可以用mmaddnode –N XXX來(lái)添加節(jié)點(diǎn)
添加許可協(xié)議:
提供兩種方法
#mmchlicense server --accept -N node01,node02,node03
#/opt/ibm/db2/v10.5/bin/db2cluster -cfs -add -license
創(chuàng)建nsd:任意node執(zhí)行
編寫newNSD文件內(nèi)容如下
%nsd:
device=/dev/sdb
nsd=nsd1
usage=dataAndMetadata
#mmcrnsd -F /tmp/newNSD (-v no)
如果報(bào)mmcrnsd: Disk device sdb refers to an existing NSD,而使用mmlsnsd 又查找不到相應(yīng)的nsd,添加-v no可以跳過(guò)此驗(yàn)證。
#mmlsnsd 查看創(chuàng)建的nsd名稱,記下,在第3步時(shí)需要用到.
創(chuàng)建Cluster File System并掛載
啟動(dòng)所有node,任意node執(zhí)行
#mmstartup -a
#mmgetstate -a
確保所有node全部啟動(dòng)成功為active
# mmcrfs -T /db2sd_20140401 db2sd_20140401 nsd1(此處的nsd1為第2步的nsd名稱)
#mmmount all -a
--曾經(jīng)出現(xiàn)的錯(cuò)誤:mmstartup -a無(wú)響應(yīng)
,查看日志/var/adm/ras/mmfs.log.previous
Tue Apr 1 22:02:11 CST 2014: runmmfs starting
Removing old /var/adm/ras/mmfs.log.* files:
Unloading modules from /lib/modules/3.0.76-0.11-default/extra
runmmfs: The /lib/modules/3.0.76-0.11-default/extra/mmfslinux.ko kernel extension does not exist.
runmmfs: Unable to verify kernel/module configuration.
Loading modules from /lib/modules/3.0.76-0.11-default/extra
runmmfs: The /lib/modules/3.0.76-0.11-default/extra/mmfslinux.ko kernel extension does not exist.
runmmfs: Unable to verify kernel/module configuration.
Tue Apr 1 22:02:11 CST 2014 runmmfs: error in loading or unloading the mmfs kernel extension
Tue Apr 1 22:02:11 CST 2014 runmmfs: stopping GPFS
解決方案:重新編譯一下gpfs的源碼,因?yàn)槭止ば遁dgpfs。
/usr/lpp/mmfs/src/README有詳細(xì)的編譯方法:主要命令方法如下:
#cd /usr/lpp/mmfs/src
#make Autoconfig
#make InstallImages
make InstallImages會(huì)在/lib/modules/`uname -r`/extra目錄生成3個(gè)文件,大功告成.
創(chuàng)建實(shí)例
創(chuàng)建實(shí)例前:
node02#/opt/ibm/db2/V10.5/instance/db2icrt -cf node01 -cfnet node01
-m node02 -mnet node02 -instance_shared_dir /db2sd_20140401
-tbdev 192.168.18.2 -u db2fenc1 db2inst1
-tbdev 官方解釋為:Specifies a shared device path for a device that will act as a tiebreaker in the DB2 pureScale environment to ensure that the integrity of the data is maintained. 通俗的講就是在member出現(xiàn)故障時(shí),判斷哪個(gè)member可以恢復(fù)服務(wù),窮屌絲們就用網(wǎng)關(guān)IP來(lái)代替了,只要能 ping 通即可判斷為可用。
此時(shí)執(zhí)行:# db2instance -instance db2inst1 -list可以查看
node01:/opt/ibm/db2/V10.5/instance # mmlscluster
GPFS cluster information
========================
GPFS cluster name: db2cluster_20140401103900.site
GPFS cluster id: 6571095102926235332
GPFS UID domain: db2cluster_20140401103900.site
Remote shell command: /var/db2/db2ssh/db2locssh
Remote file copy command: /var/db2/db2ssh/db2scp
GPFS cluster configuration servers:
-----------------------------------
Primary server: node01.site
Secondary server: node02.site
Node Daemon node name IP address Admin node name Designation
----------------------------------------------------------------------
1 node01.site 192.168.18.201 node01.site quorum-manager
2 node02.site 192.168.18.202 node02.site quorum-manager
曾經(jīng)出現(xiàn)報(bào)錯(cuò):
錯(cuò)誤1、報(bào)2632-044、2632-068,此類錯(cuò)誤為創(chuàng)建tsa domain時(shí)的錯(cuò)誤,原因在于虛擬機(jī)是拷貝的,不是重新安裝的。
解決方法:#/usr/sbin/rsct/install/bin/recfgct
啟動(dòng)實(shí)例
node01:$/home/db2inst1/sqllib/adm/db2start
怎么樣,報(bào)錯(cuò)了吧,應(yīng)該是SQL1721N
SQL1721N Starting the DB2 database manager failed because of a problem with a configuration file that is needed by RDMA.受打擊吧。
你裝完了實(shí)例啟動(dòng)不了,沒(méi)關(guān)系,這么高檔的玩意怎么能讓你這么快啟動(dòng)啊。
你得設(shè)置兩個(gè)注冊(cè)表變量才能用普通網(wǎng)絡(luò).
$db2set DB2_SD_SOCKETS_RESTRICTIONS=false
$db2set DB2_CA_TRANSPORT_METHOD=SOCKETS
使用如下命令可以查看CF與member的狀態(tài)。
#db2instance -instance db2inst1 -list
node01:/home/db2inst1 # db2instance -instance db2inst1 -list
ID TYPE STATE HOME_HOST CURRENT_HOST ALERT PARTITION_NUMBER LOGICAL_PORT NETNAME
-- ---- ----- --------- ------------ ----- ---------------- ------------ -------
0 MEMBER STARTED node02 node02 NO 0 0 node02
128 CF PRIMARY node01 node01 NO - 0 node01
HOSTNAME STATE INSTANCE_STOPPED ALERT
-------- ----- ---------------- -----
node01 ACTIVE NO NO
node02 ACTIVE NO NO
此時(shí)你可以使用lssam查看tsa的兩個(gè)節(jié)點(diǎn)的狀態(tài)。
#lssam
添加成員
將node03添加為另一個(gè)member,如果實(shí)例沒(méi)有啟動(dòng)會(huì)自動(dòng)啟動(dòng)實(shí)例,所以預(yù)先將上一步的兩臺(tái)機(jī)器上的db2set執(zhí)行完畢先。
node01:
#/opt/ibm/db2/v10.5/instance/db2iupdt -d -add -m node03 –mnet node03 db2inst1
#su - db2inst1 -c "db2start member 1"
開啟你的purescale之旅
#db2sampl
執(zhí)行完畢后兩臺(tái)member都可以看到數(shù)據(jù)庫(kù)sample,可以同時(shí)對(duì)庫(kù)進(jìn)行操作