DB2 can't connect to the server

后端 未结 2 933
执念已碎
执念已碎 2020-12-18 17:24

I am tring to set up a db2 server on a Windows 7 machine and I cant connect to database from remote, only from local. I think I might miss some configuration.

1) I t

相关标签:
2条回答
  • 2020-12-18 17:33

    Try to do a telnet on the instance port to check that everything is right from the client to the server

    telnet DB2-Server-name 50000
    

    Where DB2-Server-name is the server name or IP address. Make sure you can get the server. 50000 is the most often DB2 port, but you have to check the configuration.

    Once you get connection to the server, you can configure the node with the previous answer.

    0 讨论(0)
  • 2020-12-18 17:40

    First of all, the fact that you cannot ping the server and nmap doesn't see the open ports means your problem, at least at this point, lies outside DB2. Once you fix your network issues, here's the procedure you can follow to set up remote connectivity to a DB2 database via TCP/IP.

    1) Optional. You can use either a service name or a port number to configure the DB2 instance. If you want to use the service name, on the server add a line to /etc/services similar to db2c_db2inst1 50000/tcp, which assigns the service name "db2c_db2inst1" to the port 50000.

    2) On the server update the DB2 instance configuration: db2 update dbm cfg using svcename db2c_db2inst1 (or db2 update dbm cfg using svcename 50000 if not using the service name). To verify: db2 get dbm cfg | grep SVCENAME.

    3) On the server update the DB2 registry variable: db2set DB2COMM=TCPIP. To verify: db2set DB2COMM.

    4) On the server restart the instance: issue db2stop force, then db2start.

    5) On the remote client, assuming the DB2 client software is installed, issue db2 catalog tcpip node whatever remote <your server IP address> service <your DB2 port number>. Note that the node name ("whatever" in this example) is limited to 8 ASCII characters.

    6) On the remote client issue db2 catalog database <your database name> at node whatever, referring to the node name ("whatever") that you defined in step 5.

    7) On the remote client verify connectivity: db2 connect to <your database name> user <user name> using <password>

    0 讨论(0)
提交回复
热议问题