"title":"Enable REQUIRE SSL for repman database users",
"description":"Enable secure connection between repman and mariadb databases. This option is an initial value, used only when creating database users.",
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set end=NOW(), result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
$MYSQL_CLIENT-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set end=NOW(), result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
}
}
pauseJob()
pauseJob()
{
{
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"select sleep(6);set sql_log_bin=0;UPDATE replication_manager_schema.jobs set result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
$MYSQL_CLIENT-e"select sleep(6);set sql_log_bin=0;UPDATE replication_manager_schema.jobs set result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
}
}
partialRestore()
partialRestore()
{
{
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;install plugin BLACKHOLE soname 'ha_blackhole.so'"
cat$BACKUPDIR/xtrabackup_info | grep binlog_pos | awk-F, '{ print $3 }' | sed-e's/GTID of the last change/set sql_log_bin=0;set global gtid_slave_pos=/g' | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$USER
cat$BACKUPDIR/xtrabackup_info | grep binlog_pos | awk-F, '{ print $3 }' | sed-e's/GTID of the last change/set sql_log_bin=0;set global gtid_slave_pos=/g' | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$DBUSER
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"flush privileges;start slave;"
TASK=($(echo"select concat(id,'@',server,':',port) from replication_manager_schema.jobs WHERE task='$job' and done=0 order by task desc limit 1" | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$USER-N))
TASK=($(echo"select concat(id,'@',server,':',port) from replication_manager_schema.jobs WHERE task='$job' and done=0 order by task desc limit 1" | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$DBUSER-N))
ADDRESS=($(echo$TASK | awk-F@ '{ print $2 }'))
ADDRESS=($(echo$TASK | awk-F@ '{ print $2 }'))
ID=($(echo$TASK | awk-F@ '{ print $1 }'))
ID=($(echo$TASK | awk-F@ '{ print $1 }'))
#purge de past
#purge de past
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set done=1 WHERE done=0 AND task='$job';"
$MYSQL_CLIENT-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set done=1 WHERE done=0 AND task='$job';"