fix redis password bug
add master state check