DEV Community

Roy
Roy

Posted on

2 1

nginx, consul, mysql high availability

昨天晚上睡觉的时候想,可以用nginx为 MySQL 做反向代理,upstream server 只有一个, backup upstream server 则为另一个,这样可以保证只往一个MySQL实例当中写,upstream server 中使用consul提供的域名,由consul提供健康检测,或者用其它机制检测两台MySQL的健康状态,更新 consul kv 存储, consul-template 更新nginx 配置文件

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay