function log() {
time_now=`date +%F-%T`
echo "$time_now $1"
}
function log_red() {
time_now=`date +%F-%T`
echo -e "$time_now \033[31;49;1m $1 \033[39;49;0m"
}
function log_blue() {
time_now=`date +%F-%T`
echo -e "$time_now \033[34;49;1m $1 \033[39;49;0m"
}
log_blue "Step0 Port $PORT,开始主从切换"
log "当前的主从关系如下: "
log "Master $MASTER_IP"
log "Slave $SLAVE_IP"
log "Backup $BACKUP_IP"