Giter Site home page Giter Site logo

jnidzwetzki / mysql-ha-cloud Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 16.0 970 KB

This container image provides a highly available and replicated MySQL installation in Kubernetes or Docker Swarm. Consul, ProxySQL, and XtraBackup are used for leader election, load distribution, and backups.

License: Apache License 2.0

Shell 0.30% Python 99.70%
cluster consul docker docker-swarm high-availability kubernetes mysql mysql-replication

mysql-ha-cloud's Issues

ProxySQL Error

Hi,

I have completed the installation, but when I want to connect to mysql, I encounter such an error.

[28000][1045] ProxySQL Error: Access denied for user 'mau'@'10.0.0.2' (using password: YES)

version: "3.8"

networks:
  backend:

volumes:
  backup-volume:

services:
  consul:
    image: consul:1.9
    networks:
       backend:
          aliases:
             - consul_cluster
    environment:
      - CONSUL_BIND_INTERFACE=eth0
    command: agent -ui -data-dir /consul/data -server -client 0.0.0.0 -retry-join consul_cluster -bootstrap-expect=3 
    deploy:
      replicas: 3
      endpoint_mode: dnsrr
      placement:
        max_replicas_per_node: 1
      update_config:
        parallelism: 1
        delay: 60s
      restart_policy:
        condition: on-failure
    ports:
       - target: 8500
         published: 8500
         protocol: tcp
         mode: host

  mysql:
    image: jnidzwetzki/mysql-ha-cloud:latest
    networks:
       backend:
    environment:
      - CONSUL_BIND_INTERFACE=eth1
      - CONSUL_BOOTSTRAP_SERVER=consul_cluster
      - MINIO_ACCESS_KEY=minio
      - MINIO_SECRET_KEY=4SrSScTuXBmP#@uV5gnE4*M4%
      - MINIO_URL=http://10.20.0.9:9009
      - MCM_BIND_INTERFACE=eth1
      - MYSQL_ROOT_PASSWORD=1qazcde3
      - MYSQL_BACKUP_USER=mbu
      - MYSQL_BACKUP_PASSWORD=1qazcde3
      - MYSQL_REPLICATION_USER=mru
      - MYSQL_REPLICATION_PASSWORD=1qazcde3
      - MYSQL_APPLICATION_USER=mau
      - MYSQL_APPLICATION_PASSWORD=1qazcde3
    deploy:
      replicas: 3
      placement:
        max_replicas_per_node: 1
      update_config:
        parallelism: 1
        delay: 60s
      restart_policy:
        condition: on-failure
    ports:
      - 6032:6032
      - 3306:6033

  minio:
    image: minio/minio:RELEASE.2020-10-18T21-54-12Z
    networks:
       backend:
          aliases:
             - minio_endpoint
    volumes:
       - backup-volume:/data
    ports:
       - 9009:9000
    environment:
       - MINIO_ACCESS_KEY=minio
       - MINIO_SECRET_KEY=4SrSScTuXBmP#@uV5gnE4*M4%
    command: server /data

rpc error making call: invalid session

Hi,
after restart the docker swarm, im getting an error message. Could you give me a hint, how to fix this

 Renaming database file /var/lib/proxysql/proxysql.db
 2021-03-21 04:04:36 [INFO] Using OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019
 2021-03-21 04:04:36 [INFO] No SSL keys/certificates found in datadir (/var/lib/proxysql). Generating new keys/certificates.
 2021-03-21 04:04:37,010 INFO root Starting MySQL
 Logging to '/var/lib/mysql/ce864ecd723d.err'.
 2021-03-21T04:04:37.194010Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
 2021-03-21 04:04:39,053 INFO root Performing initial ProxySQL setup
     2021-03-21T04:04:39.419Z [ERROR] agent.client: RPC failed to server: method=KVS.Apply server=10.0.8.10:8300 error="rpc error making call: rpc error making call: invalid session "5125b25b-7477-ba31-0885-b227fcad7698""
     2021-03-21T04:04:39.420Z [ERROR] agent.http: Request error: method=PUT url=/v1/kv/mcm/instances/10.0.8.159?acquire=5125b25b-7477-ba31-0885-b227fcad7698 from=127.0.0.1:55222 error="rpc error making call: rpc error making call: invalid session "5125b25b-7477-ba31-0885-b227fcad7698""
 Traceback (most recent call last):
   File "./mysql_cluster_manager.py", line 46, in <module>
     Actions.join_or_bootstrap()
   File "/cluster/mcm/actions.py", line 86, in join_or_bootstrap
     server_id=server_id)
   File "/cluster/mcm/consul.py", line 250, in register_node
     put_result = self.client.kv.put(path, json_string, acquire=self.node_health_session)
   File "/usr/local/lib/python3.7/dist-packages/consul/base.py", line 3069, in put
     params=params, headers=headers, data=value)
   File "/usr/local/lib/python3.7/dist-packages/consul/std.py", line 39, in put
     timeout=self.timeout)))
   File "/usr/local/lib/python3.7/dist-packages/consul/base.py", line 249, in cb
     CB._status(response, allow_404=allow_404)
   File "/usr/local/lib/python3.7/dist-packages/consul/base.py", line 212, in _status
     raise ConsulException("%d %s" % (response.code, response.body))
 consul.base.ConsulException: 500 rpc error making call: rpc error making call: invalid session "5125b25b-7477-ba31-0885-b227fcad7698"

Thanks

Persistence

Hi.
I'm quite new to docker, I'm trying to implement your solution but I'm facing some problems.

How can I add persistence to your mysql-cluster. I have a NFS server shared over the docker hosts but I don't know how to modify your yml (even if I can do it...)

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.