Commit bae237e2 authored by Ranadeep Biswas's avatar Ranadeep Biswas
Browse files

Docker files

parent c6cac819
version: '3'
services:
n1:
image: erkules/galera
container_name: dbcop-n1
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://"]
hostname: n1
networks:
dbcop-net:
ipv4_address: 172.18.0.11
n2:
image: erkules/galera
container_name: dbcop-n2
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://n1"]
links: [n1]
hostname: n2
networks:
dbcop-net:
ipv4_address: 172.18.0.12
n3:
image: erkules/galera
container_name: dbcop-n3
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://n1"]
links: [n1]
hostname: n3
networks:
dbcop-net:
ipv4_address: 172.18.0.13
n4:
image: erkules/galera
container_name: dbcop-n4
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://n1"]
links: [n1]
hostname: n4
networks:
dbcop-net:
ipv4_address: 172.18.0.14
n5:
image: erkules/galera
container_name: dbcop-n5
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://n1"]
links: [n1]
hostname: n5
networks:
dbcop-net:
ipv4_address: 172.18.0.15
n6:
image: erkules/galera
container_name: dbcop-n6
command: ["--wsrep-cluster-name=local-test", "--wsrep-cluster-address=gcomm://n1"]
links: [n1]
hostname: n6
networks:
dbcop-net:
ipv4_address: 172.18.0.16
networks:
dbcop-net:
driver: bridge
ipam:
config:
- subnet: 172.18.0.0/16
FROM base/archlinux
RUN pacman -Syu --noconfirm
RUN pacman -S base-devel --noconfirm
RUN pacman -S galera rsync lsof --noconfirm
RUN pacman -S iproute2 --noconfirm
RUN mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
RUN sed -e 's|wsrep_provider=.*|wsrep_provider=/usr/lib64/libgalera_smm.so|g' /etc/mysql/wsrep.cnf >> /etc/mysql/my.cnf
COPY mysql_first_time.sql '/tmp/mysql-first-time.sql'
EXPOSE 3306
ENTRYPOINT ["mysqld_safe", "--init-file=/tmp/mysql-first-time.sql"]
-- What's done in this file shouldn't be replicated
-- or products like mysql-fabric won't work
SET @@SESSION.SQL_LOG_BIN=0;
DELETE FROM mysql.user ;
CREATE USER 'root'@'%' IDENTIFIED BY '' ;
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;
DROP DATABASE IF EXISTS test ;
FLUSH PRIVILEGES ;
version: "3.7"
services:
parent:
image: galera:arch
command: ["--wsrep-node-name=dbcop-test", "--wsrep-cluster-address=gcomm://"]
hostname: parent
child:
image: galera:arch
depends_on:
- parent
command: ["--wsrep-node-name=dbcop-test", "--wsrep-cluster-address=gcomm://parent"]
deploy:
replicas: 4
version: "3.7"
services:
parent:
image: erkules/galera
command: ["--wsrep-node-name=dbcop-test", "--wsrep-cluster-address=gcomm://"]
hostname: parent
child:
image: erkules/galera
depends_on:
- parent
command: ["--wsrep-node-name=dbcop-test", "--wsrep-cluster-address=gcomm://parent"]
deploy:
replicas: 4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment