[root@192.168.1.100:~]$ docker logs -f demo-3330
==================================== Auto-join Galera Cluster =======================================
>> Can't found any activated node, It's maybe the first one, just start without join_address.
==================================== Initialization Infomation =======================================
cluster_name: demo
current_node: 192.168.1.100:3310
cluster_members: 192.168.1.100:3310,192.168.1.101:3310,192.168.1.102:3310
>> Start initialize configuration (Touch the file /data/mariadb-galera/lock/global.lock can skiped).
set pid_file=/data/mariadb-galera/lock/mysqld.pid
set max_connections=500
set log_error=/data/mariadb-galera/logs/error.log
set port=3310
set innodb_buffer_pool_size=2867M
set slow_query_log_file=/data/mariadb-galera/logs/slow.log
set datadir=/data/mariadb-galera/data
set innodb_log_file_size=573M
set report_host=192.168.1.100:3310
set server_id=1100
=================================== MySQL Daemon Runing Infomation ===================================
>> initializing database
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h 192.168.1.100 password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
>> database initialized
>> Found the galera configuration, waiting for mysql really start
>> mysql init process in progress...
2019-06-17 11:42:53 0 [Note] mysqld (mysqld 10.3.12-MariaDB-log) starting as process 224 ...
>> WARNNING: password for root is Empty, not recommended!
/docker-entrypoint.sh: ignoring /data/mariadb-galera/initdb.d/*
>> mysql init process done. ready for start up.
190617 11:42:57 mysqld_safe Logging to '/data/mariadb-galera/logs/error.log'.
190617 11:42:57 mysqld_safe Starting mysqld daemon with databases from /data/mariadb-galera/data
[root@192.168.1.101:~]$ docker logs -f demo-3330
==================================== Auto-join Galera Cluster =======================================
>> 192.168.1.102 is not ready, retry check...
>> 192.168.1.100 is not ready, retry check...
>> 192.168.1.102 is not ready, retry check...
>> 192.168.1.100 is not ready, retry check...
>> 192.168.1.102 is not ready, retry check...
>> 192.168.1.100 is not ready, retry check...
>> 192.168.1.102 is not ready, retry check...
>> 192.168.1.100 is ready, start join cluster
==================================== Initialization Infomation =======================================
cluster_name: demo
current_node: 192.168.1.101:3310
cluster_members: 192.168.1.100:3310,192.168.1.101:3310,192.168.1.102:3310
>> Start initialize configuration (Touch the file /data/mariadb-galera/lock/global.lock can skiped).
set pid_file=/data/mariadb-galera/lock/mysqld.pid
set max_connections=500
set log_error=/data/mariadb-galera/logs/error.log
set port=3310
set innodb_buffer_pool_size=2867M
set slow_query_log_file=/data/mariadb-galera/logs/slow.log
set datadir=/data/mariadb-galera/data
set innodb_log_file_size=573M
set report_host=192.168.1.101:3310
set server_id=1101
=================================== MySQL Daemon Runing Infomation ===================================
>> initializing database
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h 192.168.1.101 password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
>> database initialized
190617 11:43:04 mysqld_safe Logging to '/data/mariadb-galera/logs/error.log'.
190617 11:43:04 mysqld_safe Starting mysqld daemon with databases from /data/mariadb-galera/data
三个节点都启动成功后,可以执行如下命令查看集群状态(用户名、密码与启动参数一致):
1
mysql -h192.168.1.100 -P3310 -udemo -p123456 -e "show status like '%wsrep%'"
# put some custom configuration in this file can change zhe container by yourself.# Usage:# export cluster_name=new_cluster_name# unset node2#exportmy_tmp_table_size=256M