Hi,
I am running MySQL replication setting with 2 nodes Master/Slave configuration.
If Slave status(secs_behind) is lager than Master's parameter(max_slave_lag),
Slave data is outdated, right?
check_slave() in mysql RA would run "crm_master -v 0" in this
situation to mark Slave as "outdated",
but if Master is shut down in this status,
Slave will be able to promote instead of its old data.
(is this correct?)
It seems that "crm_master -v -INFINITY" is effectual to prevent Slave promotion.
check_slave() {
# Checks slave status
<snip>
elif ocf_is_ms; then
# Even if we're not set to evict lagging slaves, we can
# still use the seconds behind master value to set our
# master preference.
local master_pref
master_pref=$((${OCF_RESKEY_max_slave_lag}-${secs_behind}))
if [ $master_pref -lt 0 ]; then
# Sanitize a below-zero preference to just zero
master_pref=0
fi
$CRM_MASTER -v $master_pref
fi
I'm less familiar with the replication behavior,
please advise me how to do it.
Regards,
Junko IKEDA
NTT DATA INTELLILINK CORPORATION
I am running MySQL replication setting with 2 nodes Master/Slave configuration.
If Slave status(secs_behind) is lager than Master's parameter(max_slave_lag),
Slave data is outdated, right?
check_slave() in mysql RA would run "crm_master -v 0" in this
situation to mark Slave as "outdated",
but if Master is shut down in this status,
Slave will be able to promote instead of its old data.
(is this correct?)
It seems that "crm_master -v -INFINITY" is effectual to prevent Slave promotion.
check_slave() {
# Checks slave status
<snip>
elif ocf_is_ms; then
# Even if we're not set to evict lagging slaves, we can
# still use the seconds behind master value to set our
# master preference.
local master_pref
master_pref=$((${OCF_RESKEY_max_slave_lag}-${secs_behind}))
if [ $master_pref -lt 0 ]; then
# Sanitize a below-zero preference to just zero
master_pref=0
fi
$CRM_MASTER -v $master_pref
fi
I'm less familiar with the replication behavior,
please advise me how to do it.
Regards,
Junko IKEDA
NTT DATA INTELLILINK CORPORATION