Re: [Pacemaker] syslog-ng as resource / how to make sure it gets restarted

2010-10-07 Thread Andrew Beekhof
On Fri, Oct 1, 2010 at 9:41 AM, Koch, Sebastian
 wrote:
> Hi Andrew,
>
>
>
> thanks for your answer. I still need syslog-ng to restart on all nodes after
> the ClusterIp moved. I tried it like this:
>
>
>
>
>
>
>
> Resource:
>
> primitive res_SyslogNG lsb:syslog-ng \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s"
>
>
>
> Clone:
>
> clone cl-SyslogNG res_SyslogNG \
>
>     meta globally-unique="false"
>
>
>
> Order:
>
> order syslogng_after_clusterip inf: res_ClusterIP cl-SyslogNG

I think you'll have more luck with the 1.1 series for this.
We recently redesigned the ordering logic and I believe this should work now.

>
>
>
>
>
> Full Config:
>
>
>
>
>
> node pilot01-node1 \
>
>     attributes standby="off"
>
> node pilot01-node2 \
>
>     attributes standby="off"
>
> primitive Monitor-Cluster ocf:pacemaker:ClusterMon \
>
>     params htmlfile="/mnt/cluster/var/www/cluster-monitor.html" \
>
>     params pidfile="/var/run/rlb-cluster-monitor.pid" \
>
>     op start interval="0" timeout="90s" \
>
>     op stop interval="0" timeout="100s"
>
> primitive drbd_pilot0 ocf:linbit:drbd \
>
>     params drbd_resource="pilot0" drbdconf="/usr/local/etc/drbd.conf" \
>
>     operations $id="drbd_pilot0-operations" \
>
>     op monitor interval="15s"
>
> primitive pinggw ocf:pacemaker:pingd \
>
>     params host_list="10.1.1.162" multiplier="200" \
>
>     op monitor interval="10s"
>
> primitive res_Apache lsb:apache2 \
>
>     operations $id="res_Apache-operations" \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s" \
>
>     meta is-managed="true" target-role="Started"
>
> primitive res_ClusterIP ocf:heartbeat:IPaddr2 \
>
>     params iflabel="ClusterIP" ip="10.1.1.12" nic="eth0"
> cidr_netmask="24" \
>
>     operations $id="res_ClusterIP_1-operations" \
>
>     op monitor start-delay="0" interval="10s" \
>
>     meta target-role="Started"
>
> primitive res_ClusterMonitor ocf:pacemaker:ClusterMon \
>
>     params htmlfile="/mnt/cluster/var/www/cluster-monitor.html" \
>
>     params pidfile="/var/run/rlb-cluster-monitor.pid"
>
> primitive res_Filesystem ocf:heartbeat:Filesystem \
>
>     params fstype="xfs" directory="/mnt/cluster" device="/dev/drbd0"
> options="noatime,nodiratime,barrier=0"
>
> primitive res_JasperServer lsb:jasperserver \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s"
>
> primitive res_MySQL lsb:mysql \
>
>     op start interval="0" timeout="120" \
>
>     op stop interval="0" timeout="120" \
>
>     op monitor interval="10" timeout="30" depth="0"
>
> primitive res_Nagios lsb:nagios3 \
>
>     operations $id="res_Nagios-operations" \
>
>     op monitor interval="15s" timeout="20s"
>
> primitive res_ProLog2Db lsb:prolog2db \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s"
>
> primitive res_ProLog2File lsb:prolog2file \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s" \
>
>     meta target-role="Started"
>
> primitive res_ProLogWeb lsb:prolog-web \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s"
>
> primitive res_SyslogNG lsb:syslog-ng \
>
>     op monitor interval="15s" timeout="20s" start-delay="15s"
>
> group grp_MySQL res_Filesystem res_ClusterIP res_ProLog2File res_MySQL
> res_ProLog2Db res_Apache res_ClusterMonitor res_Nagios res_ProLogWeb
> res_JasperServer \
>
>     meta target-role="Started"
>
> ms ms_drbd_mysql0 drbd_pilot0 \
>
>     meta master-max="1" master-node-max="1" clone-max="2"
> clone-node-max="1" notify="true" target-role="Started"
>
> clone cl-SyslogNG res_SyslogNG \
>
>     meta globally-unique="false"
>
> clone cl-pinggw pinggw \
>
>     meta globally-unique="false"
>
> location grp_MySQL-with-pinggw grp_MySQL \
>
>     rule $id="grp_MySQL-with-pinggw-rule-1" -inf: not_defined pingd or
> pingd lte 0
>
> colocation col_drbd_on_mysql inf: grp_MySQL ms_drbd_mysql0:Master
>
> order mysql_after_drbd inf: ms_drbd_mysql0:promote grp_MySQL:start
>
> order syslogng_after_clusterip inf: res_ClusterIP cl-SyslogNG
>
> property $id="cib-bootstrap-options" \
>
>     expected-quorum-votes="2" \
>
>     stonith-enabled="false" \
>
>     no-quorum-policy="ignore" \
>
>     dc-version="1.0.8-2c98138c2f070fcb6ddeab1084154cffbf44ba75" \
>
>     cluster-infrastructure="openais" \
>
>     last-lrm-refresh="1285872257" \
>
>     symmetric-cluster="true" \
>
>     default-action-timeout="240s"
>
>
>
>
>
> Thanks in advance.
>
>
>
> Sebastian Koch
>
>
> NETZWERK GmbH
>
> Fon:  +49.711.220 5498 81
> Achtung neue Mobilfunknummer: +49.1522.299 6524
> Fax:  +49.711.220 5499 77
> Email: sebastian.k...@netzwerk.de
> Web:  www.netzwerk.de
>
> NETZWERK GmbH, Kurze Str. 40, 70794 Filderstadt-Bonlanden
> Geschäftsführer: Siegfried Herner, Hans-Baldung Luley, Olaf Müller-Haberland
> Sitz der Gesellschaft: Filderstadt-Bonlanden

