有這樣一個(gè)現(xiàn)象,在DB2安裝后,使用db2icrt 來(lái)創(chuàng)建實(shí)例時(shí),提示主機(jī)名無(wú)效,提示如下:
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供榕城網(wǎng)站建設(shè)、榕城做網(wǎng)站、榕城網(wǎng)站設(shè)計(jì)、榕城網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、榕城企業(yè)網(wǎng)站模板建站服務(wù),十多年榕城做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
[plain] view plain copy
[root@centos-0 instance]# ./db2icrt -u db2inst1 db2inst1
The host name "centos-0.msdomain" is invalid. Specify a valid host name.
DBI1922N The host name is not valid.
Explanation:
The TCP/IP host name parameter is not valid or does not exist.
User response:
Ensure that TCP/IP is operational on the system. If a domain name server
is used, ensure that the domain name server machine is active. Issue the
command again using the correct TCP/IP host name.
DBI1079I Output is saved in the log file /tmp/db2icrt.log.2816.
Explanation:
All processed and failed operations have been saved into this log file.
User response:
Do not modify this file in any way. This file is for IBM Technical
Support reference.
/opt/ibm/db2/V9.7/instance/db2iutil: line 2528: DB2INSTVER: parameter null or not set
檢查 /opt/ibm/db2/V9.7/instance/db2iutil 文件(非提示的2528行),發(fā)現(xiàn)有如下內(nèi)容
[plain] view plain copy
${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?} ${DB2ISRVOPTS?}
if [ $? -eq 3 ]; then
db2isrv
${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?} ${DB2ISRVOPTS?}
if [ $? -eq 3 ]; then
display_msg ${DB2CAT?} 922 \
'DBI1922N The host name is not valid.\n'
stop_prog 1fi
就是當(dāng)db2isrv -addcfm -i ${INSTNAME?} ${DB2ISRVOPTS?} 返回為3的時(shí)候提示主機(jī)名稱不正確。
這個(gè)db2isrv 找了很多東西,沒(méi)找到具體的內(nèi)容,看名字是給系統(tǒng)增加一個(gè)服務(wù)。后面是addfmc ,這個(gè)fmc是DB2的故障守護(hù)進(jìn)程。
這個(gè)是監(jiān)測(cè)DB2實(shí)例正常運(yùn)行,當(dāng)實(shí)例異常宕機(jī)后,它會(huì)自動(dòng)啟動(dòng)實(shí)例。那么以上的錯(cuò)誤可以連起來(lái)了:
再給系統(tǒng)增加一個(gè)DB2守護(hù)進(jìn)程的時(shí)候失敗了,原因是主機(jī)名不對(duì)。
好的,看一下主機(jī)名定義
[root@centos-0 instance]# hostname
centos-0.msdomain這沒(méi)問(wèn)題
再看
[root@centos-0 instance]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
這個(gè)地方不知為什么CENTOS裝好之后沒(méi)有修改,修改一下。修改后內(nèi)容如下
[root@centos-0 instance]# vi /etc/hosts
127.0.0.1 localhost centos.msdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
保存再次執(zhí)行創(chuàng)建實(shí)例,正常