Sometimes it is necessary to change, or increase the size of, the port range used for DRBD device replication from the default range of TCP ports 7000-7999.
LINSTOR® has a configurable TCP port range that it uses for the DRBD® devices it creates. This port range is controlled by a property named, TcpPortAutoRange
, which is set on the LINSTOR controller object within the LINSTOR database. Sometimes it is necessary to change, or increase the size of, the port range from the default range of 7000-7999. You might want to do this if you have already used 1000 ports, or you anticipate that need some day, or if you do not want LINSTOR’s assignable port number range to clash with port numbers that might be reserved or assigned by other applications or services.
Symptoms
If your LINSTOR cluster is so large that you’ve run out of ports within the range, you will be unable to create new DRBD devices. When attempting to create a new resource, you will receive an error similar to the following from LINSTOR:
ERROR:
Description:
No TCP/IP port number could be allocated for the resource
Cause:
The pool of free TCP/IP port numbers is exhausted
null
Correction:
- Adjust the TcpPortAutoRange controller configuration value to extend the range
of TCP/IP port numbers used for automatic allocation
- Delete unused resource definitions that occupy TCP/IP port numbers from the range
used for automatic allocation
Details:
Resource group: example-resource-group
Show reports:
linstor error-reports show 669E7452-00000-000017
Problem
The problem, as stated in the LINSTOR error, is that the pool of free TCP/IP port numbers is exhausted. This could be because you have many DRBD resources using all the ports from the configured TcpPortAutoRange
, or because you have stale LINSTOR resource-definitions
holding onto ports which could be recycled.
To view the currently configured port range, use the following command:
# linstor controller list-properties
To inspect the LINSTOR cluster’s utilization of ports from the pool, list the LINSTOR resource
and resource-definition
objects:
# linstor resource list
╭────────────────────────────────────────────────────────────────────────────────────╮
┊ ResourceName ┊ Node ┊ Port ┊ Usage ┊ Conns ┊ State ┊ CreatedOn ┊
╞════════════════════════════════════════════════════════════════════════════════════╡
┊ resource-1 ┊ linstor-0 ┊ 7003 ┊ InUse ┊ Ok ┊ UpToDate ┊ 2024-07-17 19:34:06 ┊
┊ resource-1 ┊ linstor-1 ┊ 7003 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2024-07-17 19:34:12 ┊
┊ resource-1 ┊ linstor-2 ┊ 7003 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2024-07-17 19:34:12 ┊
┊ resource-2 ┊ linstor-0 ┊ 7002 ┊ InUse ┊ Ok ┊ UpToDate ┊ 2024-07-17 13:44:51 ┊
┊ resource-2 ┊ linstor-0 ┊ 7002 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2024-07-22 18:04:05 ┊
┊ resource-2 ┊ linstor-1 ┊ 7002 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2024-07-17 13:44:55 ┊
┊ ... snip ... ┊
╰────────────────────────────────────────────────────────────────────────────────────╯
# linstor resource-definition list
╭──────────────────────────────────────────────────────╮
┊ ResourceName ┊ Port ┊ ResourceGroup ┊ State ┊
╞══════════════════════════════════════════════════════╡
┊ resource-1 ┊ 7003 ┊ example-resource-group ┊ ok ┊
┊ resource-2 ┊ 7002 ┊ example-resource-group ┊ ok ┊
┊ ... snip ... ┊
╰──────────────────────────────────────────────────────╯
If you see a resource-definition
that does not correspond to a resource
, you might be able to delete the stale resource-definition
to recycle port being held by the resource-definition
.
Solution
The simplest solution is to increase the port number pool configured by the TcpPortAutoRange
property. Use the following command to set a larger TcpPortAutoRange
port range:
# linstor controller set-property TcpPortAutoRange 7000-9999
Alternatively, if you have identified one or more stale resource-definition
objects and want to delete them, use the following command:
# linstor resource-definition delete <resource-definition-name>
Written by: MDK - 2024-08-20