Re: [Pacemaker] syslog-ng as resource / how to make sure it gets restarted

2010-10-01 Thread Koch, Sebastian
Hi Andrew,

 

thanks for your answer. I still need syslog-ng to restart on all nodes after 
the ClusterIp moved. I tried it like this:

 

 

 

Resource:

primitive res_SyslogNG lsb:syslog-ng \

op monitor interval="15s" timeout="20s" start-delay="15s"

 

Clone:

clone cl-SyslogNG res_SyslogNG \

meta globally-unique="false"

 

Order:

order syslogng_after_clusterip inf: res_ClusterIP cl-SyslogNG

 

 

Full Config:

 

 

node pilot01-node1 \

attributes standby="off"

node pilot01-node2 \

attributes standby="off"

primitive Monitor-Cluster ocf:pacemaker:ClusterMon \

params htmlfile="/mnt/cluster/var/www/cluster-monitor.html" \

params pidfile="/var/run/rlb-cluster-monitor.pid" \

op start interval="0" timeout="90s" \

op stop interval="0" timeout="100s"

primitive drbd_pilot0 ocf:linbit:drbd \

params drbd_resource="pilot0" drbdconf="/usr/local/etc/drbd.conf" \

operations $id="drbd_pilot0-operations" \

op monitor interval="15s"

primitive pinggw ocf:pacemaker:pingd \

params host_list="10.1.1.162" multiplier="200" \

op monitor interval="10s"

primitive res_Apache lsb:apache2 \

operations $id="res_Apache-operations" \

op monitor interval="15s" timeout="20s" start-delay="15s" \

meta is-managed="true" target-role="Started"

primitive res_ClusterIP ocf:heartbeat:IPaddr2 \

params iflabel="ClusterIP" ip="10.1.1.12" nic="eth0" cidr_netmask="24" \

operations $id="res_ClusterIP_1-operations" \

op monitor start-delay="0" interval="10s" \

meta target-role="Started"

primitive res_ClusterMonitor ocf:pacemaker:ClusterMon \

params htmlfile="/mnt/cluster/var/www/cluster-monitor.html" \

params pidfile="/var/run/rlb-cluster-monitor.pid"

primitive res_Filesystem ocf:heartbeat:Filesystem \

params fstype="xfs" directory="/mnt/cluster" device="/dev/drbd0" 
options="noatime,nodiratime,barrier=0"

primitive res_JasperServer lsb:jasperserver \

