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 one or more clusters automatically by setting proper environment variables when it's container is started.
|BO_AUTO_CLUSTER_QUERY||true or false to enable/disable auto cluster query|
|BO_CLUSTER_LIMIT||the maximum number of rows returned from a client|
|BO_MAX_LOG_FILES||set the maximum number of log files|
|BO_SSL||true or false to enable/disable ssl connection on port 3306|
|BO_WS||a regular expression to specify databases exposed to cluster|
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
If BO_CLUSTER_LIMIT is set to zero, there is no limitation imposed on the number of rows returned from a client. The default value is 100000.