![Heartbeat ubuntu 服务器 12.04 没有分配虚拟 ip?](https://linux22.com/image/836582/Heartbeat%20ubuntu%20%E6%9C%8D%E5%8A%A1%E5%99%A8%2012.04%20%E6%B2%A1%E6%9C%89%E5%88%86%E9%85%8D%E8%99%9A%E6%8B%9F%20ip%EF%BC%9F.png)
我有两台 nfs 服务器,并且已经在两台服务器上配置了心跳,但是当我启动心跳时,它并没有将虚拟 IP 分配给我的服务器
nfs-server-1 (eth0 172.16.203.20)
nfs-server-2 (eth0 172.16.203.21)
Virtual IP (172.16.203.23)
我配置/etc/heartbeat/ha.cf两台服务器上均相同
logfacility local0 #used to tell heartbeat which log facility to utilize for logging
keepalive 2 #interval between heartbeat packets currently every 2 secs you could also use 2000ms
deadtime 5 # timeout before the other server takes over
ping 172.16.203.20 #address to ping to determine if we are alive
udpport 694 #port to listen in on for broadcasts made by heartbeat
bcast eth0 #device to use for broadcasts
baud 38400 #speed of serial device
serial /dev/ttyS0 #serial device to use
node nfs-server-1 # dns name of one of our two nodes
node nfs-server-2 # dns name of other of our two nodes
auto_failback on # very important or auto failover won't happen
两台服务器上的情况也/etc/heartbeat/haresources
相同
nfs-server-1 IPaddr::172.16.203.23/16/eth0 nfs-kernel-server
但是当我测试我的服务器 ifconfig -a
eth0 Link encap:Ethernet direcciónHW 08:00:27:3d:a1:fb
Direc. inet:172.16.203.20 Difus.:172.16.255.255 Másc:255.255.0.0
Dirección inet6: fe80::a00:27ff:fe3d:a1fb/64 Alcance:Enlace
ACTIVO DIFUSIÓN FUNCIONANDO MULTICAST MTU:1500 Métrica:1
Paquetes RX:18934 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:5581 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:1000
Bytes RX:3556847 (3.5 MB) TX bytes:715714 (715.7 KB)
lo Link encap:Bucle local
Direc. inet:127.0.0.1 Másc:255.0.0.0
Dirección inet6: ::1/128 Alcance:Anfitrión
ACTIVO BUCLE FUNCIONANDO MTU:16436 Métrica:1
Paquetes RX:54 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:54 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:0
Bytes RX:5304 (5.3 KB) TX bytes:5304 (5.3 KB)
我的配置有什么问题?
答案1
好吧,没有人回答我,但最后我找到了解决方案,我将配置文件放在了错误的目录中,它不是/etc/heartbeat
它是/etc/ha.d
因此应该将三个重要文件复制到那里
/etc/ha.d/ha.c
/etc/ha.d/haresources
/etc/ha.d/authkeys
按照这个方法操作之后我的问题就解决了!