Re: [Linux-HA] Heartbeat isn't switching to the 2nd node when Httpd is down!

2012-07-31 Thread Lars Ellenberg
On Tue, Jul 24, 2012 at 04:01:40PM +0100, Aboubakr Seddik Ouahabi wrote:
 Hey there, I've created a thread somewhere, but I guess this is the right
 place to seek help for this, and here is my issue as stated there:
 
 
 Ok guys, that was very much appreciated and I thank you again. For now, I
 just want to get heartbeat to function as it should and I don't want to
 create a whole new thread for it.
 
 As I said before, I have one public IP to access the server, and 2 nodes
 with 2 internal IPs, both are connected using Eth0, and what I want exactly
 is, if either one of Httpd or MySQL went down, the second node should take
 control and the virtual IP shall be assigned to it, until everything is in
 Sync again, then the primary or the favorible node should be taking over
 again.
 
 Heartbeat is starting just fine, detecting the 2 nodes, then I tried to
 shutdown one of them and see what would it say
 
  Code:
 
 cl_status nodestatus node02
 dead
 
 And it found it was dead, but the failover isn't happening. I've tried to:
 
  Code:
 
 service httpd stop
 
 On node01, but it didn't switch anything to anything, so what I've been
 missing in my config? And here are the config I've tried in my ha.cf:
 
  Code:
 
 # Logging
  debug  1
  use_logd   true
  logfacilitydaemon
 
  # Misc Options
  traditional_compressionoff
  compressionbz2
  coredumps  true
 
  # Communications
  udpport21xxx
  bcast  eth0
  ucast  eth010.25.45.81
  ucast  eth010.25.45.82
 
  autojoin   any
 
  # Thresholds (in seconds)
  keepalive  1
  warntime   6
  deadtime   10
  initdead   15
 
 crm respawn
 
 node node01
 node node02
 
 And I've tried 2 combinations for my cib.xml:

learn to use the crm shell, so much easier to the eyes...

 
 1:
  Code:
 
 cib
 configuration

I think you are missing no-quorum-policy=ignore


-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
___
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


Re: [Linux-HA] Heartbeat isn't switching to the 2nd node when Httpd is down!

2012-07-29 Thread Andrew Beekhof
On Wed, Jul 25, 2012 at 1:01 AM, Aboubakr Seddik Ouahabi
ouaha...@gmail.com wrote:
 Hey there, I've created a thread somewhere, but I guess this is the right
 place to seek help for this, and here is my issue as stated there:


 Ok guys, that was very much appreciated and I thank you again. For now, I
 just want to get heartbeat to function as it should and I don't want to
 create a whole new thread for it.

 As I said before, I have one public IP to access the server, and 2 nodes
 with 2 internal IPs, both are connected using Eth0, and what I want exactly
 is, if either one of Httpd or MySQL went down, the second node should take
 control and the virtual IP shall be assigned to it,

Is apache and mysql intended to be running on both machines at the same time?

Btw. haresources is not used for crm/pacemaker clusters

 until everything is in
 Sync again, then the primary or the favorible node should be taking over
 again.

 Heartbeat is starting just fine, detecting the 2 nodes, then I tried to
 shutdown one of them and see what would it say

  Code:

 cl_status nodestatus node02
 dead

 And it found it was dead, but the failover isn't happening. I've tried to:

  Code:

 service httpd stop

 On node01, but it didn't switch anything to anything, so what I've been
 missing in my config? And here are the config I've tried in my ha.cf:

  Code:

 # Logging
  debug  1
  use_logd   true
  logfacilitydaemon

  # Misc Options
  traditional_compressionoff
  compressionbz2
  coredumps  true

  # Communications
  udpport21xxx
  bcast  eth0
  ucast  eth010.25.45.81
  ucast  eth010.25.45.82

  autojoin   any

  # Thresholds (in seconds)
  keepalive  1
  warntime   6
  deadtime   10
  initdead   15

 crm respawn

 node node01
 node node02

 And I've tried 2 combinations for my cib.xml:

 1:
  Code:

 cib
 configuration

   crm_config/
   nodes/
   resources

 ###
 ###

group id=group_apache
  primitive id=ipaddr class=ocf type=IPaddr 
 provider=heartbeat
  instance_attributes id=ia_ipaddr
attributes
  nvpair id=ia_ipaddr_ip name=ip value=91.xxx.xxx.xx/
  nvpair id=ia_ipaddr_nic name=nic value=eth0/
  nvpair id=ia_ipaddr_netmask name=netmask value=24/
/attributes
  /instance_attributes
/primitive
primitive id=apache class=ocf type=apache provider=heartbeat
  instance_attributes id=ia_apache
attributes
  nvpair id=ia_apache_configfile name=configfile
 value=/etc/httpd/conf/httpd.conf/
/attributes
  /instance_attributes
  /primitive
