EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

Protecting IServer ports from being occupied by other processes on Linux


Zhuang Luo

Software Engineer, Senior • MicroStrategy


This article describes the symptom when IServer ports are occupied by other processes on Linux. And providing the action to avoid the occupation of the ports from happening.

SYMPTOM

On Linux, when one of the IServer ports(by default they are 34952, 34962, 39321, 39320) is occupied by other processes(external or child process), IServer will fail to start up. Checking the DSSErrors.log, we will find such error message “Server failed to start up due to the error: MSINetServer: Port XXXX is already in use”. For example, the error message is “Server failed to start up due to the error: MSINetServer: Port 34952 is already in use“ when port 34952 is occupied by other processes.

CAUSE

On Linux, many Linux kernels use the port range 32768–60999(Ephemeral port ) as the default ephemeral port range. Since the default IServer ports 34952, 34962, 39321, 39320 are all within the range, these ports can be chosen by any processes as the client port to communicate with a server. Before IServer starts, if one of the ports is already used by another process, the server can not start due to the required port being in use.

ACTION

We will provide two solutions to protect the IServer ports from being occupied by other processes.

Solution 1: Add the IServer ports in the OS Kernel reserved ports pool. In this way, all of the added ports will not be selected by any processes as the client ports. But IServer process can still bind these reserved ports manually.

In order to make the change, we can just execute the command sysctl net.ipv4.ip_local_reserved_ports=”34952,34962,39321,39320” in a Linux terminal.
Note: In the above command, no space between the ports, just a comma.

Solution 2: Change the ephemeral port range so that the IServer ports will not be in the range. In this way, any process will never choose the IServer ports anymore but IServer process can still bind them manually.

We can make the change by the command sysctl net.ipv4.ip_local_port_range="40000  65535". It will adjust the ephemeral port range to 40000-65535. Since then, all of the processes will choose a port within this range as the client port to connect to its server.
Note:
For both solution 1 and solution 2:
Please do the change before starting IServer.
The change of OS Kernel setting will take effect instantly. But if the machine is restarted, the setting will recover to the default value. So please redo the modification per the machine restart.
 
If we want to make the change effective permanently, we should edit the system file /etc/system.conf manually with root. Edit the file /etc/system.conf, append the lines
net.ipv4.ip_local_port_range=40000 65535
net.ipv4.ip_local_reserved_ports=34952,34962,39321,39320
in it.
The content of the file looks like follows
Content in /etc/system.conf
Then activate the modification by the command
sysctl -p
It will load in the new sysctl settings from the file /etc/sysctl.conf and active them.
You can verify the activation by the commands
cat /proc/sys/net/ipv4/ip_local_reserved_ports
and
cat /proc/sys/net/ipv4/ip_local_port_range
respectively.
Both solution 1 and 2 will solve the IServer ports occupation issue. Please choose the proper one according to your preference


Comment

0 comments

Details

Knowledge Article

Published:

January 20, 2022

Last Updated:

January 20, 2022