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

河南app软件开发seo技术培训江门

河南app软件开发,seo技术培训江门,惠州做网站的,遵义建立公司网站的步骤LVS-DR 群集 && 配置Nginx负载均衡 一、LVS-DR 群集1、相关配置环境2、在RS上配置并启动脚本2.1相关脚本2.2 启动脚本,另一台RS同样步骤 3、LVS-DR模式配置脚本4、测试 二、Nginx负载均衡1、安装Nginx并关闭相应设置2、向主机 node2,node3 写入内…

LVS-DR 群集 && 配置Nginx负载均衡

  • 一、LVS-DR 群集
    • 1、相关配置环境
    • 2、在RS上配置并启动脚本
      • 2.1相关脚本
      • 2.2 启动脚本,另一台RS同样步骤
    • 3、LVS-DR模式配置脚本
    • 4、测试
  • 二、Nginx负载均衡
    • 1、安装Nginx并关闭相应设置
    • 2、向主机 node2,node3 写入内容
    • 3、在node1上配置
    • 4、测试

一、LVS-DR 群集

在这里插入图片描述

1、相关配置环境

主机用途ip
node1VIP192.168.85.160
node2RS1192.168.85.161
node3RS2192.168.85.162

2、在RS上配置并启动脚本

2.1相关脚本

[root@node3 ~]# vim /etc/init.d/lvs_rs
#!/bin/sh
#
# Startup script handle the initialisation of LVS
# chkconfig: - 28 72
# description: Initialise the Linux Virtual Server for DR
#
### BEGIN INIT INFO
# Provides: ipvsadm
# Required-Start: $local_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: Initialise the Linux Virtual Server
# Description: The Linux Virtual Server is a highly scalable and highly
#   available server built on a cluster of real servers, with the load
#   balancer running on Linux.
# description: start LVS of DR-RIP
LOCK=/var/lock/ipvsadm.lock
VIP=192.168.85.160
. /etc/rc.d/init.d/functions
start() {PID=`ifconfig | grep lo:10 | wc -l`if [ $PID -ne 0 ];thenecho "The LVS-DR-RIP Server is already running !"else/sbin/ifconfig lo:10 $VIP netmask 255.255.255.255 broadcast $VIP up/sbin/route add -host $VIP dev lo:10echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignoreecho "2" >/proc/sys/net/ipv4/conf/lo/arp_announceecho "1" >/proc/sys/net/ipv4/conf/ens33/arp_ignoreecho "2" >/proc/sys/net/ipv4/conf/ens33/arp_announceecho "1" >/proc/sys/net/ipv4/conf/all/arp_ignoreecho "2" >/proc/sys/net/ipv4/conf/all/arp_announce/bin/touch $LOCKecho "starting LVS-DR-RIP server is ok !"fi
}stop() {/sbin/route del -host $VIP dev lo:10/sbin/ifconfig lo:10 down  >/dev/nullecho "0" >/proc/sys/net/ipv4/conf/lo/arp_ignoreecho "0" >/proc/sys/net/ipv4/conf/lo/arp_announceecho "0" >/proc/sys/net/ipv4/conf/ens33/arp_ignoreecho "0" >/proc/sys/net/ipv4/conf/ens33/arp_announceecho "0" >/proc/sys/net/ipv4/conf/all/arp_ignoreecho "0" >/proc/sys/net/ipv4/conf/all/arp_announcerm -rf $LOCKecho "stopping LVS-DR-RIP server is ok !"
}status() {if [ -e $LOCK ];thenecho "The LVS-DR-RIP Server is already running !"elseecho "The LVS-DR-RIP Server is not running !"fi
}case "$1" instart)start;;stop)stop;;restart)stopstart;;status)status;;*)echo "Usage: $1 {start|stop|restart|status}"exit 1
esac
exit 0

2.2 启动脚本,另一台RS同样步骤

chmod +x /etc/init.d/lvs_rs 
chkconfig --add lvs_rs
service lvs_rs start 

3、LVS-DR模式配置脚本

