欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到云服務器

系統配置

CentOS系統下布署LVS+keepalived負載平衡高可用情況

#!/bin/bash
# BY kerryhu
# Please manual operation yum of before Operation.....
系統情況`:CentOS 5.5(定制安裝)
組件:
Base
Development Libraries
Development Tools
Editors
Text-based Internet

lvs-master:192.168.9.201
lvs-backup:192.168.9.202
vip:192.168.9.200
web1:192.168.9.203
web2:192.168.9.204
netmask:255.255.255.0
gateway:192.168.9.1

網絡拓撲:

CentOS系統下布署LVS+keepalived負載平衡高可用情況

echo "============================ 更新系統時間 ======================"
yum install -y ntp
ntpdate time.nist.gov
echo "00 01 * * * /usr/sbin/ntpdate time.nist.gov" /etc/crontab

echo “============================ 封鎖不消處事 =======================”
/root/del_servcie.sh           # 附件中自界說劇本

echo “========================= 安裝ipvsadm、keepalived ==================”
[[email protected] ~]# cd /usr/local/src
[[email protected] ~]# wget http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-1.24.tar.gz
[[email protected] ~]# wget http://www.keepalived.org/software/keepalived-1.1.17.tar.gz
[[email protected] ~]# ln -sv /usr/src/kernels/2.6.18-194.el5-i686/ /usr/src/linux
[[email protected] ~]# tar -zxvf ipvsadm-1.24.tar.gz
[[email protected] ~]# cd ipvsadm-1.24
[[email protected] ~]# make;make install
[[email protected] ~]# cd ..
[[email protected] ~]# tar -zxvf keepalived-1.1.17.tar.gz
[[email protected] ~]# cd keepalived-1.1.17
[[email protected] ~]# ./configure
configure: error:
  !!! OpenSSL is not properly installed on your system. !!!
  !!! Can not include OpenSSL headers files.
辦理步伐:
[[email protected] ~]# yum -y install openssl-devel
[[email protected] ~]# ./configure
[[email protected] ~]# make;make install
編譯的時候呈現這個提示,說明keepalived和內核團結了,假如不是這樣的,需要加上這個參數./configure --with-kernel-

dir=/kernel/path
Keepalived configuration
------------------------
Keepalived version       : 1.1.17
Compiler                 : gcc
Compiler flags           : -g -O2
Extra Lib                : -lpopt -lssl -lcrypto
Use IPVS Framework       : Yes
IPVS sync daemon support : Yes
Use VRRP Framework       : Yes
Use LinkWatch            : No
Use Debug flags          : No

echo “======================= 設置keepalived ===========================”
[[email protected] ~]#  cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/
[[email protected] ~]#  cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
[[email protected] ~]#  mkdir /etc/keepalived
[[email protected] ~]#  cp /usr/local/sbin/keepalived /usr/sbin/
[[email protected] ~]# vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
   notification_email {
      [email protected]
   }
   notification_email_from [email protected]
   smtp_server smtp.163.com
  # smtp_connect_timeout 30
   router_id LVS_DEVEL
}
# VIP1
vrrp_instance VI_1 {
    state MASTER             #備份處事器大將MASTER改為BACKUP  
    interface eth0
    lvs_sync_daemon_inteface eth0
    virtual_router_id 51
    priority 100    # 備份處事大將100改為90
    advert_int 5
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
192.168.9.200  
        #(假如有多個VIP,繼承換行填寫.)
    }
}
virtual_server 192.168.9.200 80 {
    delay_loop 6                  #(每隔10秒查詢realserver狀態)
    lb_algo wlc                  #(lvs 算法)
    lb_kind DR                  #(Direct Route)
    persistence_timeout 60        #(同一IP的毗連60秒內被分派到同一臺realserver)
    protocol TCP                #(用TCP協議查抄realserver狀態)
    real_server 192.168.9.203 80 {
        weight 100               #(權重)
        TCP_CHECK {
        connect_timeout 10       #(10秒無響應超時)
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
        }
    }
    real_server 192.168.9.204 80 {
        weight 100
        TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
        }
     }
}
[[email protected] ~]#  service keepalived start|stop
[[email protected] ~]# chkconfig –level 2345 keepalived on

騰訊云代理

Copyright © 2003-2021 MFISP.COM. 國外vps服務器租用 夢飛云服務器租用 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 扶风县| 田林县| 商洛市| 南漳县| 奉化市| 都匀市| 佛山市| 扶绥县| 永福县| 灌南县| 大余县| 广德县| 耿马| 建水县| 临沭县| 蒲城县| 平原县| 商南县| 逊克县| 科技| 浦北县| 台东市| 盘锦市| 昌都县| 高雄县| 平阴县| 乐山市| 灵武市| 满洲里市| 宣恩县| 新丰县| 师宗县| 桃园县| 靖边县| 兴仁县| 喜德县| 定安县| 莱芜市| 金秀| 红河县| 德兴市|