JBoss Fuse Fabric port ranges… oh my…

Recently I had an opportunity for a customer to sort out some of the interconnectivity required between servers for a JBoss Fuse Fabric HA ensemble. Obviously when connecting multiple servers in a Fuse Fabric ensemble interconnectivity between those servers is required. Unfortunately the port (ranges) required by JBoss Fuse Fabric are not all documented, and the ones who are documented are spread out between different documents and sections. So it’s not a bulletproof list down to the digit but, with some trial and error (and some netstat J ) we discovered quite some port ranges.

ActiveMQ

Starting with one of the more well known ports, the ActiveMQ message broker defaults to 61616 (although this can be overridden in the broker xml configuration file). When creating brokers based on fabric profiles and assigning these to child containers ports get increased. We decided to open a range of 61600-61700 for the ActiveMQ brokers. When you add more than one hundred brokers you should probably make some additional changes to the broker xml configuration file anyways, here you could control the port ranges to accommodate to your specific needs).

SSH

The containers in JBoss Fuse Fabric have an Apache Karaf runtime. Apache Karaf acts as its own SSH server. Which are useful for managing these containers. However the Apache Karaf containers in Fuse do not host their SSH servers on port 22 (which is usually reserved for the SSH access to the server), but host their ssh a port range starting with 8100 and increasing with each child container created in the Fabric. So a range of 8100 – 8180 (increasing further will cause conflicts with Jolokia, which we will discuss below) gives the option of creating 80 child containers per server!!

RMI

Now it gets a little bit more dicey, for RMI two separate ranges have to be opened RMI registry and RMI server. We noticed the RMI server starts with a port range of 44444, but when creating some child containers the ports got a bit stranger. They were increasing, as expected, and in the url they neatly increase by one. So a child container gets 44445 (as the root container starts with 44444) and so on. But a netstat –plnt command reveals a lot more open ports a lot higher up the range.

In the documentation for the fabric:create command in the console reference[1] the default max port is documented as 65535. This seems to be corresponding with the RMI server port since a netstat revealed assigned ports in the 50000s for the child containers we created.

For the RMI registry port, the documentation unfortunately does not provide much clearity. The default JMX RMI port is 1099, and this does get used by Fuse Fabric, usually by the root container of that node. However, each child containers has its own RMI registry port. These registry ports increase by one. So we decided to open the range up to 1400 giving ample room for creating and deleting child containers.

The strange thing also is the fact this port range conflicts with the ActiveMQ range. Since an internal port conflict is not something I experienced yet I assume Fuse Fabric has the logic to accommodate for the ranges overlapping.

Controlling the RMI ports for both could be done with the commands admin:change-rmi-registry-port and admin:change-rmi-server-port however, I did not test this in a Fabric ensemble setup!

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Console_Reference/ConsoleadminChangeRegistryPort.html

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Console_Reference/ConsoleadminChangeServerPort.html

Fuse Management Console + Jolokia

The default port for the Fuse Management Console is 8181, this is also the port Jolokia uses. For each child container this port gets increased by one. Since we ended our range for the RMI registry at 1400 we will end this range at 8582 for consistency. Although when creating 400 child containers on one machine you’ll have one hell of a server running all these Fabric containers.

Zookeeper

JBoss Fuse Fabric uses Zookeeper as a registry for all sorts of things (for example auto discovery) The default port the Zookeeper registry listens on is 2181. But when creating an ensemble the Zookeeper url gets updated and the port will change, usually increasing by one. Although it is a bit unclear how this port change actually works under the hood. To be on the safe side we went with a port range of 2181 up to 2200.

Fabric Server

The last port ranges are of the Fabric server. I found this one when I did a fabric:config-list and found this entry

Properties:

service.pid = io.fabric8.zookeeper.server.2d360b3a-18bb-4a68-8c94-dccd25e9a2b1

clientPortAddress = 0.0.0.0

syncLimit = 5

server.id = 1

initLimit = 10

service.factoryPid = io.fabric8.zookeeper.server

clientPort = 2182

server.1 = 10.0.2.15:2888:3888

dataDir = data/zookeeper/0001

tickTime = 2000

fabric.zookeeper.pid = io.fabric8.zookeeper.server-0001

Here we see a port range of 2888 to 3888 of the Fabric server.

 

Some final thoughts

Getting into the interconnectivity between servers in a JBoss Fuse Fabric ensemble is definitely not trivial. Espessially the port ranges of Fuse Fabric are quite esoteric. Hopefully this will get documented soon or become a lot clearer when Fabric V2 arrives.

Anyway all the final port ranges we discovered are listed here:

Usage Port range
ActiveMQ 61600 – 61700
RMI registry 1000 – 1400
RMI server 44444 – 65535
SSH 8100 – 8180
Fuse Management Console + Jolokia 8181 – 8582
Zookeeper 2181 – 2200
Fabric server 2888 – 3888

 

[1] https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Console_Reference/ConsoleFabricCreate.html