xywuyiba6 发表于 2019-1-7 12:39:36

Heartbeat学习笔记--HA高可用集群实现

# /etc/init.d/heartbeat start  
Starting High-Availability services: INFO:Resource is stopped
  
INFO:Resource is stopped
  
Done.
  

  
# ip add|grep 192.168.3       # 发现VIP已经绑定
  
    inet 192.168.3.23/24 brd 192.168.3.255 scope global eth1
  
    inet 192.168.3.30/24 brd 192.168.3.255 scope global secondary eth1
  
# iptables -vL    # 看到udp端口已经有心跳流量了
  
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
  
pkts bytes target   prot opt in   out   source               destination
  
   48 12296 ACCEPT   udp--any    any   anywhere             anywhere            udp dpt:ha-cluster
  
   362376 ACCEPT   all--any    any   anywhere             anywhere            state RELATED,ESTABLISHED
  
    0   0 ACCEPT   icmp --any    any   anywhere             anywhere
  
    0   0 ACCEPT   all--lo   any   anywhere             anywhere
  
    0   0 ACCEPT   tcp--any    any   anywhere             anywhere            state NEW tcp dpt:ssh
  
    1   229 REJECT   all--any    any   anywhere             anywhere            reject-with icmp-host-prohibited
  
# tcpdump -i eth2 udp -s 1500   # 对心跳线所在网卡udp端口抓包的话可以看到心跳流量
  
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  
listening on eth2, link-type EN10MB (Ethernet), capture size 1500 bytes
  
16:55:16.399325 IP 192.168.5.23.35912 > 225.0.0.1.ha-cluster: UDP, length 226
  
16:55:17.216819 IP 192.168.5.24.53014 > 225.0.0.1.ha-cluster: UDP, length 226
  
16:55:17.371805 IP 192.168.5.23.35912 > 225.0.0.1.ha-cluster: UDP, length 239
  
16:55:18.399199 IP 192.168.5.23.35912 > 225.0.0.1.ha-cluster: UDP, length 226
  
16:55:19.222381 IP 192.168.5.24.53014 > 225.0.0.1.ha-cluster: UDP, length 226
  
...
  
^C
  
16 packets captured
  
16 packets received by filter
  
0 packets dropped by kernel


页: [1]
查看完整版本: Heartbeat学习笔记--HA高可用集群实现