LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-22-2009, 05:40 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Rep: Reputation: 81
Question Heartbeat and Apache2 on Debian


I'm following this tutorial about heartbeat & apache on CentOS, however my boxes are debian:

http://www.howtoforge.com/high_avail...artbeat_centos

I'm able to follow everything, however, when I tried to restart apache2 (without starting heartbeat) I got an error message that it couldn't bind to the virtual address. That's OK because hb wasn't started. I started it without problems... however, even though point 14 of teh tutorial says that heartbeat will take care of creating the virtual address, I got the same error. I _guess_ I'm missing something in the hb configuration... even more considering that i didn't state the virtual address anywhere in the process.... so what do I have to correct in the procedure?

Thanks in advance
 
Old 08-22-2009, 10:04 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
hearbeat start apache by itself if setup correctly.
 
Old 08-23-2009, 10:44 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Original Poster
Rep: Reputation: 81
<<What do you mean? When I ask heartbeat to start, it will start apache automagically? Then how does it know where apache is? Because there's no instructions on this kind of tweaking.
 
Old 08-24-2009, 09:49 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Original Poster
Rep: Reputation: 81
I did a little advancement.

Instead of using httpd as the name of the service in haresources, I set it to apache2, which is the name of the script in /etc/init.d. Also, in that file I get to write the virtual address to be used by heartbeat, so I was wrong in my first post when i said that I didn't set the virtual address anywhere.

Having made that correction, I still can't get apache to run.

I have node2 active, node1 down (shut down heartbeat service). apache is not running in node2. When I start heartbeat on node1, here's the output of heartbeat's logs:

node1:
Code:
heartbeat[6853]: 2009/08/24_09:37:22 WARN: Core dumps could be lost if multiple dumps occur.
heartbeat[6853]: 2009/08/24_09:37:22 WARN: Consider setting non-default value in /proc/sys/kernel/core_pattern (or equivalent) for maximum supportability
heartbeat[6853]: 2009/08/24_09:37:22 WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability
heartbeat[6853]: 2009/08/24_09:37:22 info: Version 2 support: false
heartbeat[6853]: 2009/08/24_09:37:22 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat[6853]: 2009/08/24_09:37:22 info: **************************
heartbeat[6853]: 2009/08/24_09:37:22 info: Configuration validated. Starting heartbeat 2.1.3
heartbeat[6854]: 2009/08/24_09:37:23 info: heartbeat: version 2.1.3
heartbeat[6854]: 2009/08/24_09:37:23 info: Heartbeat generation: 1250979590
heartbeat[6854]: 2009/08/24_09:37:23 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth0
heartbeat[6854]: 2009/08/24_09:37:23 info: glib: UDP Broadcast heartbeat closed on port 694 interface eth0 - Status: 1
heartbeat[6854]: 2009/08/24_09:37:23 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat[6854]: 2009/08/24_09:37:23 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat[6854]: 2009/08/24_09:37:23 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat[6854]: 2009/08/24_09:37:23 info: Local status now set to: 'up'
heartbeat[6854]: 2009/08/24_09:37:24 info: Link apache2:eth0 up.
heartbeat[6854]: 2009/08/24_09:37:24 info: Status update for node apache2: status active
heartbeat[6854]: 2009/08/24_09:37:24 info: Link apache1:eth0 up.
heartbeat[6854]: 2009/08/24_09:37:25 info: Comm_now_up(): updating status to active
heartbeat[6854]: 2009/08/24_09:37:25 info: Local status now set to: 'active'
heartbeat[6854]: 2009/08/24_09:37:25 WARN: G_CH_dispatch_int: Dispatch function for read child took too long to execute: 80 ms (> 50 ms) (GSource: 0x9e0cdd0)
heartbeat[6854]: 2009/08/24_09:37:25 WARN: standby message [other] from apache2 ignored.  Other side is in flux.
heartbeat[6854]: 2009/08/24_09:37:25 info: remote resource transition completed.
heartbeat[6854]: 2009/08/24_09:37:25 info: remote resource transition completed.
heartbeat[6854]: 2009/08/24_09:37:25 info: Local Resource acquisition completed. (none)
harc[6861]:     2009/08/24_09:37:26 info: Running /etc/ha.d/rc.d/status status
On node2:
Code:
heartbeat[2585]: 2009/08/24_09:37:25 info: Heartbeat restart on node apache1
heartbeat[2585]: 2009/08/24_09:37:25 info: Link apache1:eth0 up.
heartbeat[2585]: 2009/08/24_09:37:25 info: Status update for node apache1: status init
heartbeat[2585]: 2009/08/24_09:37:25 info: Status update for node apache1: status up
heartbeat[2585]: 2009/08/24_09:37:25 info: apache1 wants to go standby [foreign]
heartbeat[2585]: 2009/08/24_09:37:26 info: Status update for node apache1: status active
heartbeat[2585]: 2009/08/24_09:37:27 info: remote resource transition completed.
harc[3749]:     2009/08/24_09:37:27 info: Running /etc/ha.d/rc.d/status status
harc[3766]:     2009/08/24_09:37:28 info: Running /etc/ha.d/rc.d/status status
harc[3782]:     2009/08/24_09:37:29 info: Running /etc/ha.d/rc.d/status status
There was no mention of network configuration on either host.

