سؤال

I am not able to connect my db2 application to my localhost database.

The db2 API used by the application need TCPIP and try to connect to host "localhost" and port "50001".

The error I have is .

 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

I had to setup all below manually as I didn't have it on my machine

I had a look with wireshark to see what is happening but I can see that the communication is reset ..plus using telnet the communication is not established and netstat doesn't listen that port.

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 
هل كانت مفيدة؟

المحلول

The steps should be:

  1. set DB2COMM=tcpip and bounce the instance

  2. check if it's tcpip4 or tcpip6 using
    netstat -an | grep -i port number (here 50001)

  3. get remote server IP using
    pctt -r

  4. catalog node with:
    db2 catalog tcpip4/tcpip6 node <nodename> remote <ip address> server <port number>

  5. catalog database
    db2 catalog DB <dbname> at node <nodename>

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top