产品型号:Thinkpad E15
系统版本:centos8
安装nginx服务
[root@xuegod63 ~]# yum Install -y epel-release
[root@xuegod63 ~]# yum install -y nginx
[root@xuegod63 ~]# vim /etc/nginx/nginx.conf
在server在字段外添加配置
upstream htmlservers {
server 192.168.1.62:80;
server 192.168.1.64:80;
}
【Thinkpad E15系统 nginx负载均衡配置】如图所示:
添加反向代理,访问192.168.1.63将数据转移到另外两台服务器上
改:
51location / {
52}
为:
location / {
Proxy_pass http://htmlservers;
}
检查语法
[root@xuegod63 ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
配置xuegod62和xuegod64节点
[root@xuegod62 ~]# yum install -y httpd
[root@xuegod62 ~]# ECHO "192.168.1.62" > /var/www/html/index.html
[root@xuegod62 ~]# systemctl start httpd
[root@xuegod64 ~]# yum install -y httpd
[root@xuegod64 ~]# echo "192.168.1.64" > /var/www/html/index.html
[root@xuegod64 ~]# systemctl start httpd
访问web服务:http://192.168.1.63/
刷新页面可以看到主机页面 。
总结:
1. 安装nginx服务
2. 配置nginx负载均衡
3. 启动服务器
4. 通过访问web测试负载平衡效果的服务
- 华为MateBook X系统 ps怎么栅格化图层
- 华为MateBook X系统 cad圆的直径标注
- 华为MateBook X系统开启快速启动 win10快速启动要不要打开
- 华为官网刷机指南:更新你的设备操作系统
- 文职将军和现役将军有什么区别,请系统讲解一下。
- oa办公系统软件哪家好
- 华为鸿蒙系统使用体验
- 联想ThinkPad开机黑屏怎么办?
- 努比亚系统官网下载使用指南
- 苹果XR目前最适合的系统
