参考链接:https://mu-sl.com//archives/mysql%E9%9B%86%E7%BE%A4%E4%BD%BF%E7%94%A8nginx%E9%85%8D%E7%BD%AE%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1
文章来源:https://www.toymoban.com/news/detail-732161.html
配置文件nginx_tcp.conf 示例
load_module modules/ngx_stream_module.so;
stream{
upstream tcpssh{
hash $remote_addr consistent;
server 10.0.10.79:3306 max_fails=3 fail_timeout=10s;
server 10.0.10.111:3306 max_fails=3 fail_timeout=10s;
server 10.0.10.120:3306 max_fails=3 fail_timeout=10s;
}
server{
listen 3389;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass tcpssh;
}
}
mysql 集群搭建(双主模式)
https://mu-sl.com/archives/mysql%E9%9B%86%E7%BE%A4%E6%90%AD%E5%BB%BA%E5%8F%8C%E4%B8%BB%E5%8F%8C%E4%BB%8E%E5%8F%8C%E4%B8%BB%E7%83%AD%E5%A4%87
文章来源地址https://www.toymoban.com/news/detail-732161.html
到了这里,关于mysql集群使用nginx配置负载均衡的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!