当前位置: 首页 > news >正文

网站的建设外链优化企业网站的宣传功能体现在().

网站的建设外链优化,企业网站的宣传功能体现在().,网站关键词的分类,网络设计的步骤一、环境准备 1.准备三台rhel9服务器 服务器名称 主机名 ip地址备注LVS调度服务器lvs.timinglee.org eth0:172.25.254.100(外网) eth1:192.168.0.100(内网) 关闭selinux和防火墙webserver2网站服务器webserver1.timinglee.orgeth0:192.168.…

一、环境准备

1.准备三台rhel9服务器

服务器名称

主机名

ip地址备注
LVS调度服务器lvs.timinglee.org

eth0:172.25.254.100(外网)

eth1:192.168.0.100(内网)

关闭selinux和防火墙
webserver2网站服务器webserver1.timinglee.orgeth0:192.168.0.10(内网)关闭selinux和防火墙
webserver2网站服务器webserver2.timinglee.orgeth0:192.168.0.20(内网)关闭selinux和防火墙

2.实验拓扑

二、LVS-NAT模式部署

# 版本
[root@lvs ~]# hostnamectl Static hostname: lvs.timinglee.orgIcon name: computer-vmChassis: vm ??Machine ID: 4748448370474b72a05bc780ede57860Boot ID: de3da80744f044728475c9c7388a2f1cVirtualization: vmware
Operating System: Red Hat Enterprise Linux 9.1 (Plow)     CPE OS Name: cpe:/o:redhat:enterprise_linux:9::baseosKernel: Linux 5.14.0-162.6.1.el9_1.x86_64Architecture: x86-64Hardware Vendor: VMware, Inc.Hardware Model: VMware Virtual Platform
# lvs主机网卡配置
[root@lvs ~]# cat /etc/NetworkManager/system-connections/eth0.nmconnection 
[connection]
id=eth0
type=ethernet
interface-name=eth0[ipv4]
address1=172.25.254.100/24,172.25.254.2
method=manual
dns=114.114.114.114;
[root@lvs ~]# cat /etc/NetworkManager/system-connections/eth1.nmconnection 
[connection]
id=eth1
type=ethernet
interface-name=eth1[ipv4]
address1=192.168.0.100/24
method=manualwebserver1网卡配置,配置网关
[root@webserver1 ~]# cat /etc/NetworkManager/system-connections/eth0.nmconnection 
[connection]
id=eth0
type=ethernet
interface-name=eth0[ipv4]
address1=192.168.0.10/24,192.168.0.100
method=manual
dns=114.114.114.114;webserver2网卡配置,配置网关
[root@webserver2 ~]# cat /etc/NetworkManager/system-connections/eth0.nmconnection 
[connection]
id=eth0
type=ethernet
interface-name=eth0[ipv4]
address1=192.168.0.20/24,192.168.0.100
method=manual
dns=114.114.114.114;

 1.给webserver1,webserver2服务器安装httpd

[root@webserver1 ~]# yum install httpd -y
[root@webserver1 ~]# echo webserver1 - 192.168.0.10 > /var/www/html/index.html
[root@webserver1 ~]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.[root@webserver2 ~]# yum install httpd -y
[root@webserver2 ~]# echo webserver1 - 192.168.0.20 > /var/www/html/index.html
[root@webserver2 ~]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

2.在LVS服务器中检测

[root@lvs ~]# ipvsadm -A -t ^C
[root@lvs ~]# curl 192.168.0.10
webserver1 - 192.168.0.10
[root@lvs ~]# curl 192.168.0.20
webserver2 - 192.168.0.20

 3.在LVS服务器中安装LVS

[root@lvs ~]# yum install ipvsadm.x86_64 -y

 4.新建LVS集群

