Giter Club home page Giter Club logo

docker-mariadb-cluster's People

Contributors

ustcweizhou avatar weizhouapache avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-mariadb-cluster's Issues

deploy in swarm with portainer

Hi

at first, this is just the thing that i was looking for, amazing work.

i am trying to deploy with portainer in a 3 nodes docker swarm this solution, i edit the yaml file but i have some errors, i can fix the depends_on but with the external files, i don't know where to push it. i am using deploy stack option.

i have this error:

open /data/compose/24/nginx-galera.conf: no such file or directory

and three questions:

  • can i configure all mysql params with the enviroment variables? or i need others files?
  • why do you choose nginx over proxysql or maxscale solutions?
  • how can i configure mysql backups?
version: "3.8"
services:
  db01:
    image: ustcweizhou/mariadb-cluster:latest
    hostname: db01
    networks:
        overlay-db:
    volumes:
      - ${DATA_DIR}/$PROJECT/db01:/var/lib/mysql
    healthcheck:
        test: ["CMD", "mysqladmin", "-uroot", "-pcloudstack", "ping"]
        interval: 10s
        timeout: 10s
        retries: 60
        start_period: 10s
    environment:
      - NODE_NAME=db01
      - CLUSTER_ADDRESS=gcomm://db01,db02,db03
      - DB_ROOT_PASSWORD=cloudstack
      - DB_MARIABACKUP_PASSWORD=cloudstack
    deploy:
      placement:
        constraints:
          - "node.labels.node==docker1"
  db02:
    image: ustcweizhou/mariadb-cluster:latest
    hostname: db02
    depends_on:
      - db01
    networks:
        overlay-db:
    volumes:
      - ${DATA_DIR}/$PROJECT/db02:/var/lib/mysql
    healthcheck:
        test: ["CMD", "mysqladmin", "-uroot", "-pcloudstack", "ping"]
        interval: 10s
        timeout: 10s
        retries: 60
        start_period: 10s
    environment:
      - NODE_NAME=db02
      - CLUSTER_ADDRESS=gcomm://db01,db02,db03
      - DB_ROOT_PASSWORD=cloudstack
      - DB_MARIABACKUP_PASSWORD=cloudstack
    deploy:
      placement:
        constraints:
          - "node.labels.node==docker2"    
  db03:
    image: ustcweizhou/mariadb-cluster:latest
    hostname: db03
    depends_on:
      - db01 
      - db02
    networks:
        overlay-db:
    volumes:
      - ${DATA_DIR}/$PROJECT/db03:/var/lib/mysql
    environment:
      - NODE_NAME=db03
      - CLUSTER_ADDRESS=gcomm://db01,db02,db03
      - DB_ROOT_PASSWORD=cloudstack
      - DB_MARIABACKUP_PASSWORD=cloudstack
    deploy:
      placement:
        constraints:
          - "node.labels.node==docker3"
  dbvip:
    image: nginx
    hostname: dbvip
    networks:
        overlay-db:
    ports:
        - "13306:3306"
    deploy:
      restart_policy:
        condition: on-failure
    configs:
        - source: nginx-galera
          target: /etc/nginx/nginx.conf
    depends_on:
      - db01

configs:
    nginx-galera:
        file: ./nginx-galera.conf
        
networks:
    overlay-db:
        driver: overlay
        attachable: true
        ipam:
            driver: default
            config:
                - subnet: 192.168.10.0/24

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.