Find the answer to your Linux question:
Results 1 to 7 of 7
i have heartbeat configured on a backup server. i know it's working, but not as it should be. even if the primary server is still up and very much alive, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Aug 2003
    Posts
    289

    confused with heartbeat setup


    i have heartbeat configured on a backup server. i know it's working, but not as it should be. even if the primary server is still up and very much alive, backup takes over the IP. more like forces the primary server to give it up. i'm testing it on httpd and ftp services. this is my setup:

    s1 <-- primary with httpd and ftpd
    s2 <-- backup with heartbeat and same services

    the docs on heartbeat are kinda vague. from what i've read, and i've found different docs on the net but very much alike, it says that you should have heartbeat running on both machines. although it didn't say this directly, i'm assuming that it is since it explicitly said that authkeys and haresources should be identical on both machines.

    i was under the impression that s2 should be the only1 running heartbeat, as it's purpose is just to listen to s1 and take over in case of failure. i did this and s2 takes over, forcefully, in a few seconds (30). in this setup only s1 has httpd and ftpd running. s2 httpd and ftpd services are down.

    i did another thing, which is have heartbeat run on both machines, with haresources pointing to primary like this:

    s2 192.168.0.1 httpd ftpd

    i start heartbeat on s2. ok.
    i start it on s1 and it warns me that resources are not idle and should be. heartbeat still starts.

    after a few seconds the same thing happens above, s2 takes IP from s1 and runs httpd and ftpd. in this case s1 has httpd and ftpd running, while s2 services are down.

    i re-read the docs i found again, and this time i found out that in haresources, it is talking of another IP which is neither s1 or s2 (in my case).

    so if i have this:

    s1 <-- 192.168.0.1, primary
    s2 <-- 192.168.0.2, backup

    now in the docs' haresources it's like this

    s1 192.168.0.3 httpd ftpd

    ok, so where did 192.168.0.3 come in? in the first place it was talking about 2 machines with different IPs. is it saying that one machine, the backup maybe, should have another IP assigned to it?

    do i need to have heartbeat run on both machines?

    i'm really confused on this.

    Registered User #345074

  2. #2
    Just Joined!
    Join Date
    Sep 2007
    Posts
    4
    Hey, I think that you do have to run the httpd service on the 192.168.0.3 address. that way its running in heartbeat, and not necessarily on the machines. At least that is what I'm trying to do. I haven't got on running yet, but my goal is to get an httpd server running with heartbeat.

    Will you let me know if you get it and what steps you are taking to get there? Thanks!!!

  3. #3
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    I have used webmin to configure heartbeat and it made configuring it very easy.

    I do believe heartbeat has to be on both computers and heartbeat talks to each other. to know what is alive.

    In addition, I would combine this with MON so you can actually monitor a service and see if the service died instead of just the machine.

    Apache failover with heartbeat and mon
    7.7.* Detailed Instructions on Heartbeat Configuration &mdash; Cendio ThinLinc

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Sep 2007
    Posts
    4
    YOu are the man!

    Would the httpd service run inside of heartbeat on the 192.168.0.3 address? I am just trying to understand the concept of how it works.

    I tried using webmin, but when I installed the httpd service under recources but it always says "down". Does webmin work with heartbeat2?

    i will check that site out.

  6. #5
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    Quote Originally Posted by foxyguitarman View Post
    YOu are the man!

    Would the httpd service run inside of heartbeat on the 192.168.0.3 address? I am just trying to understand the concept of how it works.

    I tried using webmin, but when I installed the httpd service under recources but it always says "down". Does webmin work with heartbeat2?

    i will check that site out.


    the httpd service will run seperatly from heartbeat. if you have 2 machines in the cluster, you need 3 ip address, one will be the virtual address that gets taken over and then other 2 will be for each machine, repsectively. heartbeat then talks to heartbeat on the other server and they work out who is the primary and who is the secondary and then take over the ip.

    I prefer to then use MON to monitor the process and when MON detects that the process has died have it run a script to also kill heartbeat, which causes a failover to the secondary.

    and there isn't much that webmin doesn't work with, its a very valuable tool.

  7. #6
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2

    Heartbeat v.2 and scripts

    Hey all,

    I was just wondering if there was a way to have heartbeat run a particular script/change the script it would normally use when it goes to startup apache?

    Any info would help! We have a particualar way that we've compiled apache and I'm not sure how I can get it to work with heartbeat except through running this script that we normally run to start apache...

    Thanks!

  8. #7
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    Quote Originally Posted by missimo79 View Post
    Hey all,

    I was just wondering if there was a way to have heartbeat run a particular script/change the script it would normally use when it goes to startup apache?

    Any info would help! We have a particualar way that we've compiled apache and I'm not sure how I can get it to work with heartbeat except through running this script that we normally run to start apache...

    Thanks!
    I would say this looks like a seperate topic. regardless, HeartbeatResourceAgent: Linux HA

    you can put your custom script in /etc/ha.d/resource.d/ and have heartbeat call it from there

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •