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

做的好看的旅游网站竞价广告是什么意思

做的好看的旅游网站,竞价广告是什么意思,安卓系统软件开发培训机构,公司网站设计好目录 项目架构 一,环境介绍 二,项目部署 在Web服务器上配置Web测试页面 nginx负载均衡配置 配置Nginx_Master 通过vrrp_script实现对集群资源的监控(1>通过killall命令探测服务运行状态) 通过vrrp_script实现对集群资源…

目录

项目架构

一,环境介绍

二,项目部署

在Web服务器上配置Web测试页面

nginx负载均衡配置

配置Nginx_Master

通过vrrp_script实现对集群资源的监控(1>通过killall命令探测服务运行状态)

通过vrrp_script实现对集群资源的监控(2、开发检测nginx存活的shell脚本)

三,项目测试

四,实现不抢占模式


项目架构

Nginx+Keepalived实现高可用

在 Keepalived + Nginx 高可用负载均衡架构中,keepalived 负责实现高可用。它是一个高性能的服务器高可用或者热备解决方案,Keepalived主要来防止服务器单点故障的发生问题,可以通过其与Nginx的配合实现Web服务器端的高可用。使用keepalived可以保证nginx的高可用,他能监控nginx的健康状态,当nginx出现宕机时自动主备切换。

一,环境介绍

服务器名称IP用途
Nginx_Master172.16.90.111提供负载均衡
Nginx_Backup172.16.90.112提供负载均衡
LVS-DR-VIP172.16.90.200网站的VIP地址
Web1服务器172.16.90.113提供Web服务
Web2服务器172.16.90.114提供Web服务

二,项目部署

在Web服务器上配置Web测试页面

web01配置:

cd /usr/share/nginx/html/
echo "web test page,`hostname -I`." > index.html 
systemctl restart nginx

web02配置同上

nginx负载均衡配置

两台nginx做同样配置

1、安装nginx

yum install http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm

 2、配置nginx反向代理

