Using multiple containers to run a multi-node cluster using Docker

Hello everyone,

I was following this guide: Spin Up a SingleStore Cluster on Docker Desktop in 10 Minutes to create a multi-node cluster and I realized that it only shows how to create one node using the memsql/cluster-in-a-box image.
If I create multiple containers using this image how can I make these containers aware of eachother so that they behave like a multi-node cluster? Is there any documentation for this process?

Thanks,
Anjana

The best way to create a multi-node cluster is to use SingleStoreDB toolbox (especially sdb-deploy and sdb-admin) to gang together several logical machines into one cluster. See here for how to install toolbox:

The logical machines can be running on bare metal, VMs, or containers – your choice. You’ll have to set those up separately.

General SingleStoreDB installation instructions are here:

A good example is the instructions for installing on Red Hat Linux from the command line.

The cluster-in-a-box image is oriented toward single-node use for small systems and developer use.

Consider using our cloud service to make deployment easier. We handle it for you there.

What do you mean by “logical machines” in this instance?
My goal is to create an offline virtual network on docker with 2 aggregator nodes and 2 leaf nodes where each node is running on separate containers on the same machine.

In this documentation post CLI Online Deployment - Red Hat Distribution · SingleStore Documentation
it says that you need to call the following command from the master-host to create the other nodes. I am assuming that this command uses ssh to remote access the machines and creates the nodes on the respective machines:

sdb-deploy setup-cluster -i /path/to/yourSSHkey \
    --file-path <singlestoredb-server-package> \
    --license <license> \
    --master-host <main_IP_address_or_hostname> \
    --aggregator-hosts <child_agg_IP_address_or_hostname> \
    --leaf-hosts <leaf1_IP_address_or_hostname>,<leaf2_IP_address_or_hostname> \
    --password <secure_password>

since I am using docker containers I don’t think ssh will work?

Possible solution:
Assuming I have created the master aggregator using:

sdb-admin bootstrap-aggregator --memsql-id 0123ABCDEF --license BgEZY....==

is the solution to just go on each of these containers and use:

sdb-admin add-aggregator --host <master_aggregator> --port 3306

to add aggregator nodes to the network? Will this method avoid the use of ssh?

Hello, input from our support team. Cluster-in-a-box should be used as an image of an aggregator and a leaf node for dev/test proposes and that’s about it. It is not meant to be used as a base for a cluster running multiple nodes. To create a cluster running multiple nodes on one host using a containerized solution, you should use kubernetes (something like minikube should work fine).

1 Like

I was able to use Ubuntu multipass to create 3 virtual server and then connect them to one another. Docker should work too. I have not played with Kubernetes yet.