switch.md 1.09 KB

# 双中心切换

切换到 AZ2

流程:

  • 切换 mysql master/slavemaster 切换到 az2

  • 更新内部dns server配置

    • ansible-playbook -i inventories/az2/hosts playbooks/yoho.dns.master_to_az2.yml
    • ansible-playbook -i inventories/az3/hosts playbooks/yoho.dns.master_to_az2.yml
    • ansible-playbook -i inventories/az1/hosts playbooks/yoho.dns.master_to_az2.yml
  • 刷新 cobar server:

    • ansible-playbook -i inventories/az2/hosts playbooks/cobar.reload.yml
    • ansible-playbook -i inventories/az3/hosts playbooks/cobar.reload.yml
    • ansible-playbook -i inventories/az1/hosts playbooks/cobar.reload.yml
  • 所有流量切换到 AZ2

    • ansible-playbook -i 127.0.0.1 playbooks/lb-manager.yml --extra-vars "module=switch_to_az2"
  • 重启JAVA服务

    • ansible-playbook -i inventories/az2/hosts playbooks/java.restart_all.yml
    • ansible-playbook -i inventories/az1/hosts playbooks/java.restart_all.yml
    • ansible-playbook -i inventories/az3/hosts playbooks/java.restart_all.yml