version: "2"
services:
etcd0:
image: quay.io/coreos/etcd:latest
restart: always
ports:
- 2379:2379
- 2380:2380
- 4001:4001
volumes:
- ./certs/:/srv/
- /srv/docker/etcd:/etcd-data
- /usr/share/ca-certificates/:/etc/ssl/certs
networks:
- network
environment:
ETCD_NAME: node1
ETCD_DATA_DIR: /etcd-data/etcd0.etcd
ETCDCTL_API: 3
ETCD_DEBUG: 1
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd0:2380
ETCD_INITIAL_CLUSTER: node1=http://etcd0:2380
ETCD_INITIAL_CLUSTER_STATE: new
ETCD_INITIAL_CLUSTER_TOKEN: H0bcbBTMh2MDPkXU8ioW
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
ETCD_ADVERTISE_CLIENT_URLS: http://etcd0:2379,http://etcd0:4001
node1:
container_name: node1
restart: always
image: percona/percona-xtradb-cluster:latest
environment:
- CLUSTER_NAME=pxc-cluster01
- MYSQL_ROOT_PASSWORD=s3cr3t
- DISCOVERY_SERVICE=pxc_etcd0_1:2379
- XTRABACKUP_PASSWORD=s3cr3t
networks:
- network
networks:
network:
driver: bridge
$ docker容器日志-f node1
2019-04-26T07:29:43.347857Z 5 [Note] Access denied for user 'monitor'@'localhost' (using password: YES)
2019-04-26T07:29:48.364957Z 6 [Note] Access denied for user 'monitor'@'localhost' (using password: YES)
2019-04-26T07:29:53.429318Z 7 [Note] Access denied for user 'monitor'@'localhost' (using password: YES)
2019-04-26T07:29:58.446057Z 8 [Note] Access denied for user 'monitor'@'localhost' (using password: YES)
2019-04-26T07:30:03.481623Z 9 [Note] Access denied for user 'monitor'@'localhost' (using password: YES)
[...]
$ docker容器日志-f pxc_etcd0_1
2019-04-26 07:46:14.546843 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52082
2019-04-26 07:46:19.580041 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52084
2019-04-26 07:46:24.671394 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52086
2019-04-26 07:46:29.704266 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52088
2019-04-26 07:46:34.721640 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52090
2019-04-26 07:46:39.745445 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52092
2019-04-26 07:46:44.787393 D | etcdserver/api/v2http: [DELETE] /v2/keys/pxc-cluster/pxc-cluster01/172.29.0.3/?recursive=true remote:172.29.0.3:52094
打开无法在其中找到(尝试进行递归搜索)配置文件的外壳程序。