最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

LVS操作步骤

来源:动视网 责编:小OO 时间:2025-09-23 06:42:03
文档

LVS操作步骤

LVS操作步骤:10.8(现在改成了10.37)上的操作Shell>vi/etc/sysconfig/network-scripts/ifcfg-eth0去掉IPShell>vi/etc/sysconfig/network-scripts/ifcfg-eth1去掉IPShell>servicenetworkrestartShell>/etc/init.d/heartbeatstopShell>/etc/init.d/ldirectordstop10.37(现在改成了10.8)上的操作:Shel
推荐度:
导读LVS操作步骤:10.8(现在改成了10.37)上的操作Shell>vi/etc/sysconfig/network-scripts/ifcfg-eth0去掉IPShell>vi/etc/sysconfig/network-scripts/ifcfg-eth1去掉IPShell>servicenetworkrestartShell>/etc/init.d/heartbeatstopShell>/etc/init.d/ldirectordstop10.37(现在改成了10.8)上的操作:Shel
LVS操作步骤:

10.8(现在改成了10.37)上的操作

Shell >vi /etc/sysconfig/network-scripts/ifcfg-eth0

去掉IP

Shell >vi /etc/sysconfig/network-scripts/ifcfg-eth1

去掉IP

Shell >service network restart

Shell >/etc/init.d/heartbeat stop

Shell >/etc/init.d/ldirectord stop

10.37(现在改成了10.8)上的操作:

Shell>vi /etc/sysconfig/network-scripts/ifcfg-eth0

# Xen Virtual Ethernet

DEVICE=eth0

BOOTPROTO=none

HWADDR=7A::F8:3B:AA:C5

ONBOOT=yes

IPADDR=211.144.147.234

NETMASK=255.255.255.192

GATEWAY=211.144.147.193

TYPE=Ethernet

Shell>service network restart

Shell> vi /etc/sysconfig/network

HOSTNAME=lvs02

Shell>vi /etc/hosts

211.144.147.233 lvs01

211.144.147.234 lvs02

shell> vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

net.ipv4.conf.all.send_redirects = 0

net.ipv4.conf.default.send_redirects = 0

net.ipv4.conf.eth0.send_redirects = 0

net.ipv4.conf.eth1.send_redirects = 0

shell> sysctl -p

shell> vi /etc/ha.d/authkeys

auth 2

2 sha1 HI!

shell> chmod 600 /etc/ha.d/authkeys

shell> vi /etc/ha.d/ha.cf

logfile /var/log/ha-log 

keepalive 5       

deadtime 30       

warntime 10

initdead 120        

udpport 694

bcast eth1

ucast eth0 211.144.147.234

auto_failback on

watchdog /dev/watchdog     

node lvs01 lvs02               

ping 211.144.147.193      

respawn hacluster /usr.lib/heartbeat/ipfail

apiauth ipfail gid=haclient uid=hacluster

use_logd no

shell> vi /etc/ha.d/haresources

lvs01 211.144.147.235 ldirectord::ldirectord.cf

lvs01 211.144.147.236 ldirectord::ldirectord.cf

lvs01 211.144.147.237 ldirectord::ldirectord.cf

lvs01 211.144.147.249 ldirectord::ldirectord.cf

shell> vi /etc/ha.d/ldirectord.cf

checktimeout=3

checkinterval=1

autoreload=yes

logfile="/var/log/ldirectord.log"

quiescent=yes

virtual=211.144.147.235:80

        real=211.144.147.238:80 gate

        real=211.144.147.239:80 gate

        fallback=127.0.0.1:80 gate

        service=http

        scheduler=wlc

        #persistent=600

        #netmask=255.255.255.255

        protocol=tcp

        checktype=negotiate

        checkport=80

virtual=211.144.147.236:80

        real=211.144.147.238:80 gate

        real=211.144.147.239:80 gate

        fallback=127.0.0.1:80 gate

        service=http

        scheduler=wlc

        #persistent=600

        #netmask=255.255.255.255

        protocol=tcp

        checktype=negotiate

        checkport=80

virtual=211.144.147.237:80

        real=211.144.147.238:80 gate

        real=211.144.147.239:80 gate

        fallback=127.0.0.1:80 gate

        service=http

        scheduler=wlc

        #persistent=600

        #netmask=255.255.255.255

        protocol=tcp

        checktype=negotiate

        checkport=80

virtual=211.144.147.249:80

        real=211.144.147.252:80 gate

        real=211.144.147.253:80 gate

        fallback=127.0.0.1:80 gate

        service=http

        scheduler=wlc

        persistent=300

        #netmask=255.255.255.255

        protocol=tcp

        checktype=connect

        checkport=80

shell> chkconfig --level 35 heartbeat on

shell> service heartbeat start

 shell> chkconfig --level 35 ldirectord  on

shell> service ldirectord  start

测试:

/etc/init.d/heartbeat status

/etc/init.d/ldirectord status

Ipvsadm –l

ifconfig

10.7上的操作

Shell >vi /etc/ha.d/haresources

lvs01 211.144.147.235 ldirectord::ldirectord.cf

lvs01 211.144.147.236 ldirectord::ldirectord.cf

lvs01 211.144.147.237 ldirectord::ldirectord.cf

lvs01 211.144.147.249 ldirectord::ldirectord.cf

shell >vi /etc/ha.d/ldirectord.cf

添加:virtual=211.144.147.249:80

        real=211.144.147.252:80 gate

        real=211.144.147.253:80 gate

        fallback=127.0.0.1:80 gate

        service=http

        scheduler=wlc

        persistent=300

        #netmask=255.255.255.255

        protocol=tcp

        checktype=connect

        checkport=80

shell >/etc/init.d/heartbeat restart

shell >/etc/init.d/ldirectord restart

查看:

/etc/init.d/heartbeat status

/etc/init.d/ldirectord status

Ipvsadm –l

Ifconfig

/usr/lib/heartbeat/hb_standby 是否能够切过去!然后再切回来。

http://am.agent.b2b.cn

http://hao.b2b.cn

文档

LVS操作步骤

LVS操作步骤:10.8(现在改成了10.37)上的操作Shell>vi/etc/sysconfig/network-scripts/ifcfg-eth0去掉IPShell>vi/etc/sysconfig/network-scripts/ifcfg-eth1去掉IPShell>servicenetworkrestartShell>/etc/init.d/heartbeatstopShell>/etc/init.d/ldirectordstop10.37(现在改成了10.8)上的操作:Shel
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top