1

I have been trying to place two virtual machine with heartbeat. osboxes and osboxes2.

When I run nmap localhost this is the output:

Nmap scan report for localhost (127.0.0.1)
Host is up (0.00017s latency).
Not shown: 991 closed ports
PORT      STATE SERVICE
22/tcp    open  ssh
25/tcp    open  smtp
53/tcp    open  domain
80/tcp    open  http
443/tcp   open  https
631/tcp   open  ipp
3306/tcp  open  mysql
9050/tcp  open  tor-socks
10000/tcp open  snet-sensor-mgmt

Here is the tcpdump of such interface eth0:

18:38:22.267817 IP 192.168.141.135.48748 > 192.168.141.255.694: UDP, length 315
18:38:22.268640 IP 192.168.141.135.38234 > osboxes2.694: UDP, length 315
18:38:22.269421 IP osboxes2 > 192.168.141.135: ICMP osboxes2 udp port 694 unreachable, length 351

As you can see udp port 694 unreachable. When i try to ping osboxes from osboxes2:

PING 192.168.141.137 (192.168.141.137) 56(84) bytes of data.
64 bytes from 192.168.141.137: icmp_seq=1 ttl=64 time=0.284 ms
64 bytes from 192.168.141.137: icmp_seq=2 ttl=64 time=0.291 ms
64 bytes from 192.168.141.137: icmp_seq=3 ttl=64 time=0.681 ms

ha.cf file from osboxes:

#Arquivo de log de debug:
logfile /var/log/ha-log

#Arquivo de log
debugfile /var/log/ha-debug

#Para onde vai os logs
logfacility local0

#Frequencia em segundo de batimentos cardicados
keepalive 2

#Tempo indica a morte do node
deadtime 25

#Tempo que o heartbeat deve esperar por beats (nao o beat dos beatboxes)
warntime 10

#Tempo maximo para declarar o outro servidor morto
initdead 50

#Porto de sincronia
udpport 694

#Endereco de broadcast da rede
bcast eth0

#Nao entendi. Se for preciso vai la procurar depois.
ucast eth0 192.168.141.137

#Determinar se o servidor volta para o master caso ele responda
auto_failback on

#Nome dos nodes do cluster
node osboxes2
node osboxes

haresourcers from osboxes:

osboxes 192.168.141.135 apache

It's worth noting that osboxes(principal node) is 192.168.141.135 and osboxes2 is 192.168.141.137.

I guessing the problem resides in the port 694 not opened since it is unreachable.

  • 1
    Do you get any error message when you try to start the heartbeat process? – David King Dec 22 '15 at 18:49
  • No. Everything is running smothly besides the `port unreachable`. I had to delete `hb_regeneration` from the `/var/lib/heartbeat` because of some error that I can't remember of. – Bruno Francisco Dec 22 '15 at 19:07
  • I'm looking at `syslog` and I saw this: `Dec 22 18:48:42 osboxes heartbeat: [8933]: info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth0 Dec 22 18:48:42 osboxes heartbeat: [8933]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth0 - Status: 1 `. I don't know if it's relevant to the question. – Bruno Francisco Dec 22 '15 at 19:09
  • No `iptables` rules active? – wurtel Dec 23 '15 at 08:08
  • @wurtel there is no IP tables rules up. – Bruno Francisco Dec 25 '15 at 13:35

1 Answers1

0

Try removing the bcast line from your configuration (or just commenting it out).

By defining ucast and bcast you're essentially telling heartbeat to use two different communication types (unicast and broadcast), which might be confusing things.

The linux-ha.org wiki has some documentation regarding all the possible directives for the heartbeat config: http://linux-ha.org/wiki/Ha.cf

Most of that information can also be found in the man page as well: # man ha.cf

Matt Kereczman
  • 669
  • 3
  • 7
  • something strange just happened. I fired up the virtual machine and `tcpdump -i eth0` and there wasn't any `port unreachable` anymore. After 5 minutes with the machine up i start to get `port unreachable` again. I commented out the `bcast` line as you advised me to, unfortunately with no lucky. – Bruno Francisco Dec 25 '15 at 13:37
  • I have changed the port to 80 at `udpport` and it works fine for now. I wonder if there is any problem with changing the port to an `http`. Any security reasons or any other reason? – Bruno Francisco Dec 25 '15 at 13:45