Manage the Container min read


The following are a set of management operations you can perform when using your cluster-in-a-box container. These operations are included as reference for users who are not familiar with managing Docker containers.

Upgrade the SingleStore DB Docker Image

Alert

If you do not use a volume to persist your data, you will lose any data stored in the SingleStore DB cluster-in-a-box container during the upgrade process.

  1. To upgrade the singlestore/cluster-in-a-box Docker image to the latest version, run docker pull:

    docker pull singlestore/cluster-in-a-box
    
  2. Stop and remove the old container. This will delete any data stored in the container.

    docker stop singlestore-ciab
    
    docker rm singlestore-ciab
    
  3. If you did not use a volume to preserve data in your container, restart it with the latest image by running steps 2 and 3 from Run the Container again.

  4. If you did set up your Docker container with a volume, run the following instead:

    Linux/macOS

    docker run -d --init \
        --name singlestore-ciab \
        -v singlestore-ciab-data:/var/lib/memsql \
        -p 3306:3306 -p 8080:8080 \
        singlestore/cluster-in-a-box
    

    Windows

    docker run -d --init `
        --name singlestore-ciab `
        -v singlestore-ciab-data:/var/lib/memsql `
        -p 3306:3306 -p 8080:8080 `
        singlestore/cluster-in-a-box
    

Stop, Restart, or Remove the Image

If you have a running container, you can manage it through the following commands.

Stopping the container (must be running):

docker stop singlestore-ciab

Restarting the container (must be running):

docker restart singlestore-ciab

Remove the container (all data will be deleted):

docker rm singlestore-ciab

Access the Built-in SingleStore Tools

Every singlestore/cluster-in-a-box container also contains the SingleStore Tools needed to perform cluster operations.

To access these tools, you must connect directly to a running container using docker exec as shown below:

docker exec -it singlestore-ciab /bin/bash

Once connected, you can run any of the SingleStore Tools; however, because the master aggregator and leaf node share the same container (and thus the same host machine), memsqlctl was used to setup and configure the cluster. If the deployment was across multiple host machines, then the higher-level tools such as sdb-admin and sdb-deploy would have been used instead.

The following will show you how to retrieve all of the nodes in the container:

memsqlctl list-nodes
****
+------------+--------+------+---------------+--------------+---------+----------------+--------------------+
| MemSQL ID  |  Role  | Port | Process State | Connectable? | Version | Recovery State | Availability Group |
+------------+--------+------+---------------+--------------+---------+----------------+--------------------+
| F7C4D853E0 | Master | 3306 | Running       | True         | 6.7.1   | Online         |                    |
| 77BCA7CC40 | Leaf   | 3307 | Running       | True         | 6.7.1   | Online         | 1                  |
+------------+--------+------+---------------+--------------+---------+----------------+--------------------+