溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

db2 創(chuàng)建實(shí)例 The host name "fordatabase" is invalid. Specify a valid host name.

發(fā)布時(shí)間:2020-08-02 20:49:34 來(lái)源:網(wǎng)絡(luò) 閱讀:1581 作者:彼岸花妖艷 欄目:數(shù)據(jù)庫(kù)

有這樣一個(gè)現(xiàn)象,在DB2安裝后,使用db2icrt 來(lái)創(chuàng)建實(shí)例時(shí),提示主機(jī)名無(wú)效,提示如下:



[plain] view plain copy

  1. [root@centos-0 instance]# ./db2icrt -u db2inst1 db2inst1  

  2. The host name "centos-0.msdomain" is invalid. Specify a valid host name.   

  3. DBI1922N  The host name is not valid.  

  4.   

  5. Explanation:   

  6.   

  7. The TCP/IP host name parameter is not valid or does not exist.  

  8.   

  9. User response:   

  10.   

  11. Ensure that TCP/IP is operational on the system. If a domain name server  

  12. is used, ensure that the domain name server machine is active. Issue the  

  13. command again using the correct TCP/IP host name.  

  14.   

  15.   

  16. DBI1079I  Output is saved in the log file /tmp/db2icrt.log.2816.  

  17.   

  18. Explanation:   

  19.   

  20. All processed and failed operations have been saved into this log file.  

  21.   

  22. User response:   

  23.   

  24. Do not modify this file in any way. This file is for IBM Technical  

  25. Support reference.  

  26.   

  27.   

  28. /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

  1. ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?} ${DB2ISRVOPTS?}  

  2.   

  3.   

  4.  if [ $? -eq 3 ]; then  

  5.   

  6. db2isrv  

  7.   

  8.   

  9.   

  10. ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?} ${DB2ISRVOPTS?}  

  11.         if [ $? -eq 3 ]; then  

  12.             display_msg ${DB2CAT?} 922 \  

  13.                         'DBI1922N  The host name is not valid.\n'<pre name="code" class="plain">            stop_prog 1</pre> fi<p></p>  

  14. <pre></pre>  

  15. <br>  

  16. 就是當(dāng)db2isrv -addcfm -i ${INSTNAME?} ${DB2ISRVOPTS?} 返回為3的時(shí)候提示主機(jī)名稱(chēng)不正確。<br>  

  17. 這個(gè)db2isrv 找了很多東西,沒(méi)找到具體的內(nèi)容,看名字是給系統(tǒng)增加一個(gè)服務(wù)。后面是addfmc ,這個(gè)fmc是DB2的故障守護(hù)進(jìn)程。<br>  

  18. 這個(gè)是監(jiān)測(cè)DB2實(shí)例正常運(yùn)行,當(dāng)實(shí)例異常宕機(jī)后,它會(huì)自動(dòng)啟動(dòng)實(shí)例。那么以上的錯(cuò)誤可以連起來(lái)了:<br>  

  19. 再給系統(tǒng)增加一個(gè)DB2守護(hù)進(jìn)程的時(shí)候失敗了,原因是主機(jī)名不對(duì)。<br>  

  20. 好的,看一下主機(jī)名定義<br>  

  21. <p></p>  

  22. <p></p><pre name="code" class="plain">[root@centos-0 instance]# hostname  

  23. centos-0.msdomain</pre>這沒(méi)問(wèn)題<br>  

  24. 再看<p></p>  

  25. <p></p><pre name="code" class="plain">[root@centos-0 instance]# vi /etc/hosts  

  26. 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4  

  27. ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6</pre><br>  

  28. 這個(gè)地方不知為什么CENTOS裝好之后沒(méi)有修改,修改一下。修改后內(nèi)容如下<br>  

  29. <p></p>  

  30. <p></p><pre name="code" class="plain">[root@centos-0 instance]# vi /etc/hosts  

  31. 127.0.0.1   localhost centos.msdomain localhost4 localhost4.localdomain4  

  32. ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6</pre><br>  

  33. 保存再次執(zhí)行創(chuàng)建實(shí)例,正常<p></p>  

  34. <p><br>  

  35. </p>  


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI