Merge branch '2.1' into 2.2

This commit is contained in:
Markus Mäkelä
2017-12-12 13:23:02 +02:00
97 changed files with 5945 additions and 361 deletions

View File

@ -205,7 +205,6 @@ int main(int argc, char** argv)
test.maxscales->connect_maxscale(0);
test.repl->connect();
test.tprintf("Testing column-wise binding with a direct connection");
test.add_result(bind_by_column(test.repl->nodes[0]), "Bulk inserts with a direct connection should work");
test.tprintf("Testing column-wise binding with readwritesplit");

View File

@ -0,0 +1,45 @@
[maxscale]
threads=###threads###
[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server1,server2
user=maxskysql
passwd=skysql
monitor_interval=1000
[RW Split Router]
type=service
router=readwritesplit
servers=server1,server2
user=maxskysql
passwd=skysql
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
[CLI]
type=service
router=cli
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
socket=default
[server1]
type=server
address=###node_server_IP_1###
port=###node_server_port_1###
protocol=MySQLBackend
[server2]
type=server
address=###node_server_IP_2###
port=###node_server_port_2###
protocol=MySQLBackend

View File

@ -7,9 +7,9 @@ type=service
router=binlogrouter
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1
[Binlog Listener]

View File

@ -7,9 +7,9 @@ type=service
router=binlogrouter
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1
[Binlog Listener]

View File

@ -7,9 +7,9 @@ type=service
router=binlogrouter
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ type=service
router=binlogrouter
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,transaction_safety=1,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,transaction_safety=1,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ router=binlogrouter
#servers=master
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=1,transaction_safety=1,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=1,transaction_safety=1,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ router=binlogrouter
#servers=master
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=0,transaction_safety=0,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=0,transaction_safety=0,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ router=binlogrouter
#servers=master
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=1,transaction_safety=0,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=1,transaction_safety=0,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ router=binlogrouter
#servers=master
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=0,transaction_safety=1,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,semisync=0,transaction_safety=1,mariadb10-compatibility=1

View File

@ -8,9 +8,9 @@ router=binlogrouter
#servers=master
user=skysql
passwd=skysql
version_string=5.6.15-log
#version_string=5.6.15-log
#router_options=server-id=3,user=repl,password=repl,master-id=1
router_options=server-id=3,user=repl,password=repl,longburst=500,heartbeat=30,binlogdir=/var/lib/maxscale/Binlog_Service,transaction_safety=1,mariadb10-compatibility=1
router_options=server-id=9993,send_slave_heartbeat=On,user=repl,password=repl,longburst=500,heartbeat=10,binlogdir=/var/lib/maxscale/Binlog_Service,transaction_safety=1,mariadb10-compatibility=1

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[])
Test->repl->close_connections();
Test->stop_timeout();
Test->check_log_err(0, (char *) "refresh rate limit exceeded", false);
Test->check_log_err(0, (char *) "Refresh rate limit exceeded", false);
Test->check_maxscale_alive(0);
int rval = Test->global_result;
delete Test;

View File