/group

 #
 #

 group id=node01

   primitive class=ocf id=IP1 provider=heartbeat type=IPaddr
 operations
   op id=IP1_mon interval=10s name=monitor timeout=5s/
 /operations
 instance_attributes id=IP1_inst_attr
   attributes
 nvpair id=IP1_attr_0 name=ip value=10.25.45.81/
 nvpair id=IP1_attr_1 name=netmask value=255.255.255.0/
 nvpair id=IP1_attr_2 name=nic value=eth0/
   /attributes
 /instance_attributes
   /primitive

   primitive class=lsb id=httpd1 provider=heartbeat type=httpd
 operations
   op id=jboss1_mon interval=30s name=monitor timeout=20s/
 /operations
   /primitive
 /group

 group id=node02

   primitive class=ocf id=IP2 provider=heartbeat type=IPaddr
 operations
   op id=IP2_mon interval=10s name=monitor timeout=5s/
 /operations
 instance_attributes id=IP2_inst_attr
   attributes
 nvpair id=IP2_attr_0 name=ip value=10.25.45.82/
 nvpair id=IP2_attr_1 name=netmask value=255.255.255.0/
 nvpair id=IP2_attr_2 name=nic value=eth0/
   /attributes
 /instance_attributes
   /primitive
   primitive class=lsb id=httpd2 provider=heartbeat type=httpd
 operations
   op id=jboss2_mon interval=30s name=monitor timeout=20s/
 /operations
   /primitive
 /group
   /resources

   constraints
 rsc_location id=location_server1 rsc=node01
   rule id=best_location_server1 score=100
 expression_attribute=node01 id=best_location_server1_expr
 operation=eq
 value=10.25.45.81/
   /rule
 /rsc_location

 rsc_location id=location_server2 rsc=node02
   rule id=best_location_server2 score=100
 expression_attribute=node02 id=best_location_server2_expr
 operation=eq
 

[Linux-HA] Heartbeat isn't switching to the 2nd node when Httpd is down!

2012-07-24 Thread Aboubakr Seddik Ouahabi
Hey there, I've created a thread somewhere, but I guess this is the right
place to seek help for this, and here is my issue as stated there:


Ok guys, that was very much appreciated and I thank you again. For now, I
just want to get heartbeat to function as it should and I don't want to
create a whole new thread for it.

As I said before, I have one public IP to access the server, and 2 nodes
with 2 internal IPs, both are connected using Eth0, and what I want exactly
is, if either one of Httpd or MySQL went down, the second node should take
control and the virtual IP shall be assigned to it, until everything is in
Sync again, then the primary or the favorible node should be taking over
again.

Heartbeat is starting just fine, detecting the 2 nodes, then I tried to
shutdown one of them and see what would it say

 Code:

cl_status nodestatus node02
dead

And it found it was dead, but the failover isn't happening. I've tried to:

 Code:

service httpd stop

On node01, but it didn't switch anything to anything, so what I've been
missing in my config? And here are the config I've tried in my ha.cf:

 Code:

# Logging
 debug  1
 use_logd   true
 logfacilitydaemon

 # Misc Options
 traditional_compressionoff
 compressionbz2
 coredumps  true

 # Communications
 udpport21xxx
 bcast  eth0
 ucast  eth010.25.45.81
 ucast  eth010.25.45.82

 autojoin   any

 # Thresholds (in seconds)
 keepalive  1
 warntime   6
 deadtime   10
 initdead   15

crm respawn

node node01
node node02

And I've tried 2 combinations for my cib.xml:

1:
 Code:

cib
configuration

  crm_config/
  nodes/
  resources

###
###

   group id=group_apache
 primitive id=ipaddr class=ocf type=IPaddr provider=heartbeat
 instance_attributes id=ia_ipaddr
   attributes
 nvpair id=ia_ipaddr_ip name=ip value=91.xxx.xxx.xx/
 nvpair id=ia_ipaddr_nic name=nic value=eth0/
 nvpair id=ia_ipaddr_netmask name=netmask value=24/
   /attributes
 /instance_attributes
   /primitive
   primitive id=apache class=ocf type=apache provider=heartbeat
 instance_attributes id=ia_apache
   attributes
 nvpair id=ia_apache_configfile name=configfile
value=/etc/httpd/conf/httpd.conf/
   /attributes
 /instance_attributes
 /primitive
   /group

#
#

group id=node01

  primitive class=ocf id=IP1 provider=heartbeat type=IPaddr
operations
  op id=IP1_mon interval=10s name=monitor timeout=5s/
/operations
instance_attributes id=IP1_inst_attr
  attributes
nvpair id=IP1_attr_0 name=ip value=10.25.45.81/
nvpair id=IP1_attr_1 name=netmask value=255.255.255.0/
nvpair id=IP1_attr_2 name=nic value=eth0/
  /attributes
/instance_attributes
  /primitive

  primitive class=lsb id=httpd1 provider=heartbeat type=httpd
operations
  op id=jboss1_mon interval=30s name=monitor timeout=20s/
/operations
  /primitive
/group

group id=node02

  primitive class=ocf id=IP2 provider=heartbeat type=IPaddr
operations
  op id=IP2_mon interval=10s name=monitor timeout=5s/
/operations
instance_attributes id=IP2_inst_attr
  attributes
nvpair id=IP2_attr_0 name=ip value=10.25.45.82/
nvpair id=IP2_attr_1 name=netmask value=255.255.255.0/
nvpair id=IP2_attr_2 name=nic value=eth0/
  /attributes
/instance_attributes
  /primitive
  primitive class=lsb id=httpd2 provider=heartbeat type=httpd
operations
  op id=jboss2_mon interval=30s name=monitor timeout=20s/
/operations
  /primitive
/group
  /resources

  constraints
rsc_location id=location_server1 rsc=node01
  rule id=best_location_server1 score=100
expression_attribute=node01 id=best_location_server1_expr
operation=eq
value=10.25.45.81/
  /rule
/rsc_location

rsc_location id=location_server2 rsc=node02
  rule id=best_location_server2 score=100
expression_attribute=node02 id=best_location_server2_expr
operation=eq
value=10.25.45.82/
  /rule
/rsc_location

rsc_location id=server1_connected rsc=node01
  rule id=server1_connected_rule score=-INFINITY boolean_op=or
expression id=server1_connected_undefined attribute=pingd
operation=not_defined/
expression id=server1_connected_zero attribute=pingd
operation=lte
value=0/
  /rule