Outdated Version

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

Run the Container min read


The MemSQL cluster-in-a-box image contains two nodes: A master aggregator node that runs SQL queries and aggregates the results, and a single leaf node, which is responsible for storing and processing data. These two nodes form the most basic MemSQL cluster.

Start the Container

  1. Export your license key into an environment variable named LICENSE_KEY. If your license key is not shown in the code block below, you can copy it from the MemSQL Customer Portal.

    Linux/macOS

    export LICENSE_KEY=[YOUR_LICENSE_KEY]
    
    export ROOT_PASSWORD=[YOUR_ROOT_PASSWORD]
    

    Windows

    set $LICENSE_KEY=YOUR_LICENSE_KEY
    
    set $ROOT_PASSWORD=YOUR_ROOT_PASSWORD
    
    set $START_AFTER_INIT=Y
    
  2. Initialize the cluster using docker run. Note: If you want to preserve data across an upgrade of the Docker container, add a -v memsql-ciab-data:/var/lib/memsql before memsql/cluster-in-a-box in the command below.

    Linux/macOS

    docker run -i --init \
        --name memsql-ciab \
        -e LICENSE_KEY=$LICENSE_KEY \
        -e ROOT_PASSWORD=$ROOT_PASSWORD \
        -p 3306:3306 -p 8080:8080 \
        memsql/cluster-in-a-box
    

    Windows

    docker run -i --init `
        --name memsql-ciab `
        -e LICENSE_KEY=%$LICENSE_KEY% `
        -e ROOT_PASSWORD=%$ROOT_PASSWORD% `
        -e START_AFTER_INIT=%$START_AFTER_INIT% `
        -p 3306:3306 -p 8080:8080 `
        memsql/cluster-in-a-box
    

    If initialization fails, you will need to remove the container before retrying.

    docker rm memsql-ciab
    
  3. Start the container.

    docker start memsql-ciab
    

Now that you have MemSQL up and running, learn how to connect to your cluster in the next step.