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

域名注册以后怎样做网站淮南品牌型网站建设

域名注册以后怎样做网站,淮南品牌型网站建设,网站内容规划流程,编程开发工具大全LVS Keepalived 高可用集群Keepalived的设计目标是构建高可用的LVS负载均衡的集群#xff0c;可以调用ipvsadm工具创建虚拟机#xff0c;不仅仅用作双机热备#xff0c;还可以使用keepalived构建更加方便快捷的节点#xff0c;进行相关的健康检查#xff0c;自动移除失效…LVS Keepalived 高可用集群Keepalived的设计目标是构建高可用的LVS负载均衡的集群可以调用ipvsadm工具创建虚拟机不仅仅用作双机热备还可以使用keepalived构建更加方便快捷的节点进行相关的健康检查自动移除失效节点恢复后再重新加入。在基于LVSKeepalived实现的LVS群集结构中至少包括两台热备的负载调度器三台以上的节点服务器。此博客将以DR模式的LVS群集为基础增加一台从负载调度器使用Keepalived来实现主、从调度器的热备从而构建兼有负载均衡、高可用两种能力的LVS网站群集平台。案例如下使用Keepalived构建LVS群集时也需要用到ipvsadm管理工具但大部分工作会由Keepalived自动完成不需要手动执行ipvsadm(除了查看和监控群集以外)。环境分析1)、2个调度器和2个web节点使用同一个网段地址可以直接和外网通信。为了共享存储的安全性一般将web节点和存储服务器规划到内网环境所以web节点必须有两个及以上网卡的接口。2)、我这里资源有限也为了配置方便所以调度器和web节点分别只有两个在web访问请求量不大的情况下足够了但是若访问请求比较大那么最少要分别配置三个调度器和web节点如果只有两个web节点的话访问量又比较大那么一旦有一个宕机了那剩下一个独苗必定会因为扛不住激增的访问请求而被打死。3)、准备系统映像以便安装相关服务。4)、自行配置防火墙策略和除了VIP之外的IP地址(我这里直接关闭了防火墙)。5)、keepalived会自动调用IP_vs模块所以无需手动加载。最终效果1)、客户端多次访问群集的VIP得到的是同一个网页。2)、主调度器宕机后群集的VIP地址将会自动漂移到从(备份)调度器此时所有的调度任务由从调度器进行分配。当主调度器恢复运行后群集的VIP地址会自动转移回主调度器主调度器继续工作从调度器转回备份状态。3)、web节点宕机后会被keepalived健康检查功能检测到从而自动在web节点池中去除宕机的节点待web节点恢复运行后会被自动添加到web节点池中。开始配置LVSKeepalived高可用群集部署第一台Web服务器[rootcentos01 ~]# yum -y install httpd [rootcentos01 ~]# echo www.benet.com /var/www/html/index.html [rootcentos01 ~]# systemctl start httpd [rootcentos01 ~]# systemctl enable httpd[rootcentos01 ~]# cp /etc/sysconfig/network-scripts/ifcfg-lo/etc/sysconfig/network-scripts/ifcfg-lo:0 [rootcentos01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-lo:0 DEVICElo:0 IPADDR192.168.100.253 NETMASK255.255.255.255 ONBOOTyes[rootcentos01 ~]# systemctl restart network [rootcentos01 ~]# ifconfig lo: flags73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 488 bytes 39520 (38.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 488 bytes 39520 (38.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo:0: flags73 mtu 65536 inet 192.168.100.253 netmask 255.255.255.255 loop txqueuelen 1 (Local Loopback)[rootcentos01 ~]# vim /etc/sysctl.conf net.ipv4.conf.all.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.default.arp_ignore 1net.ipv4.conf.default.arp_announce 2net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.lo.arp_announce 2[rootcentos01 ~]# sysctl -p net.ipv4.conf.all.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.default.arp_ignore 1net.ipv4.conf.default.arp_announce 2net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.lo.arp_announce 2部署第二台Web服务器[rootcentos02 ~]# yum -y install httpd [rootcentos02 ~]# echo www.accp.com /var/www/html/index.html [rootcentos02 ~]# systemctl start httpd [rootcentos02 ~]# systemctl enable httpd [rootcentos02 ~]# scp root192.168.100.10:/etc/sysconfig/network-scripts/ifcfg-lo:0/etc/sysconfig/network-scripts/The authenticity of host 192.168.100.10 (192.168.100.10) cant be established.ECDSA key fingerprint is SHA256:PUueT9fU9QbsyNB5NC5hbSXzaWxxQavBxXmfoknXl4I.ECDSA key fingerprint is MD5:6d:f7:95:0e:51:1a:d8:9e:7b:b6:3f:58:51:51:4b:3b.Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 192.168.100.10 (ECDSA) to the list of known hosts.root192.168.100.10s password: ifcfg-lo:0 100% 70 53.3KB/s 00:00[rootcentos02 ~]# scp root192.168.100.10:/etc/sysctl.conf /etc/sysctl.conf root192.168.100.10s password: sysctl.conf 100% 660 304.3KB/s 00:00[rootcentos02 ~]# systemctl restart network [rootcentos02 ~]# ifconfig lo: flags73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 496 bytes 40064 (39.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 496 bytes 40064 (39.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo:0: flags73 mtu 65536 inet 192.168.100.253 netmask 255.255.255.255 loop txqueuelen 1 (Local Loopback)[rootcentos02 ~]# sysctl -p net.ipv4.conf.all.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.default.arp_ignore 1net.ipv4.conf.default.arp_announce 2net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.lo.arp_announce 2部署主调度器[rootcentos04 ~]# yum -y install keepalived ipvsadm [rootcentos04 ~]# vim /etc/sysctl.conf .....................net.ipv4.conf.all.send_redirects 0net.ipv4.conf.default.send_redirects 0net.ipv4.conf.ens33.send_redirects 0[rootcentos04 ~]# sysctl -p net.ipv4.conf.all.send_redirects 0net.ipv4.conf.default.send_redirects 0net.ipv4.conf.ens33.send_redirects 0[rootcentos04 ~]# cd /etc/keepalived/[rootcentos04 keepalived]# cp keepalived.conf keepalived.conf.bak [rootcentos04 keepalived]# vim keepalived.conf ! Configuration File for keepalivedglobal_defs { router_id LVS_DEVEL1}vrrp_instance VI_1 { state MASTER interface ens32 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.100.253 }}virtual_server 192.168.100.253 80 { delay_loop 6 lb_algo rr lb_kind DR persistence_timeout 50 protocol TCP real_server 192.168.100.10 80 { weight 1 TCP_CHECK { connect_port 80 connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } } real_server 192.168.100.20 80 { weight 1 TCP_CHECK { connect_port 80 connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } }} [rootcentos04 ~]# systemctl restart keepalived [rootcentos04 ~]# systemctl enable keepalived 配置从调度器[rootcentos05 ~]# yum -y install ipvsadm keepalived [rootcentos05 ~]# scp root192.168.100.40:/etc/sysctl.conf /etc/root192.168.100.40 s password: sysctl.conf 100% 566 205.8KB/s 00:00[rootcentos05 ~]# sysctl -p net.ipv4.conf.all.send_redirects 0net.ipv4.conf.default.send_redirects 0net.ipv4.conf.ens33.send_redirects 0[rootcentos05 ~]# scp root192.168.100.40:/etc/keepalived/keepalived.conf/etc/keepalived/ root192.168.100.40s password: keepalived.conf 100% 803 2.1MB/s 00:00[rootcentos05 ~]# vim /etc/keepalived/keepalived.conf router_id LVS_HA_Backup state BACKUP interface ens32 priority 99 [rootcentos05 ~]# systemctl start keepalived [rootcentos05 ~]# chkconfig --level 35 keepalived on 至此主、从调度器也配置完成了若需要部署多个从调度器按照以上这个从(备份)调度器配置即可。配置客户端访问客户端测试访问VIP地址192.168.100.253为了测试所以才在每个web节点准备不同的网页文件以便测试是否有负载均衡的效果现在效果已经有了所以要搭建共享存储服务器所有的web节点都从共享存储服务器读取网页文件向client提供以便向client提供相同的网页文件。接下来开始配置共享存储服务器配置NFS服务器[rootcentos03 ~]# yum -y install rpcbind nfs-utils [rootcentos03 ~]# mkdir /web [rootcentos03 ~]# echo www.nfs.com /web/index.html [rootcentos03 ~]# vim /etc/exports /web 192.168.100.10(ro) 192.168.100.20(rw)[rootcentos03 ~]# systemctl start rpcbind [rootcentos03 ~]# systemctl enable rpcbind [rootcentos03 ~]# systemctl enable nfs [rootcentos03 ~]# showmount -e 192.168.100.30 Export list for 192.168.100.30:/web 192.168.100.20,192.168.100.10Web站点挂载共享存储目录Web节点1服务器挂载共享目录[rootcentos01 ~]# mount 192.168.100.30:/web /var/www/html/ [rootcentos01 ~]# cat /var/www/html/index.html www.nfs.com[rootcentos01 ~]# vim /etc/fstab 192.168.100.30:/web /var/www/html/ nfs defaults 0 0[rootcentos01 ~]# systemctl restart httpd Web节点2服务器挂载共享目录[rootcentos02 ~]# mount 192.168.100.30:/web /var/www/html/ [rootcentos02 ~]# cat /var/www/html/index.html www.nfs.com[rootcentos02 ~]# vim /etc/fstab 192.168.100.30:/web /var/www/html/ nfs defaults 0 0[rootcentos02 ~]# systemctl restart httpd 客户端再次访问测试这次客户端无论怎么刷新看到的页面永远都是www.nfs.com案例相关的查询命令VIP在哪个调度器上查询该调度器承载VIP地址的物理接口即可看到VIP地址(VIP地址在备份调度器上查不到的)[rootcentos04 ~]# ip a show dev ens32 ens32: ate UP groupn 1000 link/ether 00:0c:29:77:2c:03 brd ff:ff:ff:ff:ff:ff inet 192.168.100.40/24 brd 192.168.100.255 scope global noprefixroute ens32 valid_lft forever preferred_lft forever inet 192.168.100.253/32 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::95f8:eeb7:2ed2:d13c/64 scope link noprefixroute valid_lft forever preferred_lft forever查询有哪些web节点[rootcentos04 ~]# ipvsadm -ln IP Virtual Server version 1.2.1 (size4096)Prot LocalAddress:Port Scheduler Flags - RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.100.253:80 rr persistent 50 - 192.168.100.10:80 Route 1 0 0 - 192.168.100.20:80 Route 1 0 0模拟第二台Web节点和主调度器故障并在备份调度器上再次查询VIP以及web节点[rootcentos05 ~]# ip a show dev ens32 ens32: ate UP groupn 1000 link/ether 00:0c:29:77:2c:03 brd ff:ff:ff:ff:ff:ff inet 192.168.100.40/24 brd 192.168.100.255 scope global noprefixroute ens32 valid_lft forever preferred_lft forever inet 192.168.100.253/32 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::95f8:eeb7:2ed2:d13c/64 scope link noprefixroute valid_lft forever preferred_lft forever[rootcentos05 ~]# ipvsadm -ln IP Virtual Server version 1.2.1 (size4096)Prot LocalAddress:Port Scheduler Flags - RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.100.253:80 rr - 192.168.100.10:80 Route 1 0 0查看调度器故障切换时的日志消息[rootcentos05 ~]# tail -30 /var/log/messages
http://www.huolong8.cn/news/414790/

