nginx负载+mysql8.0双主实现

load_module '/usr/local/nginx/modules/ngx_stream_module.so';

stream {
server {
listen 8080;
proxy_pass db;
}
upstream db {
server 1.1.1.1:3306 weight=2 max_fails=2 fail_timeout=20;
server 1.1.1.1:3306 weight=3 max_fails=2 fail_timeout=30;
}
}

events {
worker_connections 1024;
}

http {
}

}

 

posted @ 2021-12-13 17:45  ershoushouji  阅读(131)  评论(0编辑  收藏  举报