Technote (FAQ)
Question
How communication ports and range are defined in /etc/services file in Linux/Unix DB2 partitioned installations?
Answer
①单分区:
When you create a DB2 instance with single partition, default port of 50000 is assigned for client to server communication.
# Default port
db2c_db2inst1 50000/tcp
②多分区:
But, a port range is required to enable the communication between the DB2 partitions using FCM (fast communication manager). So, use of port range depends on whether you use partitions or not while installing DB2.
# Default port
db2c_db2inst1 50000/tcp
# FCM ( fast communication manager ) port range
DB2_db2inst1 60000/tcp
DB2_db2inst1_1 60001/tcp
DB2_db2inst1_2 60002/tcp
DB2_db2inst1_END 60003/tcp
To enable communications between the servers in a partitioned database environment using /etc/services file, here are the basic steps to create entries in /etc/services file:
1. Log on to the primary computer (instance owning computer) as a user with root authority.
2. Create an instance.
3. View the default port range that has been reserved in the /etc/services file. In addition to the base configuration, the FCM ports should appear similar to the following:
# Default port
db2c_db2inst1 50000/tcp
# FCM ( fast communication manager ) port range
DB2_db2inst1 60000/tcp
DB2_db2inst1_1 60001/tcp
DB2_db2inst1_2 60002/tcp
DB2_db2inst1_END 60003/tcp
By default, the first port (50000) is reserved for client to server connection requests, and the first available four ports above 60000 are reserved for FCM communication. One port is for the instance-owning database partition server and three ports are for logical database partition servers that you might choose to add to the computer after installation is complete.
The port range must include a start and an END entry. Intermediate entries are optional. Explicitly including intermediate values can be useful for preventing other applications from using these ports, but these entries are not verified by the database manager.
Naming convention for the ports:
DB2® port entries use the following format:
DB2_instance_name_suffix port_number/tcp # comment
where:
instance_name is the name of the partitioned instance.
suffix is not used for the first FCM port. Intermediate entries are those between the lowest and highest port. If you include the intermediate entries between the first and ending FCM port, the suffix consists of an integer that you increment by one for each additional port. For example, the second port is numbered 1, and third is numbered 2, and so on to ensure uniqueness. The word END must be used as the suffix for the last entry.
port_number is the port number that you reserve for database partition server communications.
comment is an optional comment describing an entry.