Hello I'm learning Pacemaker to manage a bunch of VMs running services.

Basically, right now I'm trying to start a Terracotta service, which has no
problem when I do it manually.

I tried the instructions in
http://clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/ap-lsb.html
and it seems my Terracotta script is LSB compatible.

For starter, this is my crm_mon output:

    root@lb-a1:~# crm_mon -1
    Last updated: Wed Jun 25 11:53:58 2014
    Last change: Wed Jun 25 11:53:05 2014 via cibadmin on ww-a1
    Stack: corosync
    Current DC: lb-a1 (168431618) - partition WITHOUT quorum
    Version: 1.1.10-42f2063
    12 Nodes configured
    6 Resources configured


    Online: [ lb-a1 mailer-a1 pgdb-a1 stos-a1 terr-a1 ww-a1 ]
    OFFLINE: [ lb-b1 mailer-b1 pgdb-b1 stos-b1 terr-b1 ww-b1 ]

     Resource Group: ActiveLoadBalancerIPs
ActiveLoadBalancerExternalIP (ocf::heartbeat:IPaddr2): Started lb-a1 ActiveLoadBalancerInternalIP (ocf::heartbeat:IPaddr2): Started lb-a1
     ActiveMailerIP (ocf::heartbeat:IPaddr2):       Started mailer-a1
     ActiveStorageServerIP  (ocf::heartbeat:IPaddr2):       Started stos-a1
ActiveTerracottaServerIP (ocf::heartbeat:IPaddr2): Started terr-a1 FooTerracottaService (lsb:terracotta-377): Started (unmanaged) FAILED [ ww-a1 stos-a1 terr-a1 lb-a1 mailer-a1 pgdb-a1 ]


    Failed actions:
FooTerracottaService_stop_0 (node=ww-a1, call=118, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:05 2014
    , queued=1ms, exec=0ms
    ): not installed
FooTerracottaService_stop_0 (node=stos-a1, call=103, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:05 2014
    , queued=2ms, exec=0ms
    ): not installed
FooTerracottaService_stop_0 (node=terr-a1, call=78, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:04 2014
    , queued=2ms, exec=0ms
    ): not installed
FooTerracottaService_stop_0 (node=lb-a1, call=112, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:05 2014
    , queued=1ms, exec=0ms
    ): not installed
FooTerracottaService_stop_0 (node=mailer-a1, call=103, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:05 2014
    , queued=2ms, exec=0ms
    ): not installed
FooTerracottaService_stop_0 (node=pgdb-a1, call=103, rc=5, status=complete, last-rc-change=Wed Jun 25 11:53:05 2014
    , queued=1ms, exec=0ms
    ): not installed


And this is the output of my crm configure show:

    node $id="168431618" lb-a1
    node $id="168431619" lb-b1
    node $id="168431627" mailer-a1
    node $id="168431628" mailer-b1
    node $id="168431873" ww-a1
    node $id="168431874" ww-b1
    node $id="168431943" stos-a1
    node $id="168431944" stos-b1
    node $id="168431973" terr-a1
    node $id="168431974" terr-b1
    node $id="168431997" pgdb-a1
    node $id="168431998" pgdb-b1
    primitive ActiveLoadBalancerExternalIP ocf:heartbeat:IPaddr2 \
            params ip="192.168.1.175" cidr_netmask="24" nic="eth0" \
            op monitor interval="30s"
    primitive ActiveLoadBalancerInternalIP ocf:heartbeat:IPaddr2 \
            params ip="10.10.16.1" cidr_netmask="20" nic="eth1"
    primitive ActiveMailerIP ocf:heartbeat:IPaddr2 \
            params ip="10.10.16.10" cidr_netmask="20" nic="eth0"
    primitive ActiveStorageServerIP ocf:heartbeat:IPaddr2 \
            params ip="10.10.17.70" cidr_netmask="20" nic="eth0"
    primitive ActiveTerracottaServerIP ocf:heartbeat:IPaddr2 \
            params ip="10.10.17.100" cidr_netmask="20" nic="eth0"
    primitive FooTerracottaService lsb:terracotta-377 \
            op monitor interval="10" timeout="30"
group ActiveLoadBalancerIPs ActiveLoadBalancerExternalIP ActiveLoadBalancerInternalIP
    location LocActiveLoadBalancerIPs_1 ActiveLoadBalancerIPs inf: lb-a1
    location LocActiveLoadBalancerIPs_2 ActiveLoadBalancerIPs inf: lb-b1
    location LocActiveMailerIP_1 ActiveMailerIP inf: mailer-a1
    location LocActiveMailerIP_2 ActiveMailerIP inf: mailer-b1
    location LocActiveStorageServerIP_1 ActiveStorageServerIP inf: stos-a1
    location LocActiveStorageServerIP_2 ActiveStorageServerIP inf: stos-b1
