Port Allocation
Port allocation for services such as HTTP and remote transport bindings is centrally managed and configured in Fabric3.
The following table lists default values for common ports:
Service | Default Port |
---|---|
HTTP | 8080 |
HTTPS | 8484 |
JMX | 1199 |
JMS | 61616 |
These defaults may be changed in systemConfig.xml using by assigning ports for specific transports, a range of ports, or a combination of both.
Dynamic Port Allocation Using Port Ranges
Port allocation can be configured to use a range (pool) of available ports by using the runtime/@port.range
attribute in systemConfig.xml:
<runtime port.range="8181-8282"/>
The port.range is inclusive. When a socket listener is requested by a runtime component, Fabric3 will reserve a port from the configured range. Port ranges are particularly useful in environments where a large number of runtime instances are created since ports do not need to be individually configured and coordinated for each runtime.
Multi-Homed Port Allocation
In multi-homed environments, it is often necessary to specify which IP address ports should be allocated on. The default allocation behavior is to reserve ports on the wildcard address 0:0:0:0. This will not work when ports must be allocated on a different IP address, e.g. 127.2.84.1.
To enable a specific address to allocate Ports, use the runtime/@host.address
attribute in systemConfig.xml:
<runtime port.range="8181-8282" host.address="127.2.84.1"/>
This will ensure that the port.range will be allocated on the specified host.address.
Fixed Port assignments
It is often necessary to assign specific ports to services such as HTTP, while other services should allocate from a port range. This can be done by in systemConfig.xml.
HTTP/HTTPS Ports
HTTP and HTTPS ports can be set by adding the following entries to systemConfig.xml:
<runtime port.range="8181-8282"/> <web.server> <http port="80"/> <https port="443"/> </web.server>
JMX Port
The JMX port is configured using the @jmx.port
attribute of the <runtime>
element, as shown below:
<config> <runtime jmx.port="1100"/> </config>
Viewing Allocated Ports via the Management Resource Framework
Allocated ports can be viewed via the Management Resource Framework (MFR). The following URL is used to accesses port allocations for a runtime instance:
http://<server base address>:<port>/management/runtime/ports