(centos7) linux build nginx load balancing build

http://creativecommons.org/licenses/by-sa/4.0/ Copyright statement: This article is the original article of the blogger, and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting.

  Link to this article: [https://blog.csdn.net/qq_37933685/article/details/82192354](https://blog.csdn.net/qq_37933685/article/details/82192354)

Into the pitload balancing

  1. Virtual machine preparation, I am a linux development machine + 4 centos virtual machines
  2. Virtual machine preparation environment: ngnix server needs to open port 80 (ngnix default port) to ensure that all machines can be pinged (that is, network communication between servers), business server environment: jre1.8, open business ports (Mine is port 8888)
  3. (The installation process of nginx is below) Configure nginx reverse proxy
    The content of the ngnix.conf modified file should be configured as follows, which can be customized
# Source of response data
 upstream tomcats { 
  server 192.168.0.202:8888 weight=1;
  server 192.168.0.203:8888 weight=1;
  server 192.168.0.204:8888 weight=1;}

 server {
  listen       80;
  server_name  veng_bike;

  location ~.*{
   proxy_pass http://tomcats;}}

Install nginx process##

  1. Upload the nginx installation package
  2. Unzip nginx
    tar -zxvf nginx-1.12.2.tar.gz -C /usr/local/src/
  3. Enter the source directory of nginx
    cd /usr/local/src/nginx-1.12.2/
  4. Precompiled
    . /configure
  5. Quiet gcc compiler
    yum -y install gcc pcre-devel openssl openssl-devel
  6. Then execute
    . /configure
  7. Compile and install nginx
    make && make install
  8. Start nginx
    sbin/nginx
  9. View nginx process
    ps -ef | grep nginx
    netstat -anpt | grep nginx

Recommended Posts

(centos7) linux build nginx load balancing build
Build Nginx environment on Linux (CentOS)
Configure Nginx load balancing based on CentOS 7
Linux (centos7) build gitlab
Centos7.3 install nginx
CentOS7 build jenkins
Centos build lnmp
Centos7 build python3.8.5+scrapy+gerapy
Centos7 install Nginx
How to quickly build Nginx server under CentOS
CentOS MONO nginx running
CentOS build private git
Linux Network Foundation (CentOS7)
Build k8s1.9.9 on centos7
CentOS6.7 build LNMP environment
Centos6.9 build rabbitmq 3.6.8 cluster
Centos7.6 build LNMP environment
Linux Centos7 install jdk1.8
Centos7 build Kubernetes cluster
CentOS uses Nginx to build a download function server
Jenkins build on centos
Linux notes (1): CentOS-7 installation
Build Hadoop in CentOS
Centos7 build DNS service
Linux CentOS 7 installation tutorial
CentOS 7 build LNMP environment
Centos 7 install JDK (Linux install jdk)
Build docker environment under Centos6.5
[Linux] Build Samba server (ubuntu16.04)
CentOs7.3 build Solr stand-alone service
CentOs7.3 build RabbitMQ 3.6 stand-alone service
Build zabbix monitoring zabbix4.2 in CentOS7.6
Know Linux and install CentOS
CentOs7.3 compile and install Nginx 1.9.9
Build OpenLDAP server under CentOS7
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build MariaDB replication on CentOS
Linux Centos7 install redis tutorial
Install MySQL 8.0.16 on Linux Centos
CentOs7.3 build ZooKeeper-3.4.9 stand-alone service
3 partitioning tools under CentOS Linux
Install MySQL under Linux (CentOS 7)
Linux CentOS 7 virtual machine clone
CentOs7.3 build SolrCloud cluster service
CentOS 6.8 under linux install mongodb
Install Nginx server on CentOS 7
CentOS8 Linux 8.0.1905 installation process (illustration)
Linux centos system boot process