Generic Docker base image for ClusterControl
100K+
A base Docker image tailored for ClusterControl usage. It automatically configures passwordless SSH from ClusterControl container during startup, allowing ClusterControl to automate/control/manage/deploy database instances seamlessly.
To get the image, simply:
$ docker pull severalnines/centos-ssh
The image consists of:
Requirement
Once the requirement is satisfied, to run the container, the simplest command would be:
$ docker run -d \
--link clustercontrol:clustercontrol \
-e AUTO_DEPLOYMENT=0 \
severalnines/centos-ssh
More under Examples further down.
To build the image, download the repository at our Github repository:
$ git clone https://github.com/severalnines/docker-centos-ssh
$ cd docker-centos-ssh
$ docker build --rm -t severalnines/centos-ssh .
CC_HOST={string}
CC_HOST port 80 using curl to download the SSH key and register itself to CMON database if AUTO_DEPLOYMENT is on via mysql client.$CLUSTERCONTROL_PORT_80_TCP_ADDR. Thus, linking through --link is also supported.CC_HOST=10.10.10.14AUTO_DEPLOYMENT={boolean integer}
CC_HOST and skip registering it in the CMON database. Without this registration, ClusterControl won't be able to "see" the container for automatic deployment.CLUSTER_NAME, CLUSTER_TYPE, INITIAL_CLUSTER_SIZE, VENDOR, PROVIDER_VERSION, DB_ROOT_PASSWORDAUTO_DEPLOYMENT=0CMON_PASSWORD={string}
CMON_PASSWORD=cmonP4s5CLUSTER_NAME={string}
CLUSTER_NAME=My_Super_Cluster_on_DockerCLUSTER_TYPE={string}
galera and replication (experimental).CLUSTER_TYPE=galeraINITIAL_CLUSTER_SIZE={integer}
INITIAL_CLUSTER_SIZE=5VENDOR={string}
percona. Other supported values are mariadb, codership and oracle.VENDOR=mariadbPROVIDER_VERSION={string}
PROVIDER_VERSION=10.1DB_ROOT_PASSWORD={string}
DB_ROOT_PASSWORD=MyS3cr3tOnly Galera cluster is supported in automatic deployment at the moment. We are going to support more clusters in the near future. The following shows how we can deploy a Galera Cluster automatically, which means you only need to execute the 'docker run' commands and wait until the deployment completes.
docker run -d --name clustercontrol -p 5000:80 severalnines/clustercontrol
CC_HOST is the ClusterControl container's IP):# find the ClusterControl container's IP address
CC_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' clustercontrol)
docker run -d --name galera1 -p 6661:3306 -e CC_HOST=${CC_IP} -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
docker run -d --name galera2 -p 6662:3306 -e CC_HOST=${CC_IP} -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
docker run -d --name galera3 -p 6663:3306 -e CC_HOST=${CC_IP} -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
Container linking is also supported (assume the ClusterControl container name is 'clustercontrol'):
docker run -d --name galera1 -p 6661:3306 --link clustercontrol:clustercontrol -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
docker run -d --name galera2 -p 6662:3306 --link clustercontrol:clustercontrol -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
docker run -d --name galera3 -p 6663:3306 --link clustercontrol:clustercontrol -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
In Docker Swarm mode, centos-ssh will default to look for 'cc_clustercontrol' as the CC_HOST. If you create the ClusterControl container with 'cc_clustercontrol' as the service name, you can skip defining CC_HOST.
Log into ClusterControl UI at http://{docker-host}:5000/clustercontrol to monitor the deployment progress under Activity -> Jobs.
To scale up, just run new containers and ClusterControl will add them into the cluster automatically:
docker run -d --name galera4 -p 6664:3306 --link clustercontrol:clustercontrol -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
docker run -d --name galera5 -p 6665:3306 --link clustercontrol:clustercontrol -e CLUSTER_TYPE=galera -e CLUSTER_NAME=mygalera -e INITIAL_CLUSTER_SIZE=3 severalnines/centos-ssh
Manual deployment allows user to have better control on the deployment process initiates by ClusterControl. All supported database cluster can be deployed using this method. The following shows deployment of 4-node MySQL Replication (1 master + 3 slaves) with 1-node ProxySQL instance on a standalone Docker.
docker run -d --name clustercontrol -p 5000:80 severalnines/clustercontrol
docker run -d --name=master -v /storage/master/datadir:/var/lib/mysql -p 6000:3306 --link clustercontrol:clustercontrol -e AUTO_DEPLOYMENT=0 severalnines/centos-ssh
docker run -d --name=slave1 -v /storage/slave1/datadir:/var/lib/mysql -p 6001:3306 --link clustercontrol:clustercontrol -e AUTO_DEPLOYMENT=0 severalnines/centos-ssh
docker run -d --name=slave2 -v /storage/slave2/datadir:/var/lib/mysql -p 6002:3306 --link clustercontrol:clustercontrol -e AUTO_DEPLOYMENT=0 severalnines/centos-ssh
docker run -d --name=slave3 -v /storage/slave3/datadir:/var/lib/mysql -p 6003:3306 --link clustercontrol:clustercontrol -e AUTO_DEPLOYMENT=0 severalnines/centos-ssh
SSH User: root
SSH Key Path: /root/.ssh/id_rsa
SSH port: 22
Cluster Name: {Your cluster name} -- click Continue --
Vendor: Oracle
Root Password: {Your MySQL root password} -- click Continue --
Master A - IP/Hostname: {Enter master's container IP address. Use 'docker inspect' or look into 'docker logs master | grep CONTAINER_IP'}
Slave 1: {Enter slave1's container IP address. Use 'docker inspect' or look into 'docker logs slave1 | grep CONTAINER_IP'}
Slave 2: {Enter slave2's container IP address. Use 'docker inspect' or look into 'docker logs slave2 | grep CONTAINER_IP'}
Slave 3: {Enter slave3's container IP address. Use 'docker inspect' or look into 'docker logs slave3 | grep CONTAINER_IP'} -- Click Deploy --
Wait for a couple of minutes until the deployment succeeds. Once done, you will have a MySQL replication cluster consists of 1 master, and 3 slaves.
$ docker run -d --name proxysql1 -p 7001:6033 --link clustercontrol:clustercontrol -e AUTO_DEPLOYMENT=0 severalnines/centos-ssh
Then go to ClusterControl -> choose the cluster -> Add Load Balancer -> ProxySQL. Enter the required information:
To scale down, you can just simply remove the node from ClusterControl (under Nodes tab), and then remove the container from Docker via docker rm command.
Please report bugs, improvements or suggestions via our support channel: https://support.severalnines.com
If you have any questions, you are welcome to get in touch via our contact us page or email us at [email protected].
Content type
Image
Digest
Size
124.2 MB
Last updated
about 9 years ago
docker pull severalnines/centos-ssh