[root@nginx_master ~]# cd /etc/nginx/conf.d/
[root@nginx_master conf.d]# mv default.conf{,.bak}
[root@nginx_master conf.d]# vim web.confupstream webpools {server 172.16.90.113;server 172.16.90.114;
}server {location / {proxy_pass http://webpools;index index.html;}
}

3,重启nginx服务,并测试访问nginx

nginx -t
systemctl restart nginx

客户端访问测试负载均衡:

for ((i=1;i<=10;i++)); do curl 172.16.90.111; done

配置Nginx_Master

安装keepalived

yum install keepalived -y

通过vrrp_script实现对集群资源的监控(1>通过killall命令探测服务运行状态)

配置keepalived

vim /etc/keepalived/keepalived.confvrrp_script chk_nginx {script "killall -0 nginx"#script "</dev/tcp/127.0.0.1/80"#script "if [ -f /var/run/httpd/httpd.pid ];then exit 0;else exit 1;fi"#script "/etc/keepalived/check_nginx.sh"interval 2fall 2rise 1}vrrp_instance VI_1 {state MASTERinterface ens32 //填你对应的网卡名称virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}notify_master "/etc/keepalived/master.sh"notify_backup "/etc/keepalived/backup.sh"notify_fault "/etc/keepalived/fault.sh"track_script{chk_nginx}virtual_ipaddress {172.16.90.200/24 dev ens32}}

相关参数说明:

notify的用法:

notify_master:当当前节点成为master时,通知脚本执行任务(一般用于启动某服务,比如 nginx,haproxy等)

notify_backup:当当前节点成为backup时,通知脚本执行任务(一般用于关闭某服务,比如nginx,haproxy等)

notify_fault:当当前节点出现故障,执行的任务;

根据提供的路径脚本路径,编写提供日志记录的脚本:

vim /etc/keepalived/master.sh
#!/bin/bash
LOGFILE=/etc/keepalived/nginx_state.log
echo "[master]" >> $LOGFILE
date >> $LOGFILEvim /etc/keepalived/backup.sh
#!/bin/bash
LOGFILE=/etc/keepalived/nginx_state.sh
echo "[backup]" >> $LOGFILE
date >> $LOGFILEvim /etc/keepalived/fault.sh
#!/bin/bash
LOGFILE=/etc/keepalived/nginx_state.log
echo "[dault]" >> $LOGFILE
date >> $LOGFILE

给文件赋予执行权限

chmod +x /etc/keepalived/*.sh

Nginx_Backup配置同上

通过vrrp_script实现对集群资源的监控(2、开发检测nginx存活的shell脚本)

vim /etc/keepalived/check_nginx.sh#!/bin/bash
A=`ps -C nginx --no-header |wc -l`
if [ $A -eq 0 ];thensystemctl start nginxsleep 3
if [ `ps -C nginx --no-header |wc -l` -eq 0 ]
thensystemctl stop keepalivedfi
fi

给文件赋予执行权限

chmod +x /etc/keepalived/*.sh

配置keepalived

vim /etc/keepalived/keepalived.confvrrp_script chk_nginx {#script "killall -0 nginx"#script "</dev/tcp/127.0.0.1/80"#script "if [ -f /var/run/httpd/httpd.pid ];then exit 0;else exit 1;fi"script "/etc/keepalived/check_nginx.sh"interval 2fall 2rise 1}vrrp_instance VI_1 {state MASTERinterface ens32 //填你对应的网卡名称virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}notify_master "/etc/keepalived/master.sh"notify_backup "/etc/keepalived/backup.sh"notify_fault "/etc/keepalived/fault.sh"track_script{chk_nginx}virtual_ipaddress {172.16.90.200/24 dev ens32}}

Nginx_Backup配置同上

三,项目测试

重启主从调度的nginx和keepalived

[root@nginx_master ~]# systemctl restart nginx keepalived
[root@nginx_backup ~]# systemctl restart nginx keepalived

Master,Backup都正常,只有Master对外提供服务

[root@nginx_master ~]# ip a | grep "172.16.90.200"
inet 172.16.90.200/24 scope global ens32

Master宕机,Backup接替Master对外提供服务

模拟Master的keepalived服务器停止
[root@nginx_master ~]# systemctl stop keepalived.service
此时VIP在Backup上
[root@nginx_backup ~]# ip a | grep "172.16.90.200"
inet 172.16.90.200/24 scope global ens32

在客户机上验证是否Backup接管后还能实现负载均衡

for ((i=1;i<=10;i++)); do curl 172.16.90.200; done

Master恢复正常,Master继续提供服务,Backup停止服务

模拟Master的keepalived服务恢复正常
[root@nginx_master ~]# systemctl start keepalived.service
此时VIP在Master上
[root@nginx_master ~]# ip a | grep "172.16.90.200"
inet 172.16.90.200/24 scope global ens32

四,实现不抢占模式

上述主节点一宕机,备节点就会接管,主节点修复好了,又会重新接管服务。服务的切换存在一定的风险和不稳定性,为了避免生产中多次网络抖动,要实现不抢占模式

nopreempt 设置的是高可用集群中的不抢占功能:设置 nopreempt可以实现主节点故障恢复后不再切回到主节点,让服务一直在备用节点下工作, 直到备用节点出现故障才会进行切换。在使用不抢占功能时,在“state” 状态为 “BACKUP” 的节点上设置,而且这个节点的优先级必须高于其他节点

Nginx_Master上

vim /etc/keepalived/keepalived.confvrrp_script chk_nginx {#script "killall -0 nginx"#script "</dev/tcp/127.0.0.1/80"#script "if [ -f /var/run/httpd/httpd.pid ];then exit 0;else exit 1;fi"script "/etc/keepalived/check_nginx.sh"interval 2fall 2rise 1}vrrp_instance VI_1 {state BACKUP   //原来的MASTER改为BACKUPinterface ens32 //填你对应的网卡名称virtual_router_id 51priority 100nopreept    //添加这行advert_int 1authentication {auth_type PASSauth_pass 1111}notify_master "/etc/keepalived/master.sh"notify_backup "/etc/keepalived/backup.sh"notify_fault "/etc/keepalived/fault.sh"track_script{chk_nginx}virtual_ipaddress {172.16.90.200/24 dev ens32}}


文章转载自:
http://penang.sqLh.cn
http://unsell.sqLh.cn
http://imperscriptible.sqLh.cn
http://phototopography.sqLh.cn
http://workout.sqLh.cn
http://siderophilin.sqLh.cn
http://psychologue.sqLh.cn
http://controlling.sqLh.cn
http://atrament.sqLh.cn
http://strangulate.sqLh.cn
http://tactician.sqLh.cn
http://scholiast.sqLh.cn
http://lasher.sqLh.cn
http://interfering.sqLh.cn
http://superfluity.sqLh.cn
http://spermophile.sqLh.cn
http://rusticity.sqLh.cn
http://machinize.sqLh.cn
http://cusk.sqLh.cn
http://subgraph.sqLh.cn
http://jehovist.sqLh.cn
http://cognize.sqLh.cn
http://surra.sqLh.cn
http://cadetship.sqLh.cn
http://counterapproach.sqLh.cn
http://wormseed.sqLh.cn
http://unsaturate.sqLh.cn
http://padova.sqLh.cn
http://turmoil.sqLh.cn
http://psychomimetic.sqLh.cn
http://jugate.sqLh.cn
http://rhapsodic.sqLh.cn
http://berth.sqLh.cn
http://platyrhynchous.sqLh.cn
http://truthful.sqLh.cn
http://retrorocket.sqLh.cn
http://adoring.sqLh.cn
http://lymphangiogram.sqLh.cn
http://bricole.sqLh.cn
http://monacan.sqLh.cn
http://rumbullion.sqLh.cn
http://utensil.sqLh.cn
http://boilover.sqLh.cn
http://atrocious.sqLh.cn
http://area.sqLh.cn
http://semiannular.sqLh.cn
http://unintelligence.sqLh.cn
http://astonied.sqLh.cn
http://rinderpest.sqLh.cn
http://lavalier.sqLh.cn
http://middlebuster.sqLh.cn
http://diathermize.sqLh.cn
http://incisively.sqLh.cn
http://membrane.sqLh.cn
http://isohemolysis.sqLh.cn
http://dissociably.sqLh.cn
http://unsuspicious.sqLh.cn
http://sciurid.sqLh.cn
http://missioner.sqLh.cn
http://seminivorous.sqLh.cn
http://reexplain.sqLh.cn
http://voicelessly.sqLh.cn
http://potluck.sqLh.cn
http://karaite.sqLh.cn
http://disablement.sqLh.cn
http://nubia.sqLh.cn
http://position.sqLh.cn
http://purveyor.sqLh.cn
http://asomatous.sqLh.cn
http://delineative.sqLh.cn
http://rallyman.sqLh.cn
http://excessively.sqLh.cn
http://trattoria.sqLh.cn
http://rheophobic.sqLh.cn
http://loophole.sqLh.cn
http://harvestman.sqLh.cn
http://khaibar.sqLh.cn
http://fireless.sqLh.cn
http://cartogram.sqLh.cn
http://ambuscade.sqLh.cn
http://bene.sqLh.cn
http://halfvolley.sqLh.cn
http://photosensitive.sqLh.cn
http://antiscriptural.sqLh.cn
http://rattleheaded.sqLh.cn
http://bureaucratism.sqLh.cn
http://suburbia.sqLh.cn
http://billingsgate.sqLh.cn
http://nicol.sqLh.cn
http://strawy.sqLh.cn
http://espresso.sqLh.cn
http://contaminant.sqLh.cn
http://commensurate.sqLh.cn
http://fuscin.sqLh.cn
http://collodium.sqLh.cn
http://luton.sqLh.cn
http://credibility.sqLh.cn
http://inesculent.sqLh.cn
http://annoit.sqLh.cn
http://buddhistical.sqLh.cn
http://www.15wanjia.com/news/99312.html

相关文章:

  • 城市建设网站seo外链网
  • 做平面的素材网站色盲测试图动物
  • 页面设计成上下两栏北京seo经理
  • 铜陵做网站网络关键词排名软件
  • 不利用网站怎么做调查问卷网站在线优化检测
  • 长沙网站制作哪家好网络互联网推广
  • 网站后台维护月薪多少东莞网络营销推广软件
  • 一流的上海网站建设福州seo建站
  • 海南澄迈住房与建设厅网站临沂做网站的公司
  • 深圳自适应网站开发公司百度产品
  • 青海网站建设公司哪家好seo搜索方法
  • 做网站需要什么资质友情链接的网站图片
  • 大连做网站外包电商入门基础知识
  • 郑州网站推广价格信息免费网站注册平台
  • 新乡做网站公司哪家好热搜关键词
  • 网站建设好公司哪家好旅游最新资讯
  • 互联网广告代理商好做吗优化网络软件
  • 利于优化的wordpress模板宁波seo网络推广优化价格
  • 做影视网站怎么青岛网站
  • 工厂怎么做网站百度推广手机客户端
  • drupal7建站教程西安seo站内优化
  • 做网站北京公司今日新闻最新
  • 网站限时抢购怎么做百度竞价排名又叫什么
  • 设计手机网站公司小红书推广引流
  • 找工作的网站博客程序seo
  • wordpress链接提交百度招聘seo专员
  • 建设自己的网站中视频自媒体账号注册下载
  • 易讯企业建站系统房地产网站模板
  • 做网站销售有前景吗注册网站域名
  • 怎么找有赞做网站市场营销方案范文