op monitor interval="15s" timeout="20s" start-delay="15s"

primitive res_MySQL lsb:mysql \

op start interval="0" timeout="120" \

op stop interval="0" timeout="120" \

op monitor interval="10" timeout="30" depth="0"

primitive res_Nagios lsb:nagios3 \

operations $id="res_Nagios-operations" \

op monitor interval="15s" timeout="20s"

primitive res_ProLog2Db lsb:prolog2db \

op monitor interval="15s" timeout="20s" start-delay="15s"

primitive res_ProLog2File lsb:prolog2file \

op monitor interval="15s" timeout="20s" start-delay="15s" \

meta target-role="Started"

primitive res_ProLogWeb lsb:prolog-web \

op monitor interval="15s" timeout="20s" start-delay="15s"

primitive res_SyslogNG lsb:syslog-ng \

op monitor interval="15s" timeout="20s" start-delay="15s"

group grp_MySQL res_Filesystem res_ClusterIP res_ProLog2File res_MySQL 
res_ProLog2Db res_Apache res_ClusterMonitor res_Nagios res_ProLogWeb 
res_JasperServer \

meta target-role="Started"

ms ms_drbd_mysql0 drbd_pilot0 \

meta master-max="1" master-node-max="1" clone-max="2" 
clone-node-max="1" notify="true" target-role="Started"

clone cl-SyslogNG res_SyslogNG \

meta globally-unique="false"

clone cl-pinggw pinggw \

meta globally-unique="false"

location grp_MySQL-with-pinggw grp_MySQL \

rule $id="grp_MySQL-with-pinggw-rule-1" -inf: not_defined pingd or 
pingd lte 0

colocation col_drbd_on_mysql inf: grp_MySQL ms_drbd_mysql0:Master

order mysql_after_drbd inf: ms_drbd_mysql0:promote grp_MySQL:start

order syslogng_after_clusterip inf: res_ClusterIP cl-SyslogNG

property $id="cib-bootstrap-options" \

expected-quorum-votes="2" \

stonith-enabled="false" \

no-quorum-policy="ignore" \

dc-version="1.0.8-2c98138c2f070fcb6ddeab1084154cffbf44ba75" \

cluster-infrastructure="openais" \

last-lrm-refresh="1285872257" \

symmetric-cluster="true" \

default-action-timeout="240s"

 

 

Thanks in advance.

 

Sebastian Koch
 

NETZWERK GmbH

Fon:  +49.711.220 5498 81
Achtung neue Mobilfunknummer: +49.1522.299 6524
Fax:  +49.711.220 5499 77
Email: sebastian.k...@netzwerk.de
 Web:  www.netzwerk.de 
 

NETZWERK GmbH, Kurze Str. 40, 70794 Filderstadt-Bonlanden
Geschäftsführer: Siegfried Herner, Hans-Baldung Luley, Olaf Müller-Haberland
Sitz der Gesellschaft: Filderstadt-Bonlanden, Amtsgericht Stuttgart HRB 225547, 
WEEE-Reg Nr. DE 185 622 492

 

___
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://devel

Re: [Pacemaker] syslog-ng as resource / how to make sure it gets restarted

2010-09-30 Thread Koch, Sebastian
Hello,

 

i now edited the syslog-ng Debian Init Script to fit the LSB spec. Now
it should be cluster ready. See the new Script version below. Feedback
is appreciated and I hope it helps somebody.

 



-

 

#! /bin/sh

### BEGIN INIT INFO

# Provides:  syslog

# Required-Start:$local_fs $network $time $remote_fs

# Required-Stop: $local_fs $network $time $remote_fs

# Default-Start: 2 3 4 5

# Default-Stop:  0 1 6

# Short-Description: Starting system logging daemon

# Description:   Starting syslog-NG, the next generation

#  syslog daemon.

### END INIT INFO#

#

# skeleton  example file to build /etc/init.d/ scripts.

#   This file should be used to construct scripts for
/etc/init.d.

#

#   Written by Miquel van Smoorenburg .

#   Modified for Debian GNU/Linux

#   by Ian Murdock .

#

# Version:  @(#)skeleton  1.8  03-Mar-1998  miqu...@cistron.nl

