|
|
|
@ -19,4 +19,48 @@ apt-get update
|
|
|
|
|
apt-get install mariadb-server
|
|
|
|
|
apt-get clean
|
|
|
|
|
|
|
|
|
|
# Set config like here:
|
|
|
|
|
# https://mariadb.org/installing-mariadb-galera-cluster-on-debian-ubuntu/
|
|
|
|
|
# /etc/mysql/my.cnf
|
|
|
|
|
# =================================================
|
|
|
|
|
[galera]
|
|
|
|
|
# Mandatory settings
|
|
|
|
|
wsrep_on=ON
|
|
|
|
|
wsrep_provider=/usr/lib/galera/libgalera_smm.so
|
|
|
|
|
wsrep_cluster_address="gcomm://10.42.1.171,10.42.1.172,10.42.1.173,10.42.1.174"
|
|
|
|
|
wsrep_cluster_name="XXX"
|
|
|
|
|
binlog_format=row
|
|
|
|
|
default_storage_engine=InnoDB
|
|
|
|
|
innodb_autoinc_lock_mode=2
|
|
|
|
|
wsrep_sst_method=rsync
|
|
|
|
|
query_cache_size=0
|
|
|
|
|
query_cache_type=0
|
|
|
|
|
#
|
|
|
|
|
# Allow server to accept connections on all interfaces.
|
|
|
|
|
#
|
|
|
|
|
bind-address=10.42.1.174
|
|
|
|
|
#
|
|
|
|
|
# Optional setting
|
|
|
|
|
#wsrep_slave_threads=1
|
|
|
|
|
#innodb_flush_log_at_trx_commit=0
|
|
|
|
|
|
|
|
|
|
# =================================================
|
|
|
|
|
|
|
|
|
|
service mysql stop
|
|
|
|
|
# on just sql1:
|
|
|
|
|
galera_new_cluster
|
|
|
|
|
|
|
|
|
|
# See if the cluster node comes up:
|
|
|
|
|
mysql -p -u root -e 'SELECT VARIABLE_VALUE as "cluster size" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME="wsrep_cluster_size"'
|
|
|
|
|
|
|
|
|
|
# Start another node, sql2:
|
|
|
|
|
service mysql start
|
|
|
|
|
|
|
|
|
|
# See if it came up:
|
|
|
|
|
mysql -p -u root -e 'SELECT VARIABLE_VALUE as "cluster size" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME="wsrep_cluster_size"'
|
|
|
|
|
|
|
|
|
|
# Then do sql3 sql4
|
|
|
|
|
service mysql start
|
|
|
|
|
|
|
|
|
|
# See if it came up:
|
|
|
|
|
mysql -p -u root -e 'SELECT VARIABLE_VALUE as "cluster size" FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME="wsrep_cluster_size"'
|
|
|
|
|