current position:Home>Openresty introduces nginx_ upstream_ check_ Module module

Openresty introduces nginx_ upstream_ check_ Module module

2022-04-29 06:55:04lgq2016

openresty Use nginx Health check , But the original nginx This function is not available , Need to introduce nginx_upstream_check_module Patch and recompile . Now let's briefly introduce how to introduce the health examination module . The following code introduces the health check , The specific meaning will not be introduced .

upstream mr_api {
    server 10.1.1.1:8080;
    server 10.1.1.2:8080;
    check interval=3000 rise=2 fall=5 timeout=2000 type=http;
    check_http_send "HEAD / HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx http_4xx;
}

Previously installed openresty The directory for :/usr/local/openresty/openresty-1.19.9.1, install openresty Please read the previous article openresty Installation and use _lgq2016 The blog of -CSDN Blog

The following describes the specific installation steps .

1. Download the health check module and extract it to the specified path

To github Compressed package next week https://github.com/yaoweibin/nginx_upstream_check_modul

Up there github Download the compressed package from the website and unzip it to the directory /usr/local/openresty/openresty-1.19.9.1/bundle:

unzip nginx_upstream_check_module-master.zip

mv nginx_upstream_check_module-master /usr/local/openresty/openresty-1.19.9.1/bundle

2. Patch Nginx_http_upstream_check_module

cd /usr/local/openresty/openresty-1.19.9.1/bundle/nginx-1.19.9

patch -p1 < ../nginx_upstream_check_module-master/check_1.16.1+.patch  (1.19.9 Satisfy 1.16.1+)

3. To configure nginx_upstream_check_module

cd ../..

./configure --add-module=./bundle/nginx_upstream_check_module-master/

4. Compilation and installation

make

make install

5. restart nginx

Specify profile

/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf

Restart the service

/usr/local/openresty/nginx/sbin/nginx -s reload

copyright notice
author[lgq2016],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204260559165997.html

Random recommended