0

I have a simple heartbeat setup that watches my 2 servers and transfers the ip public to another server in case of a crash

/etc/heartbeat/haresources

server1 192.168.1.203 nginx

However I would like nginx to be active on both servers (192.168.1.201 and 192.168.1.202) so that I can balance the backsteam load (why not, server is up anyway !)

unfortunately nginx takes over startup and shutdown of niginx leaving nginx not started on one server.

What is the best way to deal with this ?

Thx !

1 Answers1

2

You can simply remove the word nginx from /etc/heartbeat/haresources. So, the line will read:

server1 192.168.1.203

Don't forget to make sure nginx is started automatically during system startup.

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • thx, but please correct me if im wrong (and I probably am) but adding nginx to the line make heartbeat monitor nginx right ? So in case the server is up but nginx is down this wouldn't cause the ip to switch ? – Floortje Sep 20 '12 at 13:57
  • @Floortje: heartbeat does not monitor services by default unless you combine it with some other tool like pacemaker. You can try to use [monit](http://mmonit.com/monit/) if you don't want to go into the complications of adding service monitoring to heartbeat. – Khaled Sep 20 '12 at 14:03
  • Ok thx ! Great awnser I will go and study more !! – Floortje Sep 20 '12 at 14:05