Setting communication protocols for a DB2 instance is part of the main task of configuring TCP/IP or SSL communications for a DB2 instance.
Set Communication protocol:
Run with db2inst1 user
1 2 3 4 | db2set DB2COMM=tcpip db2set –all db2stop db2start |
This parameter contains the name of the TCP⁄IP port which a database server will use to await communications from remote client nodes.
Set a port on which application /client will communicate
1 | db2 update dbm cfg using SVCENAME 50021 |
The system administrator for the database server must reserve a port (number n) and define its associated TCP/IP service name in the services file at the server.
The database server port (number n) and its TCP/IP service name need to be defined in the services file on the database client.
On Linux and UNIX systems, the services file is located in: /etc/services
Example:
1 2 | cat /etc/services | grep 50021 db2c_db2inst1 50021/tcp |