Giter Site home page Giter Site logo

docker-pxc-5.7's Introduction

Percona XtraDB Cluster Docker

The image contains Percona XtraDB Cluster 5.7 based on CentOS 7.

Usage

  1. Create docker-compose.yml file and configure instance. Example docker-compose file:
version: '2.2'
services:
  db:
    image: "larrabee/percona"
    container_name: "db"
    security_opt:
      - "seccomp:unconfined"
    network_mode: "host"
    ulimits:
      nproc: 65535
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 131072
        hard: 131072
      volumes:
        - "db-data:/var/lib/mysql"
        - "db-backup:/var/lib/mysql-backup"
        - "/etc/pxc/db.cnf:/etc/my.cnf"
        
volumes:
  db-data: {}
  db-backup: {}
  1. Create mysql config file. I recommend to create it in /etc/pxc/db.cnf. Example my.cnf:
[mysqld]
server-id = 1
datadir = /var/lib/mysql
log-error = /var/log/stdout.log
log_output = FILE

wsrep_provider = /usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_address = gcomm://
wsrep_node_name = node1
wsrep_node_address = 192.168.1.2
wsrep_sst_method = xtrabackup-v2
wsrep_sst_auth = "user:password"


pxc_strict_mode = ENFORCING
enforce-gtid-consistency = ON
binlog_format = ROW
default_storage_engine = InnoDB
innodb_file_per_table = 1
innodb_autoinc_lock_mode = 2
  1. Run the image with docker-compose up -d. You can view logs with docker-compose logs -f db.
  2. Change root user password (temporary password showed in the container logs).

Available environment variables

  • MYSQL_CONFIG_FILE is path to my.cnf file. Default is /etc/my.cnf.
  • MYSQL_SKIP_POSITION_RECOVERY is disabling IST recovery and perform full sync (with SST).

You can pass any additional args with docker CMD. Its will append to mysqld.

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.