Skip to content

sysC0D/ha-rancher-galera

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

HA Rancher Galera

Consider this a POC and not a production ready system!

Built for use with Docker 17.05.0-ce+ in Swarm Mode

Setup Hosts

Init Swarm Nodes/Cluster

Swarm Master:

docker swarm init

Additional Swarm Node(s):

docker swarm join <MasterNodeIP>:2377 + join-tokens shown at swarm init

To get the tokens at a later time, run docker swarm join-token (manager|worker)

Create Rancher network

Create custom ingress if not exist (for docker >= 17.05.0-ce)

docker network create -d overlay --ingress rancher-ingress

Create custom network

    docker network create -d overlay --opt encrypted rancherntw

Deploy app with Docker-compose

Docker Compose isn't required if you use swarm, if you need version 3 please show docker-compose documentation

docker stack deploy --compose-file docker-compose.yml ha
docker service scale ha_dbcluster=3
docker service scale ha_rancher=2

Verify cluster nodes

Show services

docker stack services ha
ID                  NAME                MODE                REPLICAS            IMAGE                           PORTS
2rnkf52mmd7x        ha_rancher          replicated          2/2                 rancher/server:latest           *:8080->8080/tcp
ism0wiqtgrls        ha_dbcluster        replicated          3/3                 sysc0d/mariadb-cluster:latest

Verify cluster DB

docker exec -it dbcluster.<RN>.<ID> mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 3     |
+--------------------+-------+

About

Dockerized HA Rancher with MariaDB Galera Cluster

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%