location LocActiveTerracottaServerIP_1 ActiveTerracottaServerIP inf: terr-a1 location LocActiveTerracottaServerIP_2 ActiveTerracottaServerIP inf: terr-b1
    location LocFooTerracottaService_1 FooTerracottaService inf: terr-a1
    location LocFooTerracottaService_2 FooTerracottaService inf: terr-b1
    property $id="cib-bootstrap-options" \
            dc-version="1.1.10-42f2063" \
            cluster-infrastructure="corosync" \
            stonith-enabled="false" \
            no-quorum-policy="ignore" \
            last-lrm-refresh="1403671249" \
            symmetric-cluster="false" \
            maintenance-mode="false"


As you can see I try to limit my FooTerracottaService to only run at terr-a1
and terr-b1, but for some reason it want to start at other nodes (ie. ww-a1,
stos-a1, ..) too.

That and my service `terracotta-377` is not running, I'm hoping someone could
shed a light what I do wrong here.

For reference this is my /etc/init.d/terracotta-377 taken from terr-a1:

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          terracotta-377
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: terracotta 3.7.7
# Description: This file should be used to construct scripts to be
    #                    placed in /etc/init.d.
    ### END INIT INFO

    # Do NOT "set -e"

    TERRA_PATH=/opt/terracotta/3.7/

# PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=$TERRA_PATH/bin:/sbin:/usr/sbin:/bin:/usr/bin
    DESC="My Terracotta server"
    NAME=terracotta-3.7
    PIDFILE=/var/run/$NAME.pid
    DAEMON=$TERRA_PATH/bin/start-tc-server.sh
    TC_CONFIG="$TERRA_PATH/tc-config.xml"
    DAEMON_ARGS="-f $TC_CONFIG"
    SCRIPTNAME=/etc/init.d/$NAME

    DAEMON_USER=terracotta
    DAEMON_GROUP=terracotta
    USE_DERBYDB=false

    export JAVA_HOME=/usr

    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0

    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh

    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
    # and status_of_proc is working.
    . /lib/lsb/init-functions

    #
    # Function that starts the daemon/service
    #
    do_start()
    {
            # Return
            #   0 if daemon has been started
            #   1 if daemon was already running
            #   2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --user $DAEMON_USER --group $DAEMON_GROUP --chuid $DAEMON_USER:$DAEMON_GROUP --exec $DAEMON --test > /dev/null \
                    || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --user $DAEMON_USER --group $DAEMON_GROUP --chuid $DAEMON_USER:$DAEMON_GROUP --background --exec $DAEMON -- \
                    $DAEMON_ARGS \
                    || return 2

# Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend
            # on this one.  As a last resort, sleep for some time.
    }

    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
            # Return
            #   0 if daemon has been stopped
            #   1 if daemon was already stopped
            #   2 if daemon could not be stopped
            #   other if a failure occurred
            if [ "$DAEMON_ARGS" != "" ] ; then
                    pkill -f "terracotta.*$TC_CONFIG"
            fi
            RETVAL="$?"


            # Many daemons don't delete their pidfiles when they exit.
            rm -f "$PIDFILE"
            return "$RETVAL"
    }

    case "$1" in
      start)
            [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
            do_start
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      stop)
            [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
            do_stop
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      status)
           status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
           ;;
      restart)
            #
            # If the "reload" option is implemented then remove the
            # 'force-reload' alias
            #
            log_daemon_msg "Restarting $DESC" "$NAME"
            do_stop
            case "$?" in
              0|1)
                    do_start
                    case "$?" in
                            0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
                            *) log_end_msg 1 ;; # Failed to start
                    esac
                    ;;
              *)
                    # Failed to stop
                    log_end_msg 1
                    ;;
            esac
            ;;
      *)
            echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
            exit 3
            ;;
    esac


This is the crm version:

    # crm --version
    1.2.5 (Build f2f315daf6a5fd7ddea8e564cd289aa04218427d)


This is the pacemaker version:

    # pacemakerd --version
    Pacemaker 1.1.10
    Written by Andrew Beekhof


All my VMs are Ubuntu Server 14.04.


Thank you.


_______________________________________________
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://bugs.clusterlabs.org

Reply via email to