# 아래 내용 추가
[server]
port=3306
datadir=$MYSQL/$TARGET/$DIR
socket=/var/lib/mysql/mysql.sock
transaction-isolation=READ-COMMITTED
symbolic-links=0
key_buffer_size=32M
max_allowed_packet=32M
thread_stack=256K
thread_cache_size=64
query_cache_limit=8M
query_cache_size=64M
query_cache_type=1
max_connections=1024
read_buffer_size=2M
read_rnd_buffer_size=16M
sort_buffer_size=8M
join_buffer_size=8M
character-set-server=utf8
collation-server=utf8_general_ci
#innnoDB
innodb_file_per_table=1
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size=64M
innodb_buffer_pool_size=4G
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT
innodb_log_file_size=512M
innodb_file_format=barracuda
innodb_large_prefix=on
#RMS (function, trigger 생성에 대한 제약 강제)
log_bin_trust_function_creators=1
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
[server]
port=3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
transaction-isolation=READ-COMMITTED
symbolic-links=0
key_buffer_size=32M
max_allowed_packet=32M
thread_stack=256K
thread_cache_size=64
query_cache_limit=8M
query_cache_size=64M
query_cache_type=1
max_connections=1024
read_buffer_size=2M
read_rnd_buffer_size=16M
sort_buffer_size=8M
join_buffer_size=8M
character-set-server=utf8
collation-server=utf8_general_ci
#innnoDB
innodb_file_per_table=1
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size=64M
innodb_buffer_pool_size=4G
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT
innodb_log_file_size=512M
innodb_file_format=barracuda
innodb_large_prefix=on
#RMS (function, trigger 생성에 대한 제약 강제)
log_bin_trust_function_creators=1
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
# this is only for the mysqld standalone daemon
[mysqld]
#
# * Galera-related settings
#
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="galera_cluster"
wsrep_cluster_address="gcomm://cdpm01.coxspace.biz,cdpm02.coxspace.biz,cdpm03.coxspace.biz"
#wsrep_sst_method=rsync
wsrep_node_address="cdpm01.coxspace.biz"
wsrep_node_name="cdpm01.coxspace.biz"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.2 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.2]
mkdir /var/run/mariadb
chown -R mysql:mysql /var/run/mariadb
# 마스터 노드에서
galera_new_cluster
# 나머지 노드에서
systemctl start mariadb
show status like 'wsrep_cluster_size'
mariadb 서비스가 enable 일 경우 서버가 실행되면서 자동으로 cluster에 연결된다.
SET GLOBAL wsrep_provider_options='pc.bootstrap=YES';