Tengine健康检查模块配置

来源:互联网 发布:mac怎么卸载驱动 编辑:程序博客网 时间:2024/05/16 17:48

Step 1:
在node11节点执行命令

vi /opt/apps/tengine/conf/nginx.conf

添加如下属性:

    upstream test {            server 192.168.80.11:8080  weight=2;            server 192.168.80.12:8080  weight=1;           check interval=3000 rise=2 fall=5 timeout=1000 type=http;           check_http_send "HEAD / HTTP/1.0\r\n\r\n";           check_http_expect_alive http_2xx http_3xx;        }

这里写图片描述

Step 2:
在nginx.conf配置文件http—server下面添加如下属性

        location /status {         check_status;        }

这里写图片描述

Step 3:
在nginx.conf配置文件http—server—location下面添加如下属性

location / {           proxy_pass http://test;           root   html;            index  index.html;

这里写图片描述

Step 4:
在node11节点执行命令,启动tengine

service nginxd start

这里写图片描述

Step 5:
打开浏览器,输入网址进行查看
http://192.168.80.11/status
这里写图片描述

原创粉丝点击