Skip to main content

Quick Deployment in a Docker Container

Prerequisites

The image of StoneDB is downloaded from Docker Hub. You can read the Dockerhub documentation, which must be up to date. Docker Hub

Procedure

The username and password for login are root. The password is customized by yourself.

Make sure your CPU supports AVX

cat /proc/cpuinfo |grep avx

1. Pull the image

Run the following command:

docker pull stoneatom/stonedb:v1.0.4

2. Run the image

Run the following command:

docker run -p 3306:3306 -itd -v $YOU_DATA_DIR:/opt -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD' stoneatom/stonedb:v1.0.4

Altenatively, run the following command:

docker run -p 3306:3306 -itd  -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD'  stoneatom/stonedb:v1.0.4

Parameter description:

  • -p: maps ports in the Port of the host:Port of the container format.
  • -v: mounts directories in the Path in the host:Path in the container format. If no directories ae mounted, the container will be initialized.
  • -i: the interaction.
  • -t: the terminal.
  • -d: Do not enter the container upon startup. If you want to enter the container upon startup, run the docker exec command.

3. Log in to StoneDB in the container

# Obtain the Docker container ID.
docker ps
# Use the "cocker ps" command to obtain the container ID and enter the Docker container.
docker exec -it <Container ID> bash

<Container ID>$ /opt/stonedb57/install/bin/mysql -uroot -p$YOU_PASSWORD

4. Log in to StoneDB using a third-party tool

You can log in to StoneDB by using third-party tools such as mysql, Navicat, and DBeaver. The following code uses mysql as an example.

mysql -h<Host IP address> -uroot -p$YOU_PASSWORD -P<Mapped port of the host>