Here is my first node logs
2024-05-02T14:10:34.068419Z 1 [Note] [MY-000000] [WSREP] Server status change connected → joiner
2024-05-02T14:10:34.068506Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:10:34.068571Z 1 [Note] [MY-000000] [WSREP] Server status change joiner → initializing
2024-05-02T14:10:34.068604Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:10:34.074339Z 3 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-02T14:10:34.396299Z 3 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-02T14:10:34.541257Z 3 [Note] [MY-000000] [WSREP] wsrep_init_schema_and_SR (nil)
2024-05-02T14:10:34.551171Z 3 [System] [MY-000000] [WSREP] PXC upgrade completed successfully
2024-05-02T14:10:34.667864Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/lib/mysql’ in the path is accessible to all OS users. Consider choosing a different directory.
2024-05-02T14:10:34.701408Z 0 [Note] [MY-000000] [WSREP] Initialized wsrep sidno 2
2024-05-02T14:10:34.701851Z 0 [Note] [MY-000000] [Galera] Server initialized
2024-05-02T14:10:34.702293Z 0 [Note] [MY-000000] [WSREP] Server status change initializing → initialized
2024-05-02T14:10:34.702696Z 0 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:10:34.703178Z 1 [Note] [MY-000000] [Galera] Bootstrapping a new cluster, setting initial position to 00000000-0000-0000-0000-000000000000:-1
2024-05-02T14:10:34.707109Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.36-28.1’ socket: ‘/tmp/mysql.sock’ port: 3306 Percona XtraDB Cluster (GPL), Release rel28, Revision bfb687f, WSREP version 26.1.4.3.
2024-05-02T14:10:34.707559Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/lib/mysql/mysqlx.sock
2024-05-02T14:10:34.708499Z 8 [Note] [MY-000000] [WSREP] Recovered cluster id b3071dca-088d-11ef-b4ee-3e8bf9d03234
2024-05-02T14:10:34.709898Z 1 [Note] [MY-000000] [WSREP] Server status change initialized → joined
2024-05-02T14:10:34.710296Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:10:34.710674Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:10:34.714839Z 11 [Note] [MY-000000] [WSREP] Starting applier thread 11
2024-05-02T14:10:34.715643Z 1 [Note] [MY-000000] [Galera] Recording CC from group: 24
2024-05-02T14:10:34.716060Z 1 [Note] [MY-000000] [Galera] Lowest cert index boundary for CC from group: 24
2024-05-02T14:10:34.716498Z 1 [Note] [MY-000000] [Galera] Min available from gcache for CC from group: 1
2024-05-02T14:10:34.716962Z 1 [Note] [MY-000000] [Galera] Server server-1 synced with group
2024-05-02T14:10:34.717357Z 1 [Note] [MY-000000] [WSREP] Server status change joined → synced
2024-05-02T14:10:34.717753Z 1 [Note] [MY-000000] [WSREP] Synchronized with group, ready for connections
2024-05-02T14:10:34.718143Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
docker exec -it percona-dockercompose-percona-1 mysql -uroot -p’rootpassword’ -e “SHOW STATUS LIKE ‘wsrep_cluster_size’;”
mysql: [Warning] Using a password on the command line interface can be insecure.
±-------------------±------+
| Variable_name | Value |
±-------------------±------+
| wsrep_cluster_size | 1 |
±-------------------±------+
and here is second
2024-05-02T14:11:27.209778Z 1 [Note] [MY-000000] [WSREP] Server status change connected → joiner
2024-05-02T14:11:27.209834Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:11:27.209899Z 1 [Note] [MY-000000] [WSREP] Server status change joiner → initializing
2024-05-02T14:11:27.212486Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:11:27.217770Z 3 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-02T14:11:27.563746Z 3 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-02T14:11:27.704162Z 3 [Note] [MY-000000] [WSREP] wsrep_init_schema_and_SR (nil)
2024-05-02T14:11:27.713582Z 3 [System] [MY-000000] [WSREP] PXC upgrade completed successfully
2024-05-02T14:11:27.832412Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/lib/mysql’ in the path is accessible to all OS users. Consider choosing a different directory.
2024-05-02T14:11:27.856204Z 0 [Note] [MY-000000] [WSREP] Initialized wsrep sidno 2
2024-05-02T14:11:27.856611Z 0 [Note] [MY-000000] [Galera] Server initialized
2024-05-02T14:11:27.856993Z 0 [Note] [MY-000000] [WSREP] Server status change initializing → initialized
2024-05-02T14:11:27.857385Z 0 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:11:27.857793Z 1 [Note] [MY-000000] [Galera] Bootstrapping a new cluster, setting initial position to 00000000-0000-0000-0000-000000000000:-1
2024-05-02T14:11:27.861610Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.36-28.1’ socket: ‘/tmp/mysql.sock’ port: 3306 Percona XtraDB Cluster (GPL), Release rel28, Revision bfb687f, WSREP version 26.1.4.3.
2024-05-02T14:11:27.862120Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/lib/mysql/mysqlx.sock
2024-05-02T14:11:27.862819Z 8 [Note] [MY-000000] [WSREP] Recovered cluster id d2330df8-088d-11ef-a2e6-6b2f64ddc605
2024-05-02T14:11:27.864156Z 1 [Note] [MY-000000] [WSREP] Server status change initialized → joined
2024-05-02T14:11:27.864525Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:11:27.864882Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:11:27.868868Z 11 [Note] [MY-000000] [WSREP] Starting applier thread 11
2024-05-02T14:11:27.869565Z 1 [Note] [MY-000000] [Galera] Recording CC from group: 24
2024-05-02T14:11:27.869929Z 1 [Note] [MY-000000] [Galera] Lowest cert index boundary for CC from group: 24
2024-05-02T14:11:27.870299Z 1 [Note] [MY-000000] [Galera] Min available from gcache for CC from group: 1
2024-05-02T14:11:27.870745Z 1 [Note] [MY-000000] [Galera] Server server-3 synced with group
2024-05-02T14:11:27.871086Z 1 [Note] [MY-000000] [WSREP] Server status change joined → synced
2024-05-02T14:11:27.871431Z 1 [Note] [MY-000000] [WSREP] Synchronized with group, ready for connections
2024-05-02T14:11:27.871802Z 1 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification.
2024-05-02T14:13:00.396566Z 12 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ‘‘mysql_native_password’ is deprecated and will be removed in a future release. Please use caching_sha2_password instead’
mbind: Operation not permitted
^C
root@server-3:/home/slave1/Percona-DockerCompose# docker exec -it percona-dockercompose-percona-1 mysql -uroot -p’rootpassword’ -e “SHOW STATUS LIKE ‘wsrep_cluster_size’;”
mysql: [Warning] Using a password on the command line interface can be insecure.
±-------------------±------+
| Variable_name | Value |
±-------------------±------+
| wsrep_cluster_size | 1 |
±-------------------±------+
here is my first node cluseter configuration
docker-compose.yml
version: ‘3.9’
services:
percona:
image: percona/percona-xtradb-cluster:8.0
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- CLUSTER_NAME=pxc-cluster
- XTRABACKUP_PASSWORD=backuppassword
- MYSQL_DATABASE=exampledb
- MYSQL_USER=exampleuser
- MYSQL_PASSWORD=examplepass
command:
- --wsrep-new-cluster
volumes:
- ./data:/var/lib/mysql
- ./custom.cnf:/etc/mysql/percona-xtradb-cluster.conf.d/custom.cnf
network_mode: host
restart: always
cat custom.cnf
[mysqld]
server-id=1
wsrep_provider=/usr/lib/galera4/libgalera_smm.so
wsrep_on=ON
wsrep_cluster_name=“pxc-cluster”
wsrep_cluster_address=“gcomm://172.31.60.117,172.31.60.118,172.31.60.119”
wsrep_node_address=“172.31.60.117”
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=“xtrabackup:backuppassword”
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
wsrep_node_name=“percona-cluster-db1”
bind-address = 0.0.0.0
pxc_strict_mode=ENFORCING
binlog_format=ROW
and here is my second node configuration
docker-compose.yml
version: ‘3.9’
services:
percona:
image: percona/percona-xtradb-cluster:8.0
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- CLUSTER_NAME=pxc-cluster
- XTRABACKUP_PASSWORD=backuppassword
- MYSQL_DATABASE=exampledb
- MYSQL_USER=exampleuser
- MYSQL_PASSWORD=examplepass
volumes:
- ./data:/var/lib/mysql
- ./custom.cnf:/etc/mysql/percona-xtradb-cluster.conf.d/custom.cnf
network_mode: host
restart: always
custom.cnf
[mysqld]
server-id=2
wsrep_provider=/usr/lib/galera4/libgalera_smm.so
wsrep_on=ON
wsrep_cluster_name=“pxc-cluster”
wsrep_cluster_address=“gcomm://172.31.60.117,172.31.60.118,172.31.60.119”
wsrep_node_address=“172.31.60.119”
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=“xtrabackup:backuppassword”
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
wsrep_node_name=“percona-cluster-db2”
bind-address = 0.0.0.0
host_cache_size = 0
wsrep_applier_threads = 2
pxc_strict_mode=ENFORCING
binlog_format=ROW
why my nodes are not join each other?!they are on same vlan! and there isnt any firewall or iptables between them!they are on labratoar machines!
also my nc from both node the ports 4568 and 4444 are closed
nc -zv 172.31.60.119 3306 4567 4568 4444
Connection to 172.31.60.119 3306 port [tcp/mysql] succeeded!
Connection to 172.31.60.119 4567 port [tcp/*] succeeded!
nc: connect to 172.31.60.119 port 4568 (tcp) failed: Connection refused
nc: connect to 172.31.60.119 port 4444 (tcp) failed: Connection refused
for example from first node to second node!