相关文章:

  • 做网站 属于电子商务做网站的有哪些学校
  • 网站密码如何找回密码学校网站管理与建设
  • 云南个旧建设局网站免费的网站推广怎么做效果好?
  • 中国可信网站查询页面设计优缺点
  • 网站建设报价模板下载app产品网站模板
  • 手机网站欢迎页面设计wordpress无法在线安装插件
  • 该网站未在腾讯云备案wordpress前端编辑器
  • 兰州网站排名分析WordPress禁止多ip
  • 工信部网站黑名单网站的绝对路径
  • 竞价托管就选微竞价成都seo达人
  • 国外网站服务器免费网站底部加备案号
  • 企业网站建设的三种方式并举例北京吴勇设计工作室
  • icp备案查看网站内容吗响应式网页设计与制作
  • 现在做网站一般多少钱020网站建设
  • 河南网站建设公司价格可以自己做图片的软件
  • 模板网站有哪些在哪里下载小说网页设计代码模板
  • 域名连接网站游戏交易网站建设
  • 为什么自己做的网站用QQ打不开建站网站那个好
  • wordpress与微信公众号南阳网站优化渠道
  • 互联网建站大连市住建局官方网
  • 杭州网站建设路网站正在建设 英文翻译
  • 网站模仿算侵权吗俄罗斯网站域名注册
  • 建设购物网站的条件磁力狗
  • 北京专业制作网站公司吗国内外贸seo推广平台排名
  • 顶尖的设计网站共和网站建设公司
  • 专业做苗木的网站wordpress批量评论
  • html5 metro风格网站模板wordpress 充值积分插件
  • 东莞公司建设网站宿迁企业做网站
  • 成品网站短视频源码搭建免费erp系统是怎样的一个软件
  • 做网站背景图的科技图片海报生成免费