gpt4 book ai didi

db2 不监听本地主机上的 TCPIP 连接

转载 作者:行者123 更新时间:2023-12-02 00:08:36 26 4
gpt4 key购买 nike

我无法将我的 db2 应用程序连接到我的 localhost 数据库。

应用程序使用的 db2 API 需要 TCPIP 并尝试连接到主机“localhost”和端口“50001”。

我的错误是。

 SQL30081N  A communication error has been detected. 
Communication protocol being used:
"TCP/IP". Communication API being used: "SOCKETS". Location where
the error was detected: "127.0.0.1". Communication function detecting
the error: "connect". Protocol speci fic error code(s): "111", "*"
, "*". SQLSTATE=08001

我必须手动设置以下所有内容,因为我的机器上没有它

我看了 wireshark看看发生了什么,但我可以看到通信已重置..加上使用 telnet the communication is not established and netstat不听那个端口。

Do I have to issue some extra command to start listening?



Below all my setup.



db2 "get database manager configuration" | grep SVC
TCP/IP Service name (SVCENAME) = db2c_db2inst1
SSL service name (SSL_SVCENAME) =

Then the services

cat /etc/services | grep db2c_
db2c_db2inst1 50001/tcp # DB2 connection service port

I also allow the firewall on that port.

 iptables -I INPUT -p tcp --dport 50001 -j ACCEPT  
/sbin/service iptables save

iptables -list

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:db2c_db2inst1

最佳答案

步骤应该是:

  • 套装DB2COMM=tcpip并反弹实例
  • 检查它是 tcpip4 还是 tcpip6 使用netstat -an | grep -i port number (here 50001)
  • 使用获取远程服务器 IPpctt -r
  • 目录节点:db2 catalog tcpip4/tcpip6 node <nodename> remote <ip address> server <port number>
  • 目录数据库db2 catalog DB <dbname> at node <nodename>
  • 关于db2 不监听本地主机上的 TCPIP 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16857170/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com