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

饮料网站建设价格wordpress建不了网站

饮料网站建设价格,wordpress建不了网站,大数据营销案例分析,中企动力做网站多久能好在测试了NginxKeepalived的负载均衡后#xff0c;也对HaproxyKeepalived双主模式做了测试#xff0c;双主的模式充分利用了服务器资源#xff0c;这样不会导致服务器浪费。 这里举例说明#xff1a; 默认情况下#xff0c;第一台负载均衡器主要分发 www.breaklinux的请求… 在测试了NginxKeepalived的负载均衡后也对HaproxyKeepalived双主模式做了测试双主的模式充分利用了服务器资源这样不会导致服务器浪费。 这里举例说明 默认情况下第一台负载均衡器主要分发 www.breaklinux的请求第二台负载均衡器主要分发img.breaklinux.com 的请求。 任意一台宕机都不会影响网站分发。实验环境 VIP1192.168.137.200 (www.zhirs.com) VIP2192.168.137.100 (img.zhirs.com) haproxy01192.168.137.254 haproxy02192.168.137.253 web1192.168.137.201 web2192.168.137.202 img1192.168.158.101 img2192.168.158.102 架构图 安装配置过程1、安装配置过程两台Haproxy的安装配置步骤一样 haproxy下载地址http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz cd /usr/local/src#wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz#tar xf haproxy-1.4.24.tar.gz#cd haproxy-1.4.24#make TARGETlinux26 ARCHx86_64#TARGET是指定内核版本ARCH指定CPU架构我使用的是64bit系统#make install2、安装完毕后创建配置文件和启动文件#mkdir /etc/haproxy#cp examples/haproxy.cfg /etc/haproxy#cp examples/haproxy.init /etc/init.d/haproxy#chmod x /etc/init.d/haproxy#ln -s /usr/local/sbin/haproxy /usr/sbin/#mkdir /usr/share/haproxy3、编辑配置文件两台Haproxy配置文件相同#vim /etc/haproxy/haproxy.cfg# this config needs haproxy-1.1.28 or haproxy-1.2.1global    log 127.0.0.1   local0  #日志输出配置所有日志都记录在本机通过local0输出    log 127.0.0.1   local1 notice    #log loghost    local0 info    maxconn 4096                #最大连接数    chroot /usr/share/haproxy   #改变当前工作目录。    uid 99                  #所属用户的uid    gid 99                  #所属运行的gid    daemon                  #以后台形式运行haproxy    #debug    #quietdefaults    log global    mode    http  #默认的模式mode { tcp|http|health }tcp是4层http是7层health只会返回OK    option  httplog    option  dontlognull    option   redispatch  #当serverId对应的服务器挂掉后强制定向到其他健康的服务器    option  abortonclose  #当服务器负载很高的时候自动结束掉当前队列处理比较久的链接    retries 3               #两次连接失败就认为是服务器不可用    maxconn 2000            #默认的最大连接数  #timeout http-keep-alive 10s  # timeout queue 1m    contimeout  5000        #连接超时    clitimeout  50000       #客户端超时    srvtimeout  50000       #服务器超时    timeout check 5s            #心跳检测超时    stats refresh 30s           #统计页面自动刷新时间    stats uri  /stats           #统计页面url    stats realm baison-test-Haproxy         #统计页面密码框上提示文本    stats auth admin:admin123           #统计页面用户名和密码设置    stats hide-version                  #隐藏统计页面上HAProxy的版本信息frontend www    bind *:80    #这里建议使用bind *:80的方式要不然做集群高可用的时候有问题vip切换到其他机器就不能访问了。    acl web hdr(host) -i www.zhirs.com    #acl后面是规则名称-i是要访问的域名如果访问www.zhirs.com这个域名就分发到下面的webserver 的作用域。    acl img hdr(host) -i img.zhirs.com    #如果访问img.baison.com.cn就分发到imgserver这个作用域。    use_backend webserver if web    use_backend imgserver if imgbackend webserver             #webserver作用域    mode http    balance   roundrobin          #banlance roundrobin 轮询balance source 保存session值支持static-rrleastconnfirsturi等参数    option  httpchk /index.html    #检测文件如果分发到后台index.html访问不到就不再分发给它    server     web01 192.168.137.201:80  check inter 2000 fall 3 weight 30   server     web01 192.168.137.202:80  check inter 2000 fall 3 weight 20   server     web01 192.168.137.203:80  check inter 2000 fall 3 weight 10backend imgserver    mode http    option  httpchk /index.php    balance     roundrobin                              server      img01 192.168.137.101:80  check inter 2000 fall 3    server      img02 192.168.137.102:80  check inter 2000 fall 3#service haproxy start##########################install keepalived################################# 5、安装配置keepalived两台keepalived安装步骤一样)#cd /root/software#wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz#tar -zxvf pcre-8.33.tar.gz#cd pcre-8.33#./configure#make make install#wget http://nginx.org/download/nginx-1.2.9.tar.gz#tar -zxvf nginx-1.2.9.tar.gz#cd nginx-1.2.9#./configure --prefix/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module#make make install6、第一台keepalived配置文件。第一台做192.168.137.200vip的master192.168.137.100的backup。#vim /etc/keepalived/keepalived.confglobal_defs {   notification_email {     admincentos.bz   }   notification_email_from keepaliveddomain.com   smtp_server 127.0.0.1   smtp_connect_timeout 30   router_id LVS_DEVEL}vrrp_script chk_http_port {                #script /opt/nginx_pid.sh                script /opt/check_haproxy.sh                interval 2                weight 2}vrrp_instance VI_1 {    state MASTER        ############ 辅机为 BACKUP    interface eth0    virtual_router_id 51    mcast_src_ip 192.168.137.254    priority 100                  ########### 权值要比 back 高    advert_int 1    authentication {        auth_type PASS        auth_pass 1111    }track_script {         chk_http_port ### 执行监控的服务         }    virtual_ipaddress {       192.168.137.200    }}vrrp_instance VI_2 {    state BACKUP    interface eth0    virtual_router_id 52    priority 99    advert_int 1    authentication {         auth_type PASS         auth_pass 1111    }    virtual_ipaddress {        192.168.137.100           }}7、第二台keepalived的配置文件。#vim /etc/keepalived/keepalived.confglobal_defs {   notification_email {     admincentos.bz   }   notification_email_from keepaliveddomain.com   smtp_server 127.0.0.1   smtp_connect_timeout 30   router_id LVS_DEVEL}vrrp_script chk_http_port {                #script /opt/nginx_pid.sh                script /opt/check_haproxy.sh                interval 2                weight 2}vrrp_instance VI_1 {    state BACKUP    interface eth0    virtual_router_id 51    mcast_src_ip 192.168.137.253    priority 99             ##########权值 要比master低    advert_int 1    authentication {        auth_type PASS        auth_pass 1111    }track_script {         chk_http_port         }    virtual_ipaddress {       192.168.137.200    }}    }}vrrp_instance VI_2 {    state MASTER    interface eth0    virtual_router_id 52    priority 100    advert_int 1    authentication {         auth_type PASS         auth_pass 1111    }    virtual_ipaddress {        192.168.137.100         }}//检测脚本为了防止haproxy服务关闭导致keepalived不自动切换######vim /opt/check_haproxy.sh#!/bin/bashif [ $(ps -C haproxy --no-header | wc -l) -eq 0 ]; then     /etc/init.d/haproxy  startfisleep 2if [ $(ps -C haproxy --no-header | wc -l) -eq 0 ]; then       /etc/init.d/keepalived stopfi##############################################################################9、启动两台keepalived和Haproxy服务。#servcie haproxy start#service keepalived start################################测试方案#############################################10、查看两台服务器的VIP 查看查看192.168.137.2542: eth0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc pfifo_fast qlen 1000link/ether 00:0c:29:dc:01:3e brd ff:ff:ff:ff:ff:ffinet 192.168.137.254/24 brd 192.168.137.255 scope global eth0inet 192.168.137.200/32 scope global eth0 查看192.168.137.253:2: eth0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc pfifo_fast qlen 1000link/ether 00:0c:29:d5:e7:3d brd ff:ff:ff:ff:ff:ffinet 192.168.137.253/24 brd 192.168.137.255 scope global eth0inet 192.168.137.100/32 scope global eth0inet6 fe80::20c:29ff:fed5:e73d/64 scope linkvalid_lft forever preferred_lft forever 11、测试关闭任意一台keepalivedimg和www域名访问正常。 后续会对NginxKeepalived 双主结果做测试。 ######################################################################################## 转载于:https://blog.51cto.com/breaklinux/1611882
http://www.zqtcl.cn/news/252202/

