- I installed Db2 v11.5.7.0 on Linux/x86_64 inside my virtual PC using VirtualBox on Windows 10.
- I created database with name TEST1
- I connected to database using Unix socket:
db2 connect to TEST1
and connection successfully completed. - Check for DB2COMM setting:
db2set DB2COMM
and output is DB2COMM=TCPIP - Just to make sure TCP/IP connection works to Db2 I created local node and catalog database:
db2 catalog tcpip node loctcp remote localhost server 50000
db2 catalog database test1 as tcptest1 at node loctcp
db2 terminate
db2 connect to tcptest1 user db2inst1 using <password>
and connection successfully completed.
- Now on my PC VirtualBox Windows 10 host I set port forwarding Host Port: 60127 and Guest Port: 50000.
- On my Windows PC:
netstat -an -p tcp | find ":60127"
I can see connection is in LISTENING state. - On my Windows PC:
db2 catalog tcpip node remtcp remote localhost server 60127
db2 catalog database test1 as tcptest1 at node remtcp
db2 terminate
- On my Windows PC connect to database
db2 connect to tcptest1 user db2inst1 using <password>
PROBLEM: It looks like connection hangs. After few minutes I get error in Db2 client:
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: "recv". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
- Trying to understand the problem. On Linux server: a) I have checked for firewall and it is disabled. b) IPv6 is disabled c) Db2 is listening on 50000 port using IPv4
- Wireshark on Windows listening to 60127 port. a) TCP connection is established b) Db2 DRDA connection never appears.
- Tcpdump on Linux server capturing 50000 port network traffic. a) TCP connection is established b) Db2 DRDA connection never appears.
It appears something is wrong inside Linux virtual machine, but steps 4 and 5 everything should be fine with Db2 TCP/IP connection.
Any idea what else to check why Db2 client connection does not work?
P.S. I have exact same installation with Db2 v11.1 and Db2 connection from my PC is working fine.
HostPort: 60027 GuestPort: 22
and settings for Db2:HostPort: 60127 GuestPort:50000
and SSH connection works fine, but for some reason Db2 connection doesn't.localhost
as the target on the host side; use the actual host name or IP address.