@ -293,10 +293,9 @@ int Mariadb_nodes::stop_nodes()
{
printf("Stopping node %d\n", i);
fflush(stdout);
local_result += execute_query(nodes[i], (char *) "stop slave;");
fflush(stdout);
local_result += execute_query(nodes[i], "stop slave;");
local_result += stop_node(i);
fflush(stdout);
local_result += ssh_node_f(i, true, "rm -f /var/lib/mysql/*master*.info");
}
return local_result;
}
@ -345,11 +344,15 @@ int Mariadb_nodes::start_replication()
// Start all nodes
for (int i = 0; i < N; i++)
{
local_result += start_node(i, (char *) "");
sprintf(str,
"mysql -u root %s -e \"STOP SLAVE; RESET SLAVE; RESET SLAVE ALL; RESET MASTER; SET GLOBAL read_only=OFF;\"",
socket_cmd[i]);
ssh_node(i, str, true);
local_result += start_node(i, (char*)"");
ssh_node_f(i, true,
"mysql --force -u root %s -e \"STOP SLAVE; STOP ALL SLAVES; RESET SLAVE; RESET SLAVE ALL; RESET MASTER; SET GLOBAL read_only=OFF;\"",
socket_cmd[i]);
ssh_node_f(i, true, "sudo rm -f /etc/my.cnf.d/kerb.cnf");
ssh_node_f(i, true,
"for i in `mysql -ss --force -u root %s -e \"SHOW DATABASES\"|grep -iv 'mysql\\|information_schema\\|performance_schema'`; "
"do mysql --force -u root %s -e \"DROP DATABASE $i\";"
"done", socket_cmd[i], socket_cmd[i]);
}
sprintf(str, "%s/create_user.sh", test_dir);
@ -361,10 +364,9 @@ int Mariadb_nodes::start_replication()
ssh_node(0, str, false);
// Create a database dump from the master and distribute it to the slaves
sprintf(str,
"mysqldump --all-databases --add-drop-database --flush-privileges --master-data=1 --gtid %s > /tmp/master_backup.sql",
socket_cmd[0]);
ssh_node(0, str, true);
ssh_node_f(0, true, "mysql --force -u root %s -e \"CREATE DATABASE test\"; "
"mysqldump --all-databases --add-drop-database --flush-privileges --master-data=1 --gtid %s > /tmp/master_backup.sql",
socket_cmd[0], socket_cmd[0]);
sprintf(str, "%s/master_backup.sql", test_dir);
copy_from_node_legacy("/tmp/master_backup.sql", str, 0);
@ -374,16 +376,11 @@ int Mariadb_nodes::start_replication()
printf("Starting node %d\n", i);
fflush(stdout);
copy_to_node_legacy(str, "/tmp/master_backup.sql", i);
sprintf(dtr,
"mysql -u root %s < /tmp/master_backup.sql",
socket_cmd[i]);
ssh_node(i, dtr, true);
char query[512];
sprintf(query, "mysql -u root %s -e \"CHANGE MASTER TO MASTER_HOST=\\\"%s\\\", MASTER_PORT=%d, "
"MASTER_USER=\\\"repl\\\", MASTER_PASSWORD=\\\"repl\\\";"
"START SLAVE;\"", socket_cmd[i], IP_private[0], port[0]);
ssh_node(i, query, true);
ssh_node_f(i, true, "mysql --force -u root %s < /tmp/master_backup.sql",
socket_cmd[i]);
ssh_node_f(i, true, "mysql --force -u root %s -e \"CHANGE MASTER TO MASTER_HOST=\\\"%s\\\", MASTER_PORT=%d, "
"MASTER_USER=\\\"repl\\\", MASTER_PASSWORD=\\\"repl\\\";"
"START SLAVE;\"", socket_cmd[i], IP_private[0], port[0]);
}
return local_result;
@ -405,7 +402,7 @@ int Galera_nodes::start_galera()
ssh_node(0, "echo [mysqld] > cluster_address.cnf", false);
ssh_node(0, "echo wsrep_cluster_address=gcomm:// >> cluster_address.cnf", false);
ssh_node(0, "cp cluster_address.cnf /etc/my.cnf.d/", true);
local_result += start_node(0, (char *) " --wsrep-cluster-address=gcomm://");
local_result += start_node(0, (char*)" --wsrep-cluster-address=gcomm://");
sprintf(str, "%s/create_user_galera.sh", test_dir);
copy_to_node_legacy(str, "~/", 0);
@ -614,6 +611,28 @@ static bool bad_slave_thread_status(MYSQL *conn, const char *field, int node)
return rval;
}
static bool multi_source_replication(MYSQL *conn, int node)
{
bool rval = true;
MYSQL_RES *res;
if (mysql_query(conn, "SHOW ALL SLAVES STATUS") == 0 &&
(res = mysql_store_result(conn)))
{
if (mysql_num_rows(res) == 1)
{
rval = false;
}
else
{
printf("Node %d: More than one configured slave\n", node);
fflush(stdout);
}
}
return rval;
}
int Mariadb_nodes::check_replication()
{
int master = 0;
@ -643,7 +662,8 @@ int Mariadb_nodes::check_replication()
}
}
else if (bad_slave_thread_status(nodes[i], "Slave_IO_Running", i) ||
bad_slave_thread_status(nodes[i], "Slave_SQL_Running", i))
bad_slave_thread_status(nodes[i], "Slave_SQL_Running", i) ||
multi_source_replication(nodes[i], i))
{
res = 1;
}
@ -1050,7 +1070,7 @@ static void wait_until_pos(MYSQL *mysql, int filenum, int pos)
{
MYSQL_ROW row = mysql_fetch_row(res);
if (row && row[6] && row[21])
if (row && row[5] && strchr(row[5], '.') && row[21])
{
char *file_suffix = strchr(row[5], '.') + 1;
slave_filenum = atoi(file_suffix);

View File

@ -0,0 +1,23 @@
set -x
chmod 777 /tmp/
echo 2 > /proc/sys/fs/suid_dumpable
sed -i "s/start() {/start() { \n export DAEMON_COREFILE_LIMIT='unlimited'; ulimit -c unlimited; /" /etc/init.d/maxscale
sed -i "s/log_daemon_msg \"Starting MaxScale\"/export DAEMON_COREFILE_LIMIT='unlimited'; ulimit -c unlimited; log_daemon_msg \"Starting MaxScale\" /" /etc/init.d/maxscale
echo /tmp/core-%e-%s-%u-%g-%p-%t > /proc/sys/kernel/core_pattern
echo "kernel.core_pattern = /tmp/core-%e-sig%s-user%u-group%g-pid%p-time%t" >> /etc/sysctl.d/core.conf
echo "kernel.core_uses_pid = 1" >> /etc/sysctl.d/core.conf
echo "fs.suid_dumpable = 2" >> /etc/sysctl.d/core.conf
echo "DefaultLimitCORE=infinity" >> /etc/systemd/system.conf
echo "* hard core unlimited" >> /etc/security/limits.d/core.conf
echo "* soft core unlimited" >> /etc/security/limits.d/core.conf
echo "* soft nofile 65536" >> /etc/security/limits.d/core.conf
echo "* hard nofile 65536" >> /etc/security/limits.d/core.conf
echo "fs.file-max = 65536" >> /etc/sysctl.conf
systemctl daemon-reexec
sysctl -p

View File

@ -0,0 +1,4 @@
#create user repl@'%' identified by 'repl';
grant replication slave on *.* to repl@'%' identified by 'repl';
FLUSH PRIVILEGES;

View File

@ -0,0 +1,18 @@
create user skysql@'%' identified by 'skysql';
create user skysql@'localhost' identified by 'skysql';
GRANT ALL PRIVILEGES ON *.* TO skysql@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO skysql@'localhost' WITH GRANT OPTION;
create user maxuser@'%' identified by 'maxpwd';
create user maxuser@'localhost' identified by 'maxpwd';
GRANT ALL PRIVILEGES ON *.* TO maxuser@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO maxuser@'localhost' WITH GRANT OPTION;
create user maxskysql@'%' identified by 'skysql';
create user maxskysql@'localhost' identified by 'skysql';
GRANT ALL PRIVILEGES ON *.* TO maxskysql@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO maxskysql@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREATE DATABASE IF NOT EXISTS test;

View File

@ -0,0 +1,18 @@
#!/bin/bash
N=$galera_N
x=`expr $N - 1`
for i in $(seq 0 $x)
do
num=`printf "%03d" $i`
sshkey_var=galera_"$num"_keyfile
user_var=galera_"$num"_whoami
IP_var=galera_"$num"_network
sshkey=${!sshkey_var}
user=${!user_var}
IP=${!IP_var}
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysql_install_db; sudo chown -R mysql:mysql /var/lib/mysql"
done

View File

@ -0,0 +1,61 @@
#!/bin/bash
set -x
x=`expr $node_N - 1`
for i in $(seq 0 $x)
do
num=`printf "%03d" $i`
sshkey_var=node_"$num"_keyfile
user_var=node_"$num"_whoami
IP_var=node_"$num"_network
start_cmd_var=node_"$num"_start_db_command
stop_cmd_var=node_"$num"_stop_db_command
sshkey=${!sshkey_var}
user=${!user_var}
IP=${!IP_var}
start_cmd=${!start_cmd_var}
stop_cmd=${!stop_cmd_var}
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $stop_cmd"
sleep 5
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP 'sudo sed -i "s/bind-address/#bind-address/g" /etc/mysql/my.cnf'
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP 'sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/usr.sbin.mysqld; sudo service apparmor restart'
mysql_version=`ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP 'mysql --version'`
echo $mysql_version | grep "5\."
if [ $? == 0 ] ; then
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo sed -i \"s/binlog_row_image=full//\" /etc/my.cnf.d/*.cnf"
fi
echo $mysql_version | grep "5\.7"
if [ $? == 0 ] ; then
# ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo sed -i \"s/## x001/validate-password=OFF/\" /etc/my.cnf.d/*.cnf"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysqld --initialize; sudo chown -R mysql:mysql /var/lib/mysql"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $start_cmd"
mysql_root_password=`ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo cat /var/log/mysqld.log | grep \"temporary password\" | sed -n -e 's/^.*: //p'"`
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysqladmin -uroot -p'$mysql_root_password' password '$mysql_root_password'"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "echo \"UNINSTALL PLUGIN validate_password\" | sudo mysql -uroot -p'$mysql_root_password' "
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $stop_cmd"
# ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo sed -i \"s/## x001/validate-password=OFF/\" /etc/my.cnf.d/*.cnf"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $start_cmd"
# mysql_root_password=`ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo cat /var/log/mysqld.log | grep \"temporary password\" | sed -n -e 's/^.*: //p'"`
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "echo \"show plugins\" | sudo mysql -uroot -p'$mysql_root_password' "
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysqladmin -uroot -p'$mysql_root_password' password ''"
# ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $start_cmd"
else
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysql_install_db; sudo chown -R mysql:mysql /var/lib/mysql"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo $start_cmd"
fi
sleep 15
scp -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${script_dir}/create_*_user.sql $user@$IP://home/$user/
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysql < /home/$user/create_repl_user.sql"
ssh -i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $user@$IP "sudo mysql < /home/$user/create_skysql_user.sql"
done

View File

@ -0,0 +1,130 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=1
wsrep_on=ON
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera000
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=1
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,130 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=2
wsrep_on=ON
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera001
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=1
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,130 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=3
wsrep_on=ON
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera002
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=1
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,130 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=4
wsrep_on=ON
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera003
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=1
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,135 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=1
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera000
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Maximum number of rows in write set
wsrep_max_ws_rows=131072
# Maximum size of write set
wsrep_max_ws_size=1073741824
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,135 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=2
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera001
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Maximum number of rows in write set
wsrep_max_ws_rows=131072
# Maximum size of write set
wsrep_max_ws_size=1073741824
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,135 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=3
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera002
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Maximum number of rows in write set
wsrep_max_ws_rows=131072
# Maximum size of write set
wsrep_max_ws_size=1073741824
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,135 @@
[mysqld]
expire_logs_days=7
user=mysql
server_id=4
# Row binary log format is required by Galera
binlog_format=ROW
log-bin
# InnoDB is currently the only storage engine supported by Galera
default-storage-engine=innodb
innodb_file_per_table
# To avoid issues with 'bulk mode inserts' using autoincrement fields
innodb_autoinc_lock_mode=2
# Required to prevent deadlocks on parallel transaction execution
innodb_locks_unsafe_for_binlog=1
# Query Cache is not supported by Galera wsrep replication
query_cache_size=0
query_cache_type=0
# INITIAL SETUP
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=###NODE-ADDRESS###
##
## WSREP options
##
# INITIAL SETUP
# For the initial setup, wsrep should be disabled
wsrep_provider=none
# After initial setup, parameter should have full path to wsrep provider library
wsrep_provider=###GALERA-LIB-PATH###
# Provider specific configuration options
wsrep_provider_options = "evs.keepalive_period = PT3S; evs.inactive_check_period = PT10S; evs.suspect_timeout = PT30S; evs.inactive_timeout = PT1M; evs.install_timeout = PT1M"
# Logical cluster name. Should be the same for all nodes in the same cluster.
wsrep_cluster_name=skycluster
# INITIAL SETUP
# Group communication system handle: for the first node to be launched, the value should be "gcomm://", indicating creation of a new cluster;
# for the other nodes joining the cluster, the value should be "gcomm://xxx.xxx.xxx.xxx:4567", where xxx.xxx.xxx.xxx should be the ip of a node
# already on the cluster (usually the first one)
# DEPRECATED
# wsrep_cluster_address=gcomm://
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=###NODE-NAME###
wsrep_node_name=galera003
# INITIAL SETUP
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=###NODE-ADDRESS###
# INITIAL SETUP
# Address for incoming client connections. Autodetect by default.
wsrep_node_incoming_address=###NODE-ADDRESS###
# Number of threads that will process writesets from other nodes
wsrep_slave_threads=1
# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1
# Maximum number of rows in write set
wsrep_max_ws_rows=131072
# Maximum size of write set
wsrep_max_ws_size=1073741824
# Debug level logging (1 = enabled)
wsrep_debug=1
# Convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0
# Number of retries for deadlocked autocommits
wsrep_retry_autocommit=1
# Change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
# Retry autoinc insert, when the insert failed for "duplicate key error"
wsrep_drupal_282555_workaround=0
# Enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
wsrep_notify_cmd=
##
## WSREP State Transfer options
##
# State Snapshot Transfer method
#wsrep_sst_method=mysqldump
#wsrep_sst_method=xtrabackup
wsrep_sst_method=rsync
# INITIAL SETUP
# Address which donor should send State Snapshot to.
# Should be the address of the CURRENT node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
wsrep_sst_receive_address=###NODE-ADDRESS###
# INITIAL SETUP
# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
#wsrep_sst_auth=###REP-USERNAME###:###REP-PASSWORD###
wsrep_sst_auth=repl:repl
# Desired SST donor name.
#wsrep_sst_donor=
# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0
# Protocol version to use
# wsrep_protocol_version=

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=1
#slave_parallel_threads=2
user=mysql
## x001
#max_long_data_size=1000000000
#innodb_log_file_size=2000000000
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=10
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=11
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=12
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=13
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=14
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=15
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=2
#slave_parallel_threads=2
user=mysql
## x001
#max_long_data_size=1000000000
#innodb_log_file_size=2000000000
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=3
#slave_parallel_threads=2
user=mysql
## x001
#max_long_data_size=1000000000
#innodb_log_file_size=2000000000
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=4
#slave_parallel_threads=2
user=mysql
## x001
#max_long_data_size=1000000000
#innodb_log_file_size=2000000000
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=5
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=6
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=7
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=8
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#log-basename=mar
log-bin=mar-bin
#binlog-format=row
binlog-format=STATEMENT
server_id=9
#slave_parallel_threads=2
user=mysql
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=row
binlog_row_image=full
server_id=1
user=mysql
## x001
max_long_data_size=1000000000
innodb_log_file_size=2000000000
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=10
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=11
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=12
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=13
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=14
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=15
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=row
binlog_row_image=full
server_id=2
user=mysql
## x001
max_long_data_size=1000000000
innodb_log_file_size=2000000000
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=row
binlog_row_image=full
server_id=3
user=mysql
## x001
max_long_data_size=1000000000
innodb_log_file_size=2000000000
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,39 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=row
binlog_row_image=full
server_id=4
user=mysql
## x001
max_long_data_size=1000000000
innodb_log_file_size=2000000000
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=5
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=6
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=7
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=8
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,36 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
log-slave-updates
log-bin=mar-bin
binlog-format=STATEMENT
server_id=9
user=mysql
## x001
slave-skip-errors=all
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are 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]
[mariadb-5.5]

View File

@ -0,0 +1,9 @@
. ${script_dir}/set_env.sh $name
${script_dir}/backend/setup_repl.sh
${script_dir}/backend/galera/setup_galera.sh
${script_dir}/configure_core.sh
rm ~/vagrant_lock

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -x
ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP '$maxscale_access_sudo service iptables stop'
ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP "$maxscale_access_sudo mkdir ccore; $maxscale_access_sudo chown $maxscale_access_user ccore"
scp -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${script_dir}/add_core_cnf.sh $maxscale_access_user@$maxscale_IP:./ccore/
ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP "$maxscale_access_sudo /home/$maxscale_access_user/ccore/add_core_cnf.sh"
set +x

View File

@ -0,0 +1,15 @@
set -x
LOGS_DIR=${logs_dir:-$HOME/LOGS}
echo $JOB_NAME | grep "/"
if [ $? == 0 ] ; then
export job_name_buildID=`echo $JOB_NAME | sed "s|/|-$BUILD_NUMBER/|"`
export logs_publish_dir="${LOGS_DIR}/${job_name_buildID}/"
else
export logs_publish_dir="${LOGS_DIR}/${JOB_NAME}-${BUILD_NUMBER}"
fi
export job_name_buildID=`echo ${JOB_NAME} | sed "s|/|-${BUILD_NUMBER}/|"`
export logs_publish_dir="${LOGS_DIR}/${job_name_buildID}-${BUILD_NUMBER}"
echo "Logs go to ${logs_publish_dir}"
mkdir -p ${logs_publish_dir}

View File

@ -0,0 +1,5 @@
set -x
rsync -a --no-o --no-g LOGS ${logs_publish_dir}
chmod a+r ${logs_publish_dir}/*
cp -r ${MDBCI_VM_PATH}/$name ${logs_publish_dir}
cp ${MDBCI_VM_PATH}/${name}.json ${logs_publish_dir}

View File

@ -0,0 +1,59 @@
#!/bin/bash
set -x
export dir=`pwd`
# read the name of build scripts directory
export script_dir="$(dirname $(readlink -f $0))"
. ${script_dir}/set_run_test_variables.sh
${mdbci_dir}/repository-config/generate_all.sh repo.d
${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d
export repo_dir=$dir/repo.d/
export provider=`${mdbci_dir}/mdbci show provider $box --silent 2> /dev/null`
export backend_box=${backend_box:-"centos_7_"$provider}
if [ "$product" == "mysql" ] ; then
export cnf_path=${script_dir}/cnf/mysql56
fi
mkdir -p ${MDBCI_VM_PATH}/$name
cd ${MDBCI_VM_PATH}/$name
vagrant destroy -f
cd $dir
mkdir ${MDBCI_VM_PATH}/$name/cnf
cp -r ${cnf_path}/* ${MDBCI_VM_PATH}/$name/cnf/
export cnd_path="${MDBCI_VM_PATH}/$name/cnf/"
eval "cat <<EOF
$(<${script_dir}/templates/${template}.json.template)
" 2> /dev/null > ${MDBCI_VM_PATH}/${name}.json
${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json --repo-dir ${repo_dir} generate $name
while [ -f ~/vagrant_lock ]
do
echo "vagrant is locked, waiting ..."
sleep 5
done
touch ~/vagrant_lock
echo ${JOB_NAME}-${BUILD_NUMBER} >> ~/vagrant_lock
echo "running vagrant up $provider"
${mdbci_dir}/mdbci up $name --attempts 3
if [ $? != 0 ]; then
echo "Error creating configuration"
rm ~/vagrant_lock
exit 1
fi
cp ~/build-scripts/team_keys .
${mdbci_dir}/mdbci public_keys --key ${team_keys} $name
rm ~/vagrant_lock
exit 0

View File

@ -0,0 +1,10 @@
#!/bin/bash
dir=`pwd`
cd ${MDBCI_VM_PATH}/${name}
vagrant destroy -f
cd $dir
rm -rf ${MDBCI_VM_PATH}/${name}
rm -rf ${MDBCI_VM_PATH}/${name}.json
rm -rf ${MDBCI_VM_PATH}/${name}_network_config

View File

@ -0,0 +1,103 @@
#!/bin/bash
# see set_run_test_variables.sh for default values of all variables
# $box - Name of Vagrant box for Maxscale machine
# see lists of supported boxes
# https://github.com/mariadb-corporation/mdbci/tree/integration/BOXES
# $template - name of MDBCI json template file
# Template file have to be in ./templates/, file name
# have to be '$template.json.template
# Template file can contain references to any variables -
# all ${variable_name} will be replaced with values
# $name - name of test run. It can be any string of leytters or digits
# If it is not defined, name will be automatically genereted
# using $box and current date and time
# $ci_url - URL to Maxscale CI repository
# (default "http://max-tst-01.mariadb.com/ci-repository/")
# if build is done also locally and binaries are not uploaded to
# max-tst-01.mariadb.com $ci_url should toint to local web server
# e.g. http://192.168.122.1/repository (IP should be a host IP in the
# virtual network (not 127.0.0.1))
# $product - 'mariadb' or 'mysql'
# $version - version of backend DB (e.g. '10.1', '10.2')
# $galera_version - version of Galera backend DB
# same as $version by default
# $target - name of binary repository
# (name of subdirectroy http://max-tst-01.mariadb.com/ci-repository/)
# $team_keys - path to the file with open ssh keys to be
# installed on all VMs (default ${HOME}/team_keys)
# $don_not_destroy_vm - if 'yes' VM won't be destored afther the test
# $test_set - parameters to be send to 'ctest' (e.g. '-I 1,100',
# '-LE UNSTABLE'
export vm_memory=${vm_memory:-"2048"}
export dir=`pwd`
ulimit -n
# read the name of build scripts directory
export script_dir="$(dirname $(readlink -f $0))"
. ${script_dir}/set_run_test_variables.sh
rm -rf LOGS
export target=`echo $target | sed "s/?//g"`
export name=`echo $name | sed "s/?//g"`
. ${script_dir}/configure_log_dir.sh
cd ${script_dir}/..
cmake . -DBUILDNAME=$name -DCMAKE_BUILD_TYPE=Debug
make
${script_dir}/create_config.sh
res=$?
if [ $res == 0 ] ; then
. ${script_dir}/configure_backend.sh
${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name clean
if [ ! -z "${named_test}" ] ; then
./${named_test}
else
./check_backend
if [ $? != 0 ]; then
echo "Backend broken!"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
fi
rm ~/vagrant_lock
exit 1
fi
ctest -VV -D Nightly ${test_set}
fi
cd $dir
${script_dir}/copy_logs.sh
else
echo "Failed to create VMs, exiting"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
fi
rm ~/vagrant_lock
exit 1
fi
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
echo "clean up done!"
fi

View File

@ -0,0 +1,90 @@
#!/bin/bash
function checkExitStatus {
returnCode=$1
errorMessage=$2
lockFilePath=$3
if [ "$returnCode" != 0 ]; then
echo "$errorMesage"
rm $lockFilePath
echo "Snapshot lock file was deleted due to an error"
exit 1
fi
}
set -x
export dir=`pwd`
# read the name of build scripts directory
export script_dir="$(dirname $(readlink -f $0))"
. ${script_dir}/set_run_test_variables.sh
export name="$box-$product-$version-permanent"
export snapshot_name=${snapshot_name:-"clean"}
rm -rf LOGS
export target=`echo $target | sed "s/?//g"`
export name=`echo $name | sed "s/?//g"`
. ${script_dir}/configure_log_dir.sh
# Setting snapshot_lock
export snapshot_lock_file=${MDBCI_VM_PATH}/${name}_snapshot_lock
if [ -f ${snapshot_lock_file} ]; then
echo "Snapshot is locked, waiting ..."
fi
while [ -f ${snapshot_lock_file} ]
do
sleep 5
done
touch ${snapshot_lock_file}
echo $JOB_NAME-$BUILD_NUMBER >> ${snapshot_lock_file}
export repo_dir=$dir/repo.d/
${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name $snapshot_name
if [ $? != 0 ]; then
${script_dir}/destroy.sh
${MDBCI_VM_PATH}/scripts/clean_vms.sh $name
${script_dir}/create_config.sh
checkExitStatus $? "Error creating configuration" $snapshot_lock_file
. ${script_dir}/configure_backend.sh
echo "Creating snapshot from new config"
$HOME/mdbci/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name
fi
. ${script_dir}/set_env.sh "$name"
${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d
${mdbci_dir}/mdbci sudo --command 'yum remove maxscale -y' $name/maxscale
${mdbci_dir}/mdbci sudo --command 'yum clean all' $name/maxscale
${mdbci_dir}/mdbci setup_repo --product maxscale $name/maxscale --repo-dir $repo_dir
${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale --repo-dir $repo_dir
checkExitStatus $? "Error installing Maxscale" $snapshot_lock_file
cd ${script_dir}/..
cmake . -DBUILDNAME=$JOB_NAME-$BUILD_NUMBER-$target
make
./check_backend --restart-galera
checkExitStatus $? "Failed to check backends" $snapshot_lock_file
ctest $test_set -VV -D Nightly
${script_dir}/copy_logs.sh
# Removing snapshot_lock
rm ${snapshot_lock_file}

View File

@ -0,0 +1,97 @@
#!/bin/bash
set -x
echo $*
export MDBCI_VM_PATH=${MDBCI_VM_PATH:-$HOME/vms}
export mdbci_dir=${mdbci_dir:-"$HOME/mdbci/"}
export config_name="$1"
if [ -z $1 ] ; then
config_name="test1"
fi
export curr_dir=`pwd`
export maxscale_binlog_dir="/var/lib/maxscale/Binlog_Service"
export maxdir="/usr/bin/"
export maxdir_bin="/usr/bin/"
export maxscale_cnf="/etc/maxscale.cnf"
export maxscale_log_dir="/var/log/maxscale/"
# Number of nodes
export galera_N=`cat "$MDBCI_VM_PATH/$config_name"_network_config | grep galera | grep network | wc -l`
export node_N=`cat "$MDBCI_VM_PATH/$config_name"_network_config | grep node | grep network | wc -l`
sed "s/^/export /g" "$MDBCI_VM_PATH/$config_name"_network_config > "$curr_dir"/"$config_name"_network_config_export
source "$curr_dir"/"$config_name"_network_config_export
# IP Of MaxScale machine
export maxscale_IP=$maxscale_network
export maxscale_sshkey=$maxscale_keyfile
# User name and Password for Master/Slave replication setup (should have all PRIVILEGES)
export node_user="skysql"
export node_password="skysql"
# User name and Password for Galera setup (should have all PRIVILEGES)
export galera_user="skysql"
export galera_password="skysql"
export maxscale_user="skysql"
export maxscale_password="skysql"
export maxadmin_password="mariadb"
for prefix in "node" "galera"
do
N_var="$prefix"_N
Nx=${!N_var}
N=`expr $Nx - 1`
for i in $(seq 0 $N)
do
num=`printf "%03d" $i`
eval 'export "$prefix"_"$num"_port=3306'
eval 'export "$prefix"_"$num"_access_sudo=sudo'
start_cmd_var="$prefix"_"$num"_start_db_command
stop_cmd_var="$prefix"_"$num"_stop_db_command
mysql_exe=`${mdbci_dir}/mdbci ssh --command 'ls /etc/init.d/mysql* 2> /dev/null | tr -cd "[:print:]"' $config_name/node_$num --silent 2> /dev/null`
echo $mysql_exe | grep -i "mysql"
if [ $? != 0 ] ; then
service_name=`${mdbci_dir}/mdbci ssh --command 'systemctl list-unit-files | grep mysql' $config_name/node_$num --silent`
echo $service_name | grep mysql
if [ $? == 0 ] ; then
echo $service_name | grep mysqld
if [ $? == 0 ] ; then
eval 'export $start_cmd_var="service mysqld start "'
eval 'export $stop_cmd_var="service mysqld stop "'
else
eval 'export $start_cmd_var="service mysql start "'
eval 'export $stop_cmd_var="service mysql stop "'
fi
else
${mdbci_dir}/mdbci ssh --command 'echo \"/usr/sbin/mysqld \$* 2> stderr.log > stdout.log &\" > mysql_start.sh; echo \"sleep 20\" >> mysql_start.sh; echo \"disown\" >> mysql_start.sh; chmod a+x mysql_start.sh' $config_name/node_$num --silent
eval 'export $start_cmd_var="/home/$au/mysql_start.sh "'
eval 'export $start_cmd_var="killall mysqld "'
fi
else
eval 'export $start_cmd_var="$mysql_exe start "'
eval 'export $stop_cmd_var="$mysql_exe stop "'
fi
eval 'export "$prefix"_"$num"_start_vm_command="cd $mdbci_dir/$config_name;vagrant up node_$num --provider=$provider; cd $curr_dir"'
eval 'export "$prefix"_"$num"_kill_vm_command="cd $mdbci_dir/$config_name;vagrant halt node_$num --provider=$provider; cd $curr_dir"'
done
done
export maxscale_access_user=$maxscale_whoami
export maxscale_access_sudo="sudo "
# Sysbench directory (should be sysbench >= 0.5)
export sysbench_dir=${sysbench_dir:-"$HOME/sysbench_deb7/sysbench/"}
export ssl=true
export take_snapshot_command="${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name "
export revert_snapshot_command="${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name "
#export use_snapshots=yes
set +x

View File

@ -0,0 +1,32 @@
#!/bin/bash
export MDBCI_VM_PATH=${MDBCI_VM_PATH:-$HOME/vms}
mkdir -p $MDBCI_VM_PATH
echo "MDBCI_VM_PATH=$MDBCI_VM_PATH"
export box=${box:-"centos_7_libvirt"}
echo "box=$box"
export template=${template:-"default"}
export curr_date=`date '+%Y-%m-%d_%H-%M'`
export name=${name:-$box-${curr_date}}
export mdbci_dir=${mdbci_dir:-"$HOME/mdbci/"}
export ci_url=${ci_url:-"http://max-tst-01.mariadb.com/ci-repository/"}
export product=${product:-"mariadb"}
export version=${version:-"10.2"}
export target=${target:-"develop"}
export vm_memory=${vm_memory:-"2048"}
export cnf_path=${script_dir}/cnf
export JOB_NAME=${JOB_NAME:-"local_test"}
export BUILD_NUMBER=${BUILD_NUMBER:-`date '+%Y%m%d%H%M'`}
export BUILD_TAG=${BUILD_TAG:-jenkins-${JOB_NAME}-${BUILD_NUMBER}}
export team_keys=${team_keys:-${HOME}/team_keys}
export galera_version=${galera_version:-$version}
export do_not_destroy_vm=${do_not_destroy_vm:-"no"}
#export test_set=${test_set:-"-LE UNSTABLE"}
export test_set=${test_set:-"-I 1,5"}

View File

@ -0,0 +1,152 @@
{
"node_000" :
{
"hostname" : "node000",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server1.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_001" :
{
"hostname" : "node001",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server2.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_002" :
{
"hostname" : "node002",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server3.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_003" :
{
"hostname" : "node003",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server4.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_004" :
{
"hostname" : "node004",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server5.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_005" :
{
"hostname" : "node005",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server6.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_006" :
{
"hostname" : "node006",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server7.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_007" :
{
"hostname" : "node007",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server8.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_000" :
{
"hostname" : "galera000",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server1.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_001" :
{
"hostname" : "galera001",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server2.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_002" :
{
"hostname" : "galera002",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server3.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_003" :
{
"hostname" : "galera003",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server4.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"maxscale" :
{
"hostname" : "maxscale",
"box" : "centos_7_aws_large",
"product" : {
"name": "maxscale"
}
}
}

View File

@ -0,0 +1,229 @@
{
"node_000" :
{
"hostname" : "node_000",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server1.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_001" :
{
"hostname" : "node_001",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server2.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_002" :
{
"hostname" : "node_002",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server3.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_003" :
{
"hostname" : "node_003",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server4.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_004" :
{
"hostname" : "node_004",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server5.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_005" :
{
"hostname" : "node_005",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server6.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_006" :
{
"hostname" : "node_006",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server7.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_007" :
{
"hostname" : "node_007",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server8.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_008" :
{
"hostname" : "node_008",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server9.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_009" :
{
"hostname" : "node_009",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server10.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_0010" :
{
"hostname" : "node_0010",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server11.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_0011" :
{
"hostname" : "node_0011",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server12.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_0012" :
{
"hostname" : "node_0012",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server13.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_0013" :
{
"hostname" : "node_0013",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server14.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"node_0014" :
{
"hostname" : "node_0014",
"box" : "centos_7_aws_large",
"product" : {
"name": "###product###",
"version": "###version###",
"cnf_template" : "server15.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_000" :
{
"hostname" : "galera_000",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server1.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_001" :
{
"hostname" : "galera_001",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server2.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_002" :
{
"hostname" : "galera_002",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server3.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_003" :
{
"hostname" : "galera_003",
"box" : "centos_7_aws",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server4.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"maxscale" :
{
"hostname" : "maxscale",
"box" : "centos_7_aws_large",
"product" : {
"name": "maxscale"
}
}
}

View File

@ -0,0 +1,117 @@
{
"node_000" :
{
"hostname" : "node000",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server1.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_001" :
{
"hostname" : "node001",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server2.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_002" :
{
"hostname" : "node002",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server3.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_003" :
{
"hostname" : "node003",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server4.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_000" :
{
"hostname" : "galera000",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server1.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_001" :
{
"hostname" : "galera001",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server2.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_002" :
{
"hostname" : "galera002",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server3.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_003" :
{
"hostname" : "galera003",
"box" : "${backend_box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server4.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"maxscale" :
{
"hostname" : "maxscale",
"box" : "${box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "maxscale"
}
}
}

View File

@ -0,0 +1,67 @@
{
###nodes###
"galera_000" :
{
"hostname" : "galera000",
"box" : "centos_7_libvirt",
"memory_size" : "2048",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server1.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_001" :
{
"hostname" : "galera001",
"box" : "centos_7_libvirt",
"memory_size" : "2048",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server2.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_002" :
{
"hostname" : "galera002",
"box" : "centos_7_libvirt",
"memory_size" : "2048",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server3.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"galera_003" :
{
"hostname" : "galera003",
"box" : "centos_7_libvirt",
"memory_size" : "2048",
"product" : {
"name": "galera",
"version": "###galera_version###",
"cnf_template" : "galera_server4.cnf",
"cnf_template_path": "~/build-scripts/test-setup-scripts/cnf"
}
},
"maxscale" :
{
"hostname" : "maxscale",
"box" : "###box###",
"memory_size" : "2048",
"product" : {
"name": "maxscale"
}
}
}

View File

@ -19,7 +19,7 @@ void do_test(TestConnections& test, int master, int slave)
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
test.tprintf("Start the slave node and perform another insert");
test.galera->start_node(slave, (char *) "");
test.galera->start_node(slave, (char*)"");
sleep(5);
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
test.maxscales->close_maxscale_connections(0);
@ -31,7 +31,7 @@ void do_test(TestConnections& test, int master, int slave)
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
test.tprintf("Start the master node and perform another insert (expecting failure)");
test.galera->start_node(master, (char *) "");
test.galera->start_node(master, (char*)"");
sleep(5);
test.add_result(execute_query_silent(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)") == 0,
"Query should fail");

View File

@ -6,7 +6,6 @@
#include "testconnections.h"
#include <sstream>
#include "maxscales.h"
void change_master(TestConnections& test, int slave, int master, const char* name = NULL)
{
@ -19,8 +18,7 @@ void change_master(TestConnections& test, int slave, int master, const char* nam
source += "'";
}
execute_query(test.repl->nodes[slave],
"STOP ALL SLAVES;CHANGE MASTER %s TO master_host='%s', master_port=3306, "
execute_query(test.repl->nodes[slave], "STOP ALL SLAVES;CHANGE MASTER %s TO master_host='%s', master_port=3306, "
"master_user='%s', master_password='%s', master_use_gtid=slave_pos;START ALL SLAVES",
source.c_str(), test.repl->IP[master], test.repl->user_name, test.repl->password, source.c_str());
}
@ -30,14 +28,14 @@ const char* dump_status(const StringSet& current, const StringSet& expected)
std::stringstream ss;
ss << "Current status: (";
for (const auto& a : current)
for (const auto& a: current)
{
ss << a << ",";
}
ss << ") Expected status: (";
for (const auto& a : expected)
for (const auto& a: expected)
{
ss << a << ",";
}
@ -51,8 +49,8 @@ const char* dump_status(const StringSet& current, const StringSet& expected)
void check_status(TestConnections& test, const StringSet& expected_master, const StringSet& expected_slave)
{
sleep(2);
StringSet master = test.maxscales->get_server_status(0, "server1");
StringSet slave = test.maxscales->get_server_status(0, "server2");
StringSet master = test.get_server_status("server1");
StringSet slave = test.get_server_status("server2");
test.add_result(master != expected_master, "Master status is not what was expected: %s",
dump_status(master, expected_master));
test.add_result(slave != expected_slave, "Slave status is not what was expected: %s",

View File

@ -5,62 +5,52 @@
* - Connect repeatedly to MaxScale with 'testdb' as the default database and execute SELECT 1
*/
#include <iostream>
#include "testconnections.h"
using namespace std;
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
TestConnections test(argc, argv);
char str[256];
int iterations = Test->smoke ? 100 : 500;
Test->repl->execute_query_all_nodes((char *) "set global max_connections = 600;");
Test->set_timeout(30);
Test->repl->stop_slaves();
Test->set_timeout(30);
Test->maxscales->restart_maxscale(0);
Test->set_timeout(30);
Test->repl->connect();
Test->stop_timeout();
int iterations = 100;
test.repl->execute_query_all_nodes((char *) "set global max_connections = 600;");
test.set_timeout(200);
test.repl->stop_slaves();
test.set_timeout(200);
test.restart_maxscale();
test.set_timeout(200);
test.repl->connect();
test.stop_timeout();
/** Create a database on each node */
for (int i = 0; i < Test->repl->N; i++)
for (int i = 0; i < test.repl->N; i++)
{
Test->set_timeout(20);
test.set_timeout(20);
sprintf(str, "DROP DATABASE IF EXISTS shard_db%d", i);
Test->tprintf("%s\n", str);
execute_query(Test->repl->nodes[i], str);
Test->set_timeout(20);
test.tprintf("%s\n", str);
execute_query(test.repl->nodes[i], str);
test.set_timeout(20);
sprintf(str, "CREATE DATABASE shard_db%d", i);
Test->tprintf("%s\n", str);
execute_query(Test->repl->nodes[i], str);
Test->stop_timeout();
test.tprintf("%s\n", str);
execute_query(test.repl->nodes[i], str);
test.stop_timeout();
}
Test->repl->close_connections();
test.repl->close_connections();
for (int j = 0; j < iterations && Test->global_result == 0; j++)
for (int j = 0; j < iterations && test.global_result == 0; j++)
{
for (int i = 0; i < Test->repl->N; i++)
for (int i = 0; i < test.repl->N && test.global_result == 0; i++)
{
sprintf(str, "shard_db%d", i);
Test->set_timeout(15);
MYSQL *conn = open_conn_db(Test->maxscales->rwsplit_port[0], Test->maxscales->IP[0],
str, Test->maxscales->user_name,
Test->maxscales->password, Test->ssl);
Test->set_timeout(15);
Test->tprintf("Trying DB %d\n", i);
if (execute_query(conn, "SELECT 1"))
{
Test->add_result(1, "Failed at %d\n", j);
break;
}
test.set_timeout(30);
MYSQL *conn = open_conn_db(test.rwsplit_port, test.maxscale_IP,
str, test.maxscale_user,
test.maxscale_password, test.ssl);
test.set_timeout(30);
test.add_result(execute_query(conn, "SELECT 1"), "Trying DB %d failed at %d", i, j);
mysql_close(conn);
}
}
int rval = Test->global_result;
delete Test;
return rval;
return test.global_result;
}

View File

@ -332,28 +332,44 @@ TestConnections::~TestConnections()
}
}
void TestConnections::add_result(int result, const char *format, ...)
void TestConnections::report_result(const char *format, va_list argp)
{
timeval t2;
gettimeofday(&t2, NULL);
double elapsedTime = (t2.tv_sec - start_time.tv_sec);
elapsedTime += (double) (t2.tv_usec - start_time.tv_usec) / 1000000.0;
if (result != 0)
global_result += 1;
printf("%04f: TEST_FAILED! ", elapsedTime);
vprintf(format, argp);
if (format[strlen(format) - 1] != '\n')
{
global_result += result;
printf("%04f: TEST_FAILED! ", elapsedTime);
printf("\n");
}
}
void TestConnections::add_result(bool result, const char *format, ...)
{
if (result)
{
va_list argp;
va_start(argp, format);
vprintf(format, argp);
report_result(format, argp);
va_end(argp);
}
}
if (format[strlen(format) - 1] != '\n')
{
printf("\n");
}
void TestConnections::assert(bool result, const char *format, ...)
{
if (!result)
{
va_list argp;
va_start(argp, format);
report_result(format, argp);
va_end(argp);
}
}
@ -1695,6 +1711,47 @@ int TestConnections::try_query_all(int m, const char *sql)
try_query(maxscales->conn_slave[m], sql);
}
StringSet TestConnections::get_server_status(const char* name)
{
std::set<std::string> rval;
int rc;
char* res = maxscales->ssh_node_output_f(0, true, &rc, "maxadmin list servers|grep \'%s\'", name);
char* pipe = strrchr(res, '|');
if (res && pipe)
{
pipe++;
char* tok = strtok(pipe, ",");
while (tok)
{
char* p = tok;
char *end = strchr(tok, '\n');
if (!end)
end = strchr(tok, '\0');
// Trim leading whitespace
while (p < end && isspace(*p))
{
p++;
}
// Trim trailing whitespace
while (end > tok && isspace(*end))
{
*end-- = '\0';
}
rval.insert(p);
tok = strtok(NULL, ",\n");
}
free(res);
}
return rval;
}
int TestConnections::list_dirs(int m)
{
for (int i = 0; i < repl->N; i++)

View File

@ -10,6 +10,7 @@
#include <set>
#include <string>
typedef std::set<std::string> StringSet;
/**
* @brief Class contains references to Master/Slave and Galera test setups
@ -223,7 +224,10 @@ public:
* @param result 0 if step PASSED
* @param format ... message to pring if result is not 0
*/
void add_result(int result, const char *format, ...);
void add_result(bool result, const char *format, ...);
/** Same as add_result() but inverted */
void assert(bool result, const char *format, ...);
/**
* @brief ReadEnv Reads all Maxscale and Master/Slave and Galera setups info from environmental variables
@ -430,6 +434,15 @@ public:
*/
int try_query_all(int m, const char *sql);
/**
* @brief Get the set of labels that are assigned to server @c name
*
* @param name The name of the server that must be present in the output `maxadmin list servers`
*
* @return A set of string labels assigned to this server
*/
StringSet get_server_status(const char* name);
/**
* @brief check_maxscale_processes Check if number of running Maxscale processes is equal to 'expected'
* @param expected expected number of Maxscale processes
@ -478,6 +491,10 @@ public:
void check_current_connections(int m, int value);
int stop_maxscale(int m);
void process_template(const char *src, const char *dest = "/etc/maxscale.cnf");
private:
void report_result(const char *format, va_list argp);
};
/**

View File

@ -91,7 +91,7 @@ add_test_executable_notest(sysbench_example.cpp sysbench_example replication)
# Build the MariaDB Connector/C 3.0
set(CONNECTOR_C_VERSION "3.0" CACHE STRING "The Connector-C version to use")
set(CONNECTOR_C_VERSION "v3.0.2" CACHE STRING "The Connector-C version to use")
include(ExternalProject)
ExternalProject_Add(connector-c