Now, when I do a restart of heartbeat on node1, see the output of node1's log:
Code:
heartbeat[6854]: 2009/08/24_09:40:02 info: Heartbeat shutdown in progress. (6854)
heartbeat[6893]: 2009/08/24_09:40:02 info: Giving up all HA resources.           
heartbeat[6854]: 2009/08/24_09:40:04 WARN: Gmain_timeout_dispatch: Dispatch function for send local status took too long to execute: 70 ms (> 50 ms) (GSource: 0x9e10948)                                                                                                                     
ResourceManager[6907]:  2009/08/24_09:40:04 info: Releasing resource group: apache1 192.168.200.103 apache2                                    
ResourceManager[6907]:  2009/08/24_09:40:05 info: Running /etc/init.d/apache2  stop                                                            
ResourceManager[6907]:  2009/08/24_09:40:09 info: Running /etc/ha.d/resource.d/IPaddr 192.168.200.103 stop                                     
IPaddr[6980]:   2009/08/24_09:40:11 INFO:  Success                                                                                             
heartbeat[6893]: 2009/08/24_09:40:11 info: All HA resources relinquished.                                                                      
heartbeat[6854]: 2009/08/24_09:40:13 info: killing HBFIFO process 6857 with signal 15                                                          
heartbeat[6854]: 2009/08/24_09:40:13 info: killing HBWRITE process 6858 with signal 15                                                         
heartbeat[6854]: 2009/08/24_09:40:14 info: killing HBREAD process 6859 with signal 15                                                          
heartbeat[6854]: 2009/08/24_09:40:14 info: Core process 6857 exited. 3 remaining                                                               
heartbeat[6854]: 2009/08/24_09:40:14 info: Core process 6858 exited. 2 remaining                                                               
heartbeat[6854]: 2009/08/24_09:40:14 info: Core process 6859 exited. 1 remaining                                                               
heartbeat[6854]: 2009/08/24_09:40:14 info: apache1 Heartbeat shutdown complete.                                                                
heartbeat[7099]: 2009/08/24_09:40:59 WARN: Core dumps could be lost if multiple dumps occur.                                                   
heartbeat[7099]: 2009/08/24_09:40:59 WARN: Consider setting non-default value in /proc/sys/kernel/core_pattern (or equivalent) for maximum supportability                                                                                                                                     
heartbeat[7099]: 2009/08/24_09:40:59 WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability     
heartbeat[7099]: 2009/08/24_09:40:59 info: Version 2 support: false                                                                            
heartbeat[7099]: 2009/08/24_09:40:59 WARN: Logging daemon is disabled --enabling logging daemon is recommended                                 
heartbeat[7099]: 2009/08/24_09:40:59 info: **************************                                                                          
heartbeat[7099]: 2009/08/24_09:40:59 info: Configuration validated. Starting heartbeat 2.1.3
heartbeat[7100]: 2009/08/24_09:40:59 info: heartbeat: version 2.1.3
heartbeat[7100]: 2009/08/24_09:40:59 info: Heartbeat generation: 1250979591
heartbeat[7100]: 2009/08/24_09:40:59 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth0
heartbeat[7100]: 2009/08/24_09:40:59 info: glib: UDP Broadcast heartbeat closed on port 694 interface eth0 - Status: 1
heartbeat[7100]: 2009/08/24_09:40:59 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat[7100]: 2009/08/24_09:40:59 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat[7100]: 2009/08/24_09:40:59 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat[7100]: 2009/08/24_09:41:00 info: Local status now set to: 'up'
heartbeat[7100]: 2009/08/24_09:41:01 info: Link apache2:eth0 up.
heartbeat[7100]: 2009/08/24_09:41:01 info: Status update for node apache2: status active
heartbeat[7100]: 2009/08/24_09:41:01 info: Link apache1:eth0 up.
heartbeat[7100]: 2009/08/24_09:41:01 info: Comm_now_up(): updating status to active
heartbeat[7100]: 2009/08/24_09:41:01 info: Local status now set to: 'active'
heartbeat[7100]: 2009/08/24_09:41:02 info: remote resource transition completed.
heartbeat[7100]: 2009/08/24_09:41:02 info: remote resource transition completed.
heartbeat[7100]: 2009/08/24_09:41:02 info: Local Resource acquisition completed. (none)
harc[7106]:     2009/08/24_09:41:02 info: Running /etc/ha.d/rc.d/status status
heartbeat[7100]: 2009/08/24_09:41:06 info: apache2 wants to go standby [foreign]
heartbeat[7100]: 2009/08/24_09:41:13 info: standby: acquire [foreign] resources from apache2
heartbeat[7125]: 2009/08/24_09:41:13 info: acquire local HA resources (standby).
ResourceManager[7138]:  2009/08/24_09:41:15 info: Acquiring resource group: apache1 192.168.200.103 apache2
IPaddr[7165]:   2009/08/24_09:41:17 INFO:  Resource is stopped
ResourceManager[7138]:  2009/08/24_09:41:18 info: Running /etc/ha.d/resource.d/IPaddr 192.168.200.103 start
IPaddr[7241]:   2009/08/24_09:41:21 INFO: Using calculated nic for 192.168.200.103: eth0
IPaddr[7241]:   2009/08/24_09:41:21 INFO: Using calculated netmask for 192.168.200.103: 255.255.255.0
IPaddr[7241]:   2009/08/24_09:41:22 INFO: eval ifconfig eth0:0 192.168.200.103 netmask 255.255.255.0 broadcast 192.168.200.255
IPaddr[7224]:   2009/08/24_09:41:23 INFO:  Success
ResourceManager[7138]:  2009/08/24_09:41:24 info: Running /etc/init.d/apache2  start
ResourceManager[7138]:  2009/08/24_09:41:26 ERROR: Return code 1 from /etc/init.d/apache2
ResourceManager[7138]:  2009/08/24_09:41:26 CRIT: Giving up resources due to failure of apache2
ResourceManager[7138]:  2009/08/24_09:41:26 info: Releasing resource group: apache1 192.168.200.103 apache2
ResourceManager[7138]:  2009/08/24_09:41:27 info: Running /etc/init.d/apache2  stop
ResourceManager[7138]:  2009/08/24_09:41:29 info: Running /etc/ha.d/resource.d/IPaddr 192.168.200.103 stop
IPaddr[7470]:   2009/08/24_09:41:31 INFO: ifconfig eth0:0 down
IPaddr[7453]:   2009/08/24_09:41:31 INFO:  Success
heartbeat[7125]: 2009/08/24_09:41:32 info: local HA resource acquisition completed (standby).
heartbeat[7100]: 2009/08/24_09:41:32 info: Standby resource acquisition done [foreign].
heartbeat[7100]: 2009/08/24_09:41:32 info: Initial resource acquisition complete (auto_failback)
heartbeat[7100]: 2009/08/24_09:41:32 info: remote resource transition completed.
In this case, we can see that there was a network configuration of eth0:0 to 192.168.200.103 but then apache fails to start. Why is that? On apache's error log, there's absolutely nothing. how can I debug what's going on with apache?
 
