标签:opp shel eof proc 好的 运行 ast 安装 nal
一、架构说明负载均衡列表:
test-kube-nginx-lb-01 172.18.1.12
test-kube-nginx-lb-02 172.18.1.10
cat >> /etc/nginx.conf << EOF
worker_processes 4;
worker_rlimit_nofile 40000;
events {
worker_connections 8192;
}
stream {
upstream rancher_servers_http {
least_conn;
server 172.18.1.4:80 max_fails=3 fail_timeout=5s;
server 172.18.1.5:80 max_fails=3 fail_timeout=5s;
server 172.18.1.9:80 max_fails=3 fail_timeout=5s;
}
server {
listen 80;
proxy_pass rancher_servers_http;
}
upstream rancher_servers_https {
least_conn;
server 172.18.1.4:443 max_fails=3 fail_timeout=5s;
server 172.18.1.5:443 max_fails=3 fail_timeout=5s;
server 172.18.1.9:443 max_fails=3 fail_timeout=5s;
}
server {
listen 443;
proxy_pass rancher_servers_https;
}
}
EOF
以容器的形式运行nginx服务,而不需要把它安装在宿主机上。将编辑好的NGINX示例配置文件保存到/etc/nginx.conf,并运行以下命令来启动NGINX容器:
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 -v /etc/nginx.conf:/etc/nginx/nginx.conf nginx:1.14
标签:opp shel eof proc 好的 运行 ast 安装 nal
原文地址:https://blog.51cto.com/wangpengtai/2413411