# This file was customized by SZALAY Attila 

#

# EDIT: This file was editied by Sebastian koch, Fa. NETZWERK GmbH

# to fit the LSB spec in order to be cluster-ready (pacemaker)

#

 

#we source /etc/default/syslog-ng if exists

[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng

 

# stop syslog-ng before changing its PID file!

PIDFILE="/var/run/syslog-ng.pid"

 

SYSLOGNG="/usr/sbin/syslog-ng"

NAME="syslog-ng"

 

PATH=/sbin:/bin:/usr/sbin:/usr/bin

test -f $SYSLOGNG || exit 0

 

# Define LSB log_* functions.

# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.

. /lib/lsb/init-functions

 

case "x$CONSOLE_LOG_LEVEL" in

  x[1-8])

dmesg -n $CONSOLE_LOG_LEVEL

;;

  x)

;;

  *)

log_warning_msg "CONSOLE_LOG_LEVEL is of unaccepted value."

;;

esac

 

if [ -n "$KERNEL_RINGBUF_SIZE" ]

then

  log_warning_msg "KERNEL_RINGBUF_SIZE option is useless and therefore
removed."

fi

 

check_started() {

  if [ -f "$PIDFILE" ]; then

  pid="$(cat $PIDFILE)"

if [ "$pid" ] && kill -0 $pid >/dev/null; then

  return 0# Is started

  fi

  fi

  return 1  # Isn't started

}

 

create_xconsole() {

  if [ ! -e /dev/xconsole ]

  then

mknod -m 640 /dev/xconsole p

  fi

}

 

syslogng_start() {

  if ! check_started; then

log_daemon_msg "Starting system logging" "$NAME"

create_xconsole

start-stop-daemon --start --quiet --exec "$SYSLOGNG" \

  --pidfile "$PIDFILE" -- -p "$PIDFILE"

RET="$?"

log_end_msg $RET

return $RET

  else

log_warning_msg "already running!"

  fi

  return $ret

}

 

syslogng_stop() {

  if check_started; then

log_daemon_msg "Stopping system logging" "$NAME"

start-stop-daemon --stop --quiet --name "$NAME" --retry 3 \

  --pidfile "$PIDFILE"

RET="$?"

log_end_msg $RET

rm -f "$PIDFILE"

return $RET

  else

log_warning_msg "isn't running!"

  fi

  return $ret

}

 

syslogng_reload() {

log_daemon_msg "Reload system logging" "$NAME"

if $SYSLOGNG -s

then

 

  start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" \

--pidfile "$PIDFILE"

  RET="$?"

  log_end_msg $RET

  return $RET

else

  log_end_msg 1

  return 1

fi

}

 

DAEMON=$NAME;

 

syslogng_status()

{

  log_action_begin_msg "checking $DAEMON"

  if check_started; then

log_action_end_msg 0 "running"

  else

if [ -e "$PIDFILE" ]; then

  log_action_end_msg 1 "$DAEMON failed"

  exit 1

else

  log_action_end_msg 0 "not running"

  exit 3

fi

  fi

}

 

case "$1" in

  start)

syslogng_start || exit 1

;;

  stop)

syslogng_stop || exit 1

;;

  status)

syslogng_status || exit 1

;;

  reload|force-reload)

syslogng_reload || exit 1

;;

  restart)

syslogng_stop

syslogng_start || exit 1

;;

  *)

echo "Usage: /etc/init.d/$NAME
{start|stop|restart|status|reload|force-reload}" >&2

exit 1

;;

esac

 

exit 0

 



-

Sebastian Koch



 

___
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker


Re: [Pacemaker] syslog-ng as resource / how to make sure it gets restarted

2010-06-29 Thread Andrew Beekhof
On Mon, Jun 28, 2010 at 10:52 AM, Koch, Sebastian
 wrote:
> Hi,
>
>
>
> i got a loggin application that is running on a active passive LAMP Cluster.
> The server is working as a logging server form my infrastructure. I
> configured syslog-ng to listen on all open ip addresses. It is working fine
> but when i migrate the CLusterIP the syslog-ng daemon doesn’t recognize the
> new IP Address and is not recieving any messages.
>
>
>
> What could be the correct way to cluster syslog-ng? My first idea ist o
> clone syslog-ng and to include it into the grp_MySQL to make sure it gets
> restarted when the CLusterIP migrates.

