client 连接DB2 server 报错

[复制链接]
查看11 | 回复2 | 2014-1-24 10:18:55 | 显示全部楼层 |阅读模式
本帖最后由 wiron 于 2013-10-26 22:03 编辑
初学者,不知道问题出在哪儿。。
我server 和client 装的DB2 v10.5 express-c,OS 都是Enterprise Linux 5.catalog node and DB both completed successfully.
catalog DB2 server node on client
db2 catalog tcpip node db2node remote DB2-EL5 server 50000 ostype linux
catalog Database on client:
db2 catalog db mydb at node db2node
有没有高人指导下,是个人学习测试环境,谢谢!
问题症状:
[db2adm@oc0386348167 ~]$ db2 connect to mydb user db2adm using rootroot
SQL30081NA communication error has been detected. Communication protocol
being used: "TCP/IP".Communication API being used: "SOCKETS".Location
where the error was detected: "192.168.122.129".Communication function
detecting the error: "connect".Protocol specific error code(s): "113", "*",
"*".SQLSTATE=08001
[db2adm@oc0386348167 ~]$
分析:
DB2 server 端配置信息:
[db2inst1@DB2-EL5 ~]$ hostname
DB2-EL5
[db2inst1@DB2-EL5 ~]$ db2 list db directory
System Database Directory
Number of entries in the directory = 2
Database 1 entry:
Database alias
= MYDB
Database name
= MYDB
Local database directory
= /home/db2inst1
Database release level
= 10.00
Comment
=
Directory entry type
= Indirect
Catalog database partition number= 0
Alternate server hostname
=
Alternate server port number =
Database 2 entry:
Database alias
= SAMPLE
Database name
= SAMPLE
Local database directory
= /home/db2inst1
Database release level
= 10.00
Comment
=
Directory entry type
= Indirect
Catalog database partition number= 0
Alternate server hostname
=
Alternate server port number =
[db2inst1@DB2-EL5 ~]$
[db2inst1@DB2-EL5 ~]$ db2set -all
DB2COMM=TCPIP
DB2AUTOSTART=YES
[g] DB2_COMPATIBILITY_VECTOR=MYS
[g] DB2SYSTEM=DB2-EL5
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=db2as
[db2inst1@DB2-EL5 ~]$
[db2inst1@DB2-EL5 ~]$ db2 get dbm cfg |grep "SVCENAME"
TCP/IP Service name
(SVCENAME) = db2c_db2inst1
SSL service name
(SSL_SVCENAME) =
[db2inst1@DB2-EL5 ~]$ tail -1 /etc/services
db2c_db2inst1 50000/tcp
#DB2 connection service
[db2inst1@DB2-EL5 ~]$ netstat -an |grep 50000
tcp00 0.0.0.0:50000
0.0.0.0:*
LISTEN
[db2inst1@DB2-EL5 ~]$ tail -2 /etc/hosts
192.168.122.1 c0386348167.ibm.com
192.168.122.129 DB2-EL5
[db2inst1@DB2-EL5 ~]$
DB2 client端配置情况:
[db2adm@oc0386348167 ~]$ hostname
oc0386348167.ibm.com
[db2adm@oc0386348167 ~]$ db2 list node directory
Node Directory
Number of entries in the directory = 1
Node 1 entry:
Node name
= DB2NODE
Comment
=
Directory entry type = LOCAL
Protocol
= TCPIP
Hostname
= DB2-EL5
Service name
= 50000
[db2adm@oc0386348167 ~]$ ping DB2-EL5
PING DB2-EL5 (192.168.122.129) 56(84) bytes of data.
64 bytes from DB2-EL5 (192.168.122.129): icmp_seq=1 ttl=64 time=0.366 ms
64 bytes from DB2-EL5 (192.168.122.129): icmp_seq=2 ttl=64 time=0.328 ms
64 bytes from DB2-EL5 (192.168.122.129): icmp_seq=3 ttl=64 time=0.261 ms
^C
--- DB2-EL5 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2376ms
rtt min/avg/max/mdev = 0.261/0.318/0.366/0.045 ms
[db2adm@oc0386348167 ~]$ telnet 192.168.122.129 50000
Trying 192.168.122.129...
telnet: connect to address 192.168.122.129: No route to host
[db2adm@oc0386348167 ~]$

回复

使用道具 举报

千问 | 2014-1-24 10:18:55 | 显示全部楼层
关了iptables,然后重启DB2 server 后解决了这个问题。
#chkconfig --level 2345 iptables off
#reboot
回复

使用道具 举报

千问 | 2014-1-24 10:18:55 | 显示全部楼层
兄弟,问题解决了吗?
我看你设置应该是对的,还有一种情况,如果是用port# 50000不好使,可是使用SVCENAME
db2 catalog tcpip node db2node remote DB2-EL5 server db2c_db2inst1 ostype LINUX
因为你已经有如下设置了:
TCP/IP Service name
(SVCENAME) = db2c_db2inst1
如果之前有同名本地数据库,最好drop掉再试远程的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行