version: '2' services: node1-mariadb: image: hauptmedia/mariadb:10.1 hostname: node1-mariadb container_name: node1-mariadb environment: MYSQL_ROOT_PASSWORD: 'iamgroot' REPLICATION_PASSWORD: 'iamgroot' GALERA: 'On' NODE_NAME: node1-mariadb CLUSTER_NAME: maria_cluster CLUSTER_ADDRESS: gcomm:// TZ : 'Asia/Seoul' ports: - 13306:3306/tcp volumes: - /data/someone/mariadb/galeranode1/mariadb:/var/lib/mysql - /data/someone/mariadb/sqldir:/docker-entrypoint-initdb.d command: --wait_timeout=28800 --character-set-server=utf8 --collation-server=utf8_general_ci --max-allowed-packet=512M --net-buffer-length=5048576 --wsrep-new-cluster stdin_open: true tty: true privileged: true ulimits: nofile: soft: 600000 hard: 640000 labels: io.rancher.scheduler.affinity:host_label: labelkey1=labelkvalue1 io.rancher.container.pull_image: always node2-mariadb: image: hauptmedia/mariadb:10.1 hostname: node2-mariadb container_name: node2-mariadb links: - node1-mariadb environment: REPLICATION_PASSWORD: 'iamgroot' GALERA: 'On' NODE_NAME: node2-mariadb CLUSTER_NAME: maria_cluster CLUSTER_ADDRESS: gcomm://node1-mariadb TZ : 'Asia/Seoul' ports: - 23306:3306/tcp volumes: - /data/someone/galeranode2/mariadb:/var/lib/mysql command: --wait_timeout=28800 --character-set-server=utf8 --collation-server=utf8_general_ci --max-allowed-packet=512M --net-buffer-length=5048576 stdin_open: true tty: true privileged: true depends_on: - node1-mariadb ulimits: nofile: soft: 600000 hard: 640000 labels: io.rancher.scheduler.affinity:host_label: labelkey2=labelkvalue2 io.rancher.container.pull_image: always node3-mariadb: image: hauptmedia/mariadb:10.1 hostname: node3-mariadb container_name: node3-mariadb links: - node1-mariadb environment: REPLICATION_PASSWORD: 'iamgroot' GALERA: 'On' NODE_NAME: node3-mariadb CLUSTER_NAME: maria_cluster CLUSTER_ADDRESS: gcomm://node1-mariadb TZ : 'Asia/Seoul' ports: - 33306:3306/tcp volumes: - /data/someone/galeranode3/mariadb:/var/lib/mysql command: --wait_timeout=28800 --character-set-server=utf8 --collation-server=utf8_general_ci --max-allowed-packet=512M --net-buffer-length=5048576 stdin_open: true tty: true privileged: true depends_on: - node1-mariadb - node2-mariadb labels: io.rancher.scheduler.affinity:host_label: labelkey3=labelkvalue3 io.rancher.container.pull_image: always