Outdated Version

You are viewing an older version of this section. View current production version.

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 MemSQL Docker Image

Warning

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

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

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

    docker stop memsql-ciab
    
    docker rm memsql-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 memsql-ciab \
        -v memsql-ciab-data:/var/lib/memsql \
        -p 3306:3306 -p 8080:8080 \
        memsql/cluster-in-a-box
    

    Windows

    docker run -d --init `
        --name memsql-ciab `
        -v memsql-ciab-data:/var/lib/memsql `
        -p 3306:3306 -p 8080:8080 `
        memsql/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 memsql-ciab

Restarting the container (must be running):

docker restart memsql-ciab

Remove the container (all data will be deleted):

docker rm memsql-ciab

Access the Built-in MemSQL Tools

Every memsql/cluster-in-a-box container also contains the MemSQL 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 memsql-ciab /bin/bash

Once connected, you can run any of the MemSQL 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 memsql-admin and memsql-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                  |
+------------+--------+------+---------------+--------------+---------+----------------+--------------------+