Not the answer you need?
Register and ask your own question!

problem trying to built pxc xtradb cluster 5.6 on docker

xinityxinity EntrantCurrent User Role Beginner
i'm trying to built a pxc cluster 5.6 using docker image: https://hub.docker.com/r/percona/percona-xtradb-cluster/

following tutorial found here : https://www.percona.com/blog/2016/06/10/percona-xtradb-cluster-in-a-multi-host-docker-network/

with a bit of customization using swarm mode

i have a very strange behavior as all nodes register correctly in etcd, but failed to start galera cluster.

Please find attached a log file.

if anyone can point me at some clues to fix this :)

Thanks a lot !

Regards,

Xinity

Comments

  • vadimtkvadimtk Contributor Percona Staff Role
    Hi,

    From logs I see
    2017-03-09 15:35:08 7 [Warning] WSREP: Failed to resolve tcp://10.20.2.8:4567

    so there are some problems with your network.
    Do you start containers in the same network?
    Can you share the command line for docker run ?
  • xinityxinity Entrant Current User Role Beginner
    they all start on the same network yes

    here is the compose file i'm trying to use:
    version: '3'
    services:
    etcd:
    image: quay.io/coreos/etcd
    command: etcd
    volumes:
    - /usr/local/share/ca-certificates/:/etc/ssl/certs
    ports:
    - "4001:4001"
    - "2380:2380"
    - "2379:2379"
    env_file: .env
    networks:
    - internaldbnet
    deploy:
    placement:
    constraints: [node.role == manager]

    proxy:
    image: perconalab/proxysql
    networks:
    - cicd
    - internaldbnet
    ports:
    - "3306:3306"
    - "6032:6032"
    env_file: .env
    deploy:
    mode: replicated
    replicas: 3
    labels: [APP=proxysql]
    # service restart policy
    restart_policy:
    condition: on-failure
    delay: 5s
    max_attempts: 3
    window: 120s
    # service update configuration
    update_config:
    parallelism: 1
    delay: 10s
    failure_action: continue
    monitor: 60s
    max_failure_ratio: 0.3
    # placement constraint - in this case on 'worker' nodes only
    placement:
    constraints: [node.role == worker]
    percona-xtradb-cluster:
    image: percona/percona-xtradb-cluster:5.6
    entrypoint: bash -c "sed -i 's/lib64/lib/g' /etc/mysql/conf.d/node.cnf && /entrypoint.sh"
    networks:
    - internaldbnet
    ports:
    - "3306"
    env_file: .env
    deploy:
    mode: replicated
    replicas: 3
    labels: [APP=pxc]
    # service restart policy
    restart_policy:
    condition: on-failure
    delay: 5s
    max_attempts: 3
    window: 120s
    # service update configuration
    update_config:
    parallelism: 1
    delay: 10s
    failure_action: continue
    monitor: 60s
    max_failure_ratio: 0.3
    # placement constraint - in this case on 'worker' nodes only
    placement:
    constraints: [node.role == worker]
    networks:
    cicd:
    # Use a custom driver
    driver: overlay
    ipam:
    driver: default
    config:
    - subnet: 10.20.1.0/24
    internaldbnet:
    driver: overlay
    ipam:
    driver: default
    config:
    - subnet: 10.20.2.0/24


    Registration in ETCD goes well, but pxc cluster doesn't come up :(
  • vadimtkvadimtk Contributor Percona Staff Role
    I am not quite sure what it the problem here, but it looks like the network issue.

    I would start with simple steps like.
    1. create network
    docker network create net1
    
    2. start the first node (bootstrap the cluster)
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 --net=net1 --name=node1 percona/percona-xtradb-cluster
    
    3. add additional nodes
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 -e CLUSTER_JOIN=node1 --net=net1 percona/percona-xtradb-cluster
    

    then, if this works - add complexity and try network "internaldbnet" with the custom IP addresses.
  • xinityxinity Entrant Current User Role Beginner
    Hi vadimtk,

    thanks a lot for yoru reply, it seems to be related to 5.6 as switching to 5.7 docker image fixes it all :)

    i have another issue, but i will open another thread,

    Thanks again for your precious help,

    Regards,
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.