Groups can't contain clones.
But yes, making it a cloned resource that it ordered to start after
the IP should do it.

> Maybe some of you got a better idea
> or hints on how to make sure that syslog gets restarted on ip migration.

___
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker


Re: [Pacemaker] syslog-ng as resource / how to make sure it gets restarted

2010-06-28 Thread Koch, Sebastian
Oh i forgot to include my setup:

 



Last updated: Mon Jun 28 10:51:02 2010

Stack: openais

Current DC: pilot01-node2 - partition with quorum

Version: 1.0.8-2c98138c2f070fcb6ddeab1084154cffbf44ba75

2 Nodes configured, 2 expected votes

4 Resources configured.



 

Online: [ pilot01-node1 pilot01-node2 ]

 

 Resource Group: grp_MySQL

 res_Filesystem (ocf::heartbeat:Filesystem):Started
pilot01-node2

 res_ClusterIP  (ocf::heartbeat:IPaddr2):   Started
pilot01-node2

 res_MySQL  (lsb:mysql):Started pilot01-node2

 res_Apache (lsb:apache2):  Started pilot01-node2

 res_ClusterMonitor (ocf::pacemaker:ClusterMon):Started
pilot01-node2

 res_Nagios (lsb:nagios3):  Started pilot01-node2

 res_PiLoT (lsb:prolog):   Started pilot01-node2

 Master/Slave Set: ms_drbd_mysql0

 Masters: [ pilot01-node2 ]

 Slaves: [ pilot01-node1 ]

 Clone Set: cl-pinggw

 Started: [ pilot01-node1 pilot01-node2 ]

Monitor-Cluster (ocf::pacemaker:ClusterMon):Started pilot01-node1

 

Sebastian Koch



 

Von: Koch, Sebastian 
Gesendet: Montag, 28. Juni 2010 10:53
An: 'The Pacemaker cluster resource manager'
Betreff: syslog-ng as resource / how to make sure it gets restarted

 

Hi,

 

i got a loggin application that is running on a active passive LAMP
Cluster. The server is working as a logging server form my
infrastructure. I configured syslog-ng to listen on all open ip
addresses. It is working fine but when i migrate the CLusterIP the
syslog-ng daemon doesn't recognize the new IP Address and is not
recieving any messages.

 

What could be the correct way to cluster syslog-ng? My first idea ist o
clone syslog-ng and to include it into the grp_MySQL to make sure it
gets restarted when the CLusterIP migrates. Maybe some of you got a
better idea or hints on how to make sure that syslog gets restarted on
ip migration.

 

Thanks in advance.

Regards

 

Sebastian Koch

 

Von: Robert Lindgren [mailto:robert.lindg...@gmail.com] 
Gesendet: Montag, 28. Juni 2010 10:34
An: The Pacemaker cluster resource manager
Betreff: Re: [Pacemaker] small gfs question

 

 

On Mon, Jun 28, 2010 at 10:19 AM, Andrew Beekhof 
wrote:

On Sun, Jun 27, 2010 at 8:00 PM, Robert Lindgren

 wrote:
>
>>>

>>> You do have stonith configured right?
>>
>> No :)
>
>> Ah, that explains it then
>>
>> > right now (during test) I don't have hardware with stonith devices,
>> > like drac5 or something. Is it possible to configure stonith with
for
>> > example external/ssh and make it work?
>>
>> Well external/ssh isnt going to work if there's no network access to
>> the "bad" node...
>
> Any recommendations on  how to configure stonith on a test environment
here
> there is not any physical stonith devices? I want to test this before
> production stage, where there is proper stonith environment.

Virtual machines perhaps?
There are a couple of VM fencing options out there.

 

 

He, well my setup is the following:

 

I have two physical machines, running pacemaker with gfs2/drbd
active/active, with some VirtualDomain kvm resources, where the kvm
images are served from the gfs2/drbd partition. 

 

I guess this setup is pretty hard to implement on another layer of
visualization, where the physical machines are turned into virtual once.
It might be possible but I might be able to test the gfs2/drbd problem
I'm having at least.

 

___
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker