2.2 fix restore (#152)

* refactor test backend fixing

* return comatibility with 5.5 for backend restore

* remove backend configuration scripts

* adopt test backed restore function for 2.2 test fw
This commit is contained in:
Timofey Turenko
2017-12-18 23:47:07 +02:00
committed by GitHub
parent b9e7eaf3aa
commit 1006ec506a
11 changed files with 453 additions and 180 deletions

View File

@ -1,15 +1,15 @@
create user skysql@'%' identified by 'skysql';
create user skysql@'localhost' identified by 'skysql';
#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';
#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';
#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;

View File

@ -1,18 +0,0 @@
#!/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

@ -1,61 +0,0 @@
#!/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

@ -1,9 +0,0 @@
. ${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

@ -52,7 +52,7 @@ if [ $? != 0 ]; then
exit 1
fi
cp ~/build-scripts/team_keys .
#cp ~/build-scripts/team_keys .
${mdbci_dir}/mdbci public_keys --key ${team_keys} $name
rm ~/vagrant_lock

View File

@ -58,17 +58,15 @@ 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
# . ${script_dir}/configure_backend.sh
. ${script_dir}/set_env.sh $name
cd ${script_dir}/..
cmake . -DBUILDNAME=$name -DCMAKE_BUILD_TYPE=Debug
make
if [ ! -z "${named_test}" ] ; then
./${named_test}
@ -82,6 +80,7 @@ if [ $res == 0 ] ; then
rm ~/vagrant_lock
exit 1
fi
${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name clean
ctest -VV -D Nightly ${test_set}
fi

View File

@ -0,0 +1,65 @@
{
"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}"
}
},
"maxscale" :
{
"hostname" : "maxscale",
"box" : "${box}",
"memory_size" : "${vm_memory}",
"product" : {
"name": "maxscale"
}
}
}