[root@lvs ~]# ipvsadm -A -t 172.25.254.100:80 -s rr
[root@lvs ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  172.25.254.100:80 rr

5.添加Real Server服务器节点

-a     添加真实服务器
-d     删除真实服务器
-r     指定真实服务器(Real Server)的地址
-m     使用NAT模式;另外 -g 对应DR模式、-i 对应TUN模式
-w     为节点服务器设置权重,默认为1,只有设置加权轮询或者加权最小连接才生效#将两个web服务器加入LVS集群,-m表示为NAT模式[root@lvs ~]# ipvsadm -a -t 172.25.254.100:80 -r 192.168.0.10:80 -m
[root@lvs ~]# ipvsadm -a -t 172.25.254.100:80 -r 192.168.0.20:80 -m
[root@lvs ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  172.25.254.100:80 rr-> 192.168.0.10:80              Masq    1      0          0         -> 192.168.0.20:80              Masq    1      0          0         
[root@lvs ~]# #补充:如果想删除节点,将-a换成-d即可

6.开启路由转发模式

因为LVS的工作原理是路由转发,所以LVS调度服务器需要开启路由转发[root@lvs ~]# sysctl -a | grep ip_forward
net.ipv4.ip_forward = 0
net.ipv4.ip_forward_update_priority = 1
net.ipv4.ip_forward_use_pmtu = 0[root@lvs ~]# cat /etc/sysctl.conf 
# 定位最后一行添加
net.ipv4.ip_forward = 1# 生效
[root@lvs ~]# sysctl -p
net.ipv4.ip_forward = 1

7.效果测试

[root@lvs ~]# curl 172.25.254.100
web2 - 192.168.0.20
[root@lvs ~]# curl 172.25.254.100
web1 - 192.168.0.10
[root@lvs ~]# 
[root@lvs ~]# for i in {1..10}
> do
> curl 172.25.254.100
> done
web2 - 192.168.0.20
web1 - 192.168.0.10
web2 - 192.168.0.20
web1 - 192.168.0.10
web2 - 192.168.0.20
web1 - 192.168.0.10
web2 - 192.168.0.20
web1 - 192.168.0.10
web2 - 192.168.0.20
web1 - 192.168.0.10

如上可以看到轮询负载均衡效果!!! 

http://www.yayakq.cn/news/951573/

相关文章:

  • php网站开发技术与开源系统应用 实训指导书人工智能在线ai写作网站
  • 国外中文网站域名注册商网站备案掉了
  • 建设行业协会网站发展的建议seo推广品牌排行榜
  • 微网站开发程序鞭打wordpress
  • 如何自建外贸网站陶哲轩 wordpress
  • 特价手机网站建设佛山app定制
  • 成都 网站建设 公司哪家好优化关键词快速排名
  • asp 手机网站番禺网站开发哪家强
  • 河南郑州网站建设wordpress 登录框
  • 如何恢复网站首页的排名 站长温州最大的外贸公司
  • 网站建设工资高吗什么网站做设计可以赚钱吗
  • 深圳哪家做网站好wordpress中文下载方法
  • 做阿里巴巴网站卖货咋样深圳品牌设计工作室
  • 天津网站建设教程网页设计代码
  • 自己做的网站怎么赚钱吗梦幻西游源码论坛
  • 长春网站设计门户网站建设先进性
  • 外贸网站建设 公司protected wordpress login
  • 毕设 网站开发的必要性免费建设门户网站
  • 百度站内搜索代码网站开发学校 优帮云
  • 网站开发亿玛酷1专注网站首页被k怎么恢复
  • 衡阳网站建设icp备上海公共招聘网app下载
  • 中国建设银行个人网站秦皇岛市妇幼保健院
  • 开设一个网站的费用营口市代做网站
  • 假视频网站源码出售销客多
  • 常州网站建设cz35山西工程建设招标网
  • 城乡建设部网站造价工程师查询微网站建设要多少钱
  • 织梦网站地图制作传扬互动网站建设公司
  • 河南免费网站建设公司推荐海宁公司做网站
  • 分类信息网站系统网站开发语言字典
  • 河南手机网站制作公司手机网站视频怎么下载