MashZone Event Service/Real-Time Buffer Server (RTBS)
Note: It is not recommended to configure RTBS clustering manually. The service contains of three sub-components (RTBS Core, HA-Store, Zookeeper) and the configuration of those components must be coherent. The only officially supported way to configure RTBS is using Command Central plugin.
For illustration purposes, we assume that the RTBS cluster should contain of three machines: machine1, machine2, and machine 3.
Configure the following parameters on your MashZone NextGen Event Service (RTBS) nodes.
rtbs.properties
Edit the rtbs.properties file and set rtbs.id, rtbs.zookeeper.urls, and rtbs.replication.factor as described below.
The rtbs.properties file is located in the <MashZone NextGen installation> /rtbs/conf/ directory
rtbs.id=<Unique id per node between 1 and 255>, for example, 1 for machine 1, 2 for machine 2, 3 for machine 3
rtbs.zookeper.urls=machine1:12181,machine2:12181,machine3:12181
Replace the host names machine1, machine2, and machine3 by your real servers' host names and also set the right ports. You must enumerate all RTBS cluster members.
rtbs.replication.factor=<number> <number> in replication factor determines how many replicas of persisted data (for high availability) should exist. The number must be >= 1 and <= the number of RTBS instances in the cluster. The number must be >= 2 to achieve any fault tolerance. As a rule of thumb: the higher the number of replicas the more RTBS node failures can be tolerated. However, the amount of storage required on the RTBS machines increases linearly with the number of replicas.
Note: The replication factor setting only affects buffers that are created after the replication factor was changed, that is, changing the replication factor does not affect existing buffers.
zookeeper.properties
Edit the zookeeper.properties file and add the parameters described below.
The zookeeper.properties file is located in the <MashZone NextGen installation> /rtbs/zookeeper/conf/ directory
Add the parameters:
initLimit=5
syncLimit=2
The initLimit parameter is the time in seconds Zookeeper waits for other nodes to join the cluster (Zookeeper Ensemble). If the cluster initializations fails (especially relevant if nodes are not started in an automated and coordinated way), increase the value, for example, to 60.
For each RTBS server in the cluster, add a line as follows:
server.<number>=<hostname>:2888:3888 Here, <number> is a strictly monotonic increasing number starting at 1. It is not necessarily equivalent to rtbs.id, that is, if you decide to use rtbs.id=42 for machine1, the entry would still be server.1=machine1:2888:3888
For our example, this means that we need to add the following three lines:
server.1=machine1:2888:3888
server.2=machine2:2888:3888
server.3=machine3:2888:3888
Create the file <MashZone NextGen installation> /rtbs/zookeeper/data/myid.
Add the machine's rtbs.id to the file, that is, just the digit 1 for machine 1, digit 2 on machine 2, digit 3 for machine 3.
Edit the file server.properties and adjust broker.id to the machine's RTBS id.
The server.properties file is located in the <MashZone NextGen installation>/rtbs/ha-store/conf/ directory.
broker.id=<rtbs.id>, i.e. 1 on machine 1, 2 on machine 2, 3 on machine 3 MashZone NextGen nodes
Configure the following parameters on your MashZone NextGen nodes.
Edit the mashzone.rtbs.url parameter in the mashzone.properties file and set host name and port accordingly.
<MashZone NextGen installation>/apache-tomcat/webapps/mashzone/WEB-INF/mashzone.properties
mashzone.rtbs.url=machine1:12181,machine2:12181,machine3:12181 Replace the host names machine1, machine2, and machine3 by your real servers' host names and also set the right ports. You must enumerate all RTBS cluster members.
Optionally, if MashZone NextGen and RTBS are co-located on the same machine (for example, machine i hosts both MashZone NextGen instance i and RTBS Instance i), you can add the parameter mashzone.rtbs.id=i to make the MashZone NextGen instance prefer RTBS instance i. If the preferred RTBS instance does not exist or is unavailable, MashZone NextGen will automatically choose another RTBS instance.
Note: Calls to the RTBS API are server-to-server calls which usually happen behind the load balancer. In some cases it might be necessary to route these calls through the load balancer as well. In this case, make sure that you configure your load balancer accordingly. Set the load balancer's host name and port in the parameters mentioned above.