Old 08-24-2009, 10:44 AM   #5
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Perhaps you could post the contents of the following files:

/etc/ha.d/ha.cf
/etc/ha.d/haresources

Regards,

Fordeck
 
Old 08-24-2009, 10:46 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Original Poster
Rep: Reputation: 81
Solved it.

I commented out the "Listen 80" directive on /etc/apache2/ports. Then it started working.
 
Old 05-25-2010, 01:22 PM   #7
Randeep
LQ Newbie
 
Registered: Apr 2010
Location: Bangalore
Distribution: Redhat, Centos
Posts: 25

Rep: Reputation: 0
Here is how to configure Linux-HA with apache in redhat platforms

http://helpinlinux.blogspot.com/2010...-linux-ha.html
 
  


Reply

Tags
apache2, debian, heartbeat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: High-Availability Load Balancer With HAProxy/Heartbeat On Debian Lenny LXer Syndicated Linux News 0 07-14-2009 05:20 PM
LXer: Set Up A High-Availability Load Balancer With Perlbal/Heartbeat On Debian Etch LXer Syndicated Linux News 0 01-13-2009 04:10 PM
Apache2 doesnt do anything (debian 3.1) DodoTux Linux - Networking 12 07-27-2006 08:50 AM
debian + apache2 alaios Debian 2 05-31-2005 05:05 AM
Debian, apache2 and php4 Pasi Linux - Distributions 1 03-20-2003 07:28 PM


All times are GMT -5. The time now is 06:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration