The Blueworx Platform can be configured to allow BRM servers to be added and removed dynamically without shutting down and reconfiguring the Blueworx Platform.
To enable dynamic cluster reconfiguration the following entries must be added to zoo.cfg on each BRM.
reconfigEnabled=true standaloneEnabled=false skipACL=true
To query configured cluster members the brm --server command is used. This will list all configured BRM servers rather than all operational BRM servers. For example:
brm --server Running commands: --server ----------------------------- 1=1.2.3.4:2888:3888:participant;0.0.0.0:9696 2=1.2.3.5:2888:3888:participant;0.0.0.0:9696
Each line represents a single BRM server and has the following format.
<myid>=<address>:<port1>:<port2>[:role];[<client port address>:]<client port>
A BRM server can be added to an existing cluster. This is achieved with the following steps.
Create $BRM_CONF/zoo.cfg on the new server. The configuration file must contain both the new server definition and at least one existing cluster member.
For example to add a server 1.2.3.6 (as server 3) to the above example the $BRM_CONF/zoo.cfg should be:
standaloneEnabled=false reconfigEnabled=true clientPort=9696 dataDir=/opt/blueworx/rm/zookeeper/data_dir syncLimit=2 initLimit=5 tickTime=2000 skipACL=yes server.1=1.2.3.4:2888:3888 server.2=1.2.3.5:2888:3888 server.3=1.2.3.6:2888:3888
Create $BRM_HOME/zookeeper/data_dir/myid with the correct server id.
Following the example above on 1.2.3.6 the following command is executed:
echo 3 > /opt/blueworx/rm/zookeeper/data_dir/myid
Start up the new BRM server.
This will cause the $BRM_CONF/zoo.cfg to become migrated. The server will temporarily join the cluster and receive update server details. The new server details will NOT include this server (as its temporary). So if the new server is accidently shutdown the $BRM_CONF/zoo.cfg must be restored from $BRM_CONF/zoo.cfg.bak
Add the new BRM server permenantly to the cluster. This is achieved using brm --server "add=X=Y" where X is the server myid and Y is the server details. The server details can be found by executing brm --server and finding the new server entry.
Based on the example above the 1.2.3.6 server can be added with the following command:
brm --server "add=3=1.2.3.6:2888:3888:participant;0.0.0.0:9696"
To remove a BRM server execute brm --server remove=X where X is the myid of the server.
In the example above to remove the 1.2.3.6 server the following command is executed:
brm --server remove=3