The users can setup a BigObject cluster from the master node by commands.
Given the information for each client such as ip address and databases, it is easy to setup a cluster from the master by adding databases in each client into the master.
Alternatively, for a cluster with changing clients or edge computing environment, each client node can register itself to join the master's cluster.
Note that communications between two BigObjects are via port 9091 within the docker container. It is important to inform the master the correct exposed port number of 9091 for each client.
In short, a BigObject cluster is purely determined by the BigObject master. Each master can have a different cluster topology. A BigObject instance can be either a master, a client, or both. The flexibility of a BigObject cluster make it easy to accommodate different application needs.
Setup BigObject Cluster From Master
The user can use ADD CLIENT and DROP CLIENT statement to add or remove a client's database to or from a cluster. The general syntax are:
ADD CLIENT ip=ip_address db=database_name [port=port_number]
DROP CLIENT ip=ip_address db=database_name [port=port_number]
For example, assume the IP address of a BigObject Client is 192.168.0.3 and the data is spread in two databases "log1" and "log2". The user can use ADD CLIENT command to add both databases to the master as follows:
ADD CLIENT ip="192.168.0.3" db="log1" ADD CLIENT ip="192.168.0.3" db="log2"
The user can use SHOW CLUSTER to list all databases in a master's cluster:
Setup BigObjectc Cluster From Client
A client node can join a master's or multiple masters' cluster automatically by setting proper environment variables when it's container is started.
|BO_WS||(optional) a regular expression to specify databases exposed to masters.|
For example, the following docker run command starts a bigobject database client and registers all its databases to the master at IP 192.168.1.100.
docker run -t -d --name client1 -p 9090:9090 -p 19091:9091 -p 3306:3306 -e BO_MASTER="192.168.0.100" -e BO_ENDPOINT="192.168.0.3:19091" bigobject/bigobject