相关文章:

  • 无限个网站虚拟空间网站运行维护
  • 宝思哲手表网站关于计算机网站建设的论文
  • uc投放广告网站要自己做吗dw制作企业网站
  • 山东网站制作南京软件外包公司
  • 铁岭建设银行网站网站验证码原理
  • 做网站需要什么专业方向的员工钱多网站
  • 网站建设合同要存档几年7星彩网站开发
  • 网站建设好后 如何验收什么网站可以做护考题
  • 网站安全怎么做wordpress代币插件
  • 吉林网站建设电话龙华网站建设专业定制企业
  • 个人导航网站怎么备案js调用wordpress文章列表
  • 网站微信推广方案衡水外贸网站建设
  • 怎么打造自己的网站如何做自已网站
  • 美容美发网站模板wordpress适合优化吗
  • 网站开发的著作权和版权沧州市做网站价格
  • 优客逸家网站源码酒吧装修
  • 深圳网站制作的公司怎么样开工作室做网站怎样找资源
  • 大连城乡建设局网站seo编辑招聘
  • 网站建设意见怎么在中国移动做网站备案
  • 做内贸哪个网站找客户网络外包
  • 古玩网站建设意义钟山县住房和城乡建设局网站
  • 网站开发微信公众号自定义菜单规则网站建设
  • 营销网站建设工作教育培训wordpress主题
  • 温州地区做网站公司如何注册新公司
  • 做的网站怎样评估价值全国信息公示系统官网
  • 外国网站签到做任务每月挣钱1g内存vps 开电影网站
  • 营销型网站案例易网拓互联购物
  • 河南企业网站制作微信小程序如何做
  • 金坛住房和城乡建设局网站wordpress 需要授权吗
  • 个人理财的网站开发天津 公司网站建设