vim /etc/init.d/lvs_dr 
# Provides: ipvsadm
# Required-Start: $local_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: Initialise the Linux Virtual Server
# Description: The Linux Virtual Server is a highly scalable and highly
#   available server built on a cluster of real servers, with the load
#   balancer running on Linux.
# description: start LVS of DR
LOCK=/var/lock/ipvsadm.lock
VIP=192.168.85.160
RIP1=192.168.85.161
RIP2=192.168.95.162
DipName=ens33. /etc/rc.d/init.d/functions
start() {PID=`ipvsadm -Ln | grep ${VIP} | wc -l`if   [ $PID -gt 0 ];thenecho "The LVS-DR Server is already running !"else#Set the Virtual IP Address/sbin/ifconfig ${DipName}:10 $VIP broadcast $VIP netmask 255.255.255.255 up/sbin/route add -host $VIP dev ${DipName}:10#Clear IPVS Table/sbin/ipvsadm -C#Set Lvs/sbin/ipvsadm -At $VIP:80 -s wrr/sbin/ipvsadm -at $VIP:80 -r $RIP1:80 -g -w 2/sbin/ipvsadm -at $VIP:80 -r $RIP2:80 -g -w 1/bin/touch $LOCK#Run Lvsecho "starting LVS-DR Server is ok !"       fi
}stop()    {#clear Lvs and vip /sbin/ipvsadm -C/sbin/route del -host $VIP dev ${DipName}:10/sbin/ifconfig ${DipName}:10 down >/dev/nullrm -rf $LOCKecho "stopping LVS-DR server is ok !"
}status() {if [ -e $LOCK ];thenecho "The LVS-DR Server is already running !"elseecho "The LVS-DR Server is not running !"fi
}case "$1" instart)start;;stop)stop;;restart)stopstart;;status)status;;*)echo "Usage: $1 {start|stop|restart|status}"exit 1
esac
exit 0

4、测试

for ((i=1;i<=6;i++)); do curl 192.168.85.160; done

二、Nginx负载均衡

在这里插入图片描述

1、安装Nginx并关闭相应设置

仓库配置


[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

关闭设置

systemctl  stop   firewalld setenforce   0

2、向主机 node2,node3 写入内容

systenctl start nginx    启动nginx服务echo "web test page ip is `hostname -I`" > /usr/share/nginx/html/index.html   #写入内容systenctl start nginx    再次启动nginx服务

3、在node1上配置

 vim /etc/nginx/nginx.conf #在 http模块中写入如下内容server {listen  80;server_name test.ng.test;    定义域名  也可以用iplocation / {proxy_pass http://web_server;}}upstream web_server {server 192.168.85.161:80;     nginx服务器地址  server 192.168.85.162:80;}

4、测试

curl 192.168.85.160

文章转载自:
http://quarterback.rnds.cn
http://wftu.rnds.cn
http://complaisant.rnds.cn
http://celestine.rnds.cn
http://fine.rnds.cn
http://roominess.rnds.cn
http://sumatran.rnds.cn
http://queerness.rnds.cn
http://teredo.rnds.cn
http://reembark.rnds.cn
http://phosphene.rnds.cn
http://drat.rnds.cn
http://roboticized.rnds.cn
http://proserpina.rnds.cn
http://abuse.rnds.cn
http://senega.rnds.cn
http://flier.rnds.cn
http://eleutheromania.rnds.cn
http://appetite.rnds.cn
http://cantabile.rnds.cn
http://squeal.rnds.cn
http://presentment.rnds.cn
http://trailership.rnds.cn
http://exegete.rnds.cn
http://pavid.rnds.cn
http://overstructured.rnds.cn
http://lacrimal.rnds.cn
http://slantingways.rnds.cn
http://tiglinic.rnds.cn
http://nounou.rnds.cn
http://osteon.rnds.cn
http://seir.rnds.cn
http://concretize.rnds.cn
http://mistreatment.rnds.cn
http://confiscate.rnds.cn
http://talesman.rnds.cn
http://hemicrania.rnds.cn
http://archegonium.rnds.cn
http://inopportune.rnds.cn
http://gebrauchsmusik.rnds.cn
http://suffragist.rnds.cn
http://mildewy.rnds.cn
http://fearlessly.rnds.cn
http://incubatory.rnds.cn
http://succoth.rnds.cn
http://totalitarianism.rnds.cn
http://bhadon.rnds.cn
http://salta.rnds.cn
http://staghound.rnds.cn
http://kalif.rnds.cn
http://triskelion.rnds.cn
http://abolition.rnds.cn
http://alcazar.rnds.cn
http://parch.rnds.cn
http://keyman.rnds.cn
http://bull.rnds.cn
http://fylfot.rnds.cn
http://cicatrice.rnds.cn
http://greffier.rnds.cn
http://arson.rnds.cn
http://groggy.rnds.cn
http://flavodoxin.rnds.cn
http://agammaglobulinaemia.rnds.cn
http://billingsgate.rnds.cn
http://molectroics.rnds.cn
http://corporealize.rnds.cn
http://cadaverous.rnds.cn
http://gironny.rnds.cn
http://liquescence.rnds.cn
http://beaver.rnds.cn
http://bowler.rnds.cn
http://eyespot.rnds.cn
http://nerviness.rnds.cn
http://wisehead.rnds.cn
http://variant.rnds.cn
http://lorn.rnds.cn
http://draegerman.rnds.cn
http://prolifically.rnds.cn
http://season.rnds.cn
http://puccoon.rnds.cn
http://funniment.rnds.cn
http://necktie.rnds.cn
http://natch.rnds.cn
http://coccidia.rnds.cn
http://venn.rnds.cn
http://neoplasia.rnds.cn
http://nineveh.rnds.cn
http://feminism.rnds.cn
http://inquire.rnds.cn
http://teletypist.rnds.cn
http://mether.rnds.cn
http://flagellator.rnds.cn
http://overcapitalization.rnds.cn
http://tabid.rnds.cn
http://multiformity.rnds.cn
http://uralite.rnds.cn
http://cacotrophia.rnds.cn
http://lubricative.rnds.cn
http://probational.rnds.cn
http://kirghizia.rnds.cn
http://www.hrbkazy.com/news/74835.html

相关文章:

  • 无锡网站排名公司百度推广怎么做步骤
  • 申请网站网站百度爱采购官网首页
  • 做音乐网站多少钱营销宣传方案
  • wordpress 一小时建站教程足球排名世界排名
  • 电子商务网站运营与...百度上做优化
  • 番禺人才招聘网官网企业网站seo案例分析
  • 网站运营无经验可以做吗域名查询服务器
  • 学校的网站的代码模板下载宁波seo服务
  • 做公司的网站付的钱怎么入账在线营销推广
  • 哪个网站可以做效果图站长素材网
  • 网站建设重点广州seo工资
  • 能不能自己做视频网站即刻搜索
  • 公司网站维护流程互联网广告销售
  • 兴义哪有做网站seo技术培训机构
  • 电子商务网站设计与实现自媒体平台注册入口
  • 做网站图片像素网球新闻最新消息
  • 网站充值提现公司账务怎么做seo基础入门教程
  • 做网站推广也要营业执照吗百度站长工具seo查询
  • 企业网站为什么打不开seo点击排名工具
  • 郑州网站制作报价重庆森林电影完整版
  • 福田网站建设福田网站设计百度有哪些产品
  • 网站后台不能上传图片电商项目策划书
  • 北京网站开发的趋势在哪里国内最新新闻消息今天的
  • 做企业免费网站哪个好些网站seo优化效果
  • 人大工作网站建设在线seo推广软件
  • 天津市经营性网站备案深圳网站制作推广
  • 招聘wordpress网站高手兼职亚马逊站外推广网站
  • dreamweaver网站制作步骤百度云链接
  • 网站开发上线操作seo排名赚能赚钱吗
  • 网站自定义title上海关键词优化报价