反馈已提交
网络繁忙
Note: Versions prior to nginx-1.14.1 have multiple security issues. nginx-1.15.6 is recommended, and users of historical versions are advised to upgrade.
You must have gcc and gcc-c++ environment, if not, you need to install it yourself, network installation command yum install gcc gcc-c++
Check command: gcc -v
nginx-1.15.6.tar.gz
3 dependency packages must be downloaded and will be used during deployment
zlib-1.2.11.tar.gz
pcre-8.42.tar.gz
openssl-1.1.1a.tar.gz
Recommended download, active health check patch package for important features
ngx_healthcheck_module-master.zip
Place the installation package in a directory, e.g. /usr/nginx, and unzip.
mkdir /usr/nginx # Create installation directorycd /usr/nginx # Go to Directorytar zxvf nginx-1.15.6.tar.gz # unzip nginx-1.15.6tar zxvf pcre-8.42.tar.gz # unzip pcretar zxvf zlib-1.2.11.tar.gz # unzip zlibtar zxvf openssl-1.1.1a.tar.gz # unzip opensslunzip ngx_healthcheck_module-master.zip # unzip ngx_healthcheck_module-master
Note: The path 「/usr/nginx」 in the third line of the command below needs to be the same as the installation directory in section 2.1; since the third line is too long, we suggest users copy the following command to the local area and confirm the path before executing it in order.
cd /usr/nginx/nginx-1.15.6 # Go to the decompression directorypatch -p1 < /usr/nginx/ngx_healthcheck_module-master/nginx_healthcheck_for_nginx_1.14+.patch # Apply health check patch./configure --prefix=/usr/nginx --with-pcre=/usr/nginx/pcre-8.42 --with-zlib=/usr/nginx/zlib-1.2.11 --with-openssl=/usr/nginx/openssl-1.1.1a --with-stream --add-module=/usr/nginx/ngx_healthcheck_module-master # 指定安装路径make && make install # The two commands connected with && will continue to execute the make install command only if make is error-free
To use Nginx with web containers for load balancing, you must also configure Nginx, and both generic and custom configurations are provided below.
Note: The Nginx configuration in this chapter only supports purely direct-connected JARs.
1)General Configuration :nginx-Genral.conf
Modify the IPs and ports of the nodes boxed in red in the file, as shown below.
2) Rename it to nginx.conf and replace the original /usr/nginx/conf/nginx.conf
vi /usr/nginx/conf/nginx.conf # Edit Configuration File nginx.conf
Refer to the Nginx configuration manual for a description of the Nginx configuration parameters, and configure them yourself (modify Nginx ports, configure extranet mapping, configure https, etc.).
cd /usr/nginx/sbin # Go to the sbin directory./nginx # Starting nginx./nginx -s stop # Stop nginx./nginx -s reload # Hot loading nginx, which can be interpreted as a reboot, but is not perceived by the user
For more information on operations and maintenance, see: Cluster Operations and Maintenance Manual - Linux Edition
Enter ip:load balancing port number/status in the browser to view the health page, you can see the node health status, if the status is up, it means normal, as shown in the following figure.
售前咨询电话
400-811-8890转1
在线技术支持
在线QQ:800049425
热线电话:400-811-8890转2
总裁办24H投诉
热线电话:173-1278-1526
文 档反 馈
鼠标选中内容,快速反馈问题
鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。
不再提示
10s后关闭