problems getting virtual IP for mysql-cluster guide

Discussion in 'HOWTO-Related Questions' started by abubin, Nov 4, 2010.

  1. abubin

    abubin New Member

    Hi,

    I am trying to setup mysql-cluster on ubuntu 10.04 running vmware.

    I followed the guides in http://www.howtoforge.com/loadbalanced_mysql_cluster_debian

    However, since ultramonkey does not work with ubuntu 10.04, I had to install the packages manually.

    apt-get install ipvsadm ldirectord heartbeat

    I am getting difficulty getting the virtual IP on my loadbalance servers.

    In the log, I found some error that LVSSyncDaemonSwap is not loaded. Then I checked and found this file is not located in the folder where it should reside.

    Further checking, it was said newer kernel do not need this LVSSyncDaemonSwap anymore. Probably the reason why this file was not installed with ldirectord? Or is this an ultramonkey related file?

    I tried removing LVSSyncDaemonSwap entry in my /etc/ha.d/haresources file but still no go.

    Anyone can shed some light?
     
  2. masche85

    masche85 New Member

    Hi,

    I also have the same problem!
     
  3. maykel535

    maykel535 New Member

    I had the same problem but I resolved

    The problem is that the file not exist when install the packet LVSSyncDaemonSwap. Copy the down text and generate file in /etc/ha.d/resources.d/LVSSyncDaemonSwap
    The file is here:



    #!/bin/sh
    #
    # $Id: LVSSyncDaemonSwap.in,v 1.1.2.1 2005/02/14 11:15:57 horms Exp $
    #
    # Copyright (C) 2005 Horms <horms@verge.net.au>
    #
    # This script manages the LVS synchronisation daemon
    #
    # Please note that as of 2.4.29, this is no longer needed
    # as both the master and backup daemon can run simultaneously
    #
    # usage: $0 {master|backup} {start|stop|status|monitor|cleanup}
    #
    # The first argument, master or backup, is the YING.
    # The YANG is internally calculated to be which ever or master and
    # backup YING is not.
    #
    # e.g $0 LVSSyncDaemonSwap master start # YING=master YANG=backup
    # $0 LVSSyncDaemonSwap backup start # YING=backup YANG=master
    #
    #
    # "start" will stop the YANG if it is running and starts the YING
    # "stop" will stop the YING if it is running and starts the YANG
    # "cleanup" is a non-standard target stop the YING if it is running
    # an stop the YANG if it is running
    #
    #
    #
    unset LANG
    LC_ALL=C
    export LC_ALL

    prefix=/usr
    exec_prefix=/usr
    . /etc/ha.d/shellfuncs

    USAGE="usage: $0 {master|backup} {start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";

    # This is consistent with ldirectord's behaviour
    # Except that this script does not have a debug mode
    if [ -x "/sbin/ipvsadm" ]; then
    IPVSADM="/sbin/ipvsadm";
    elif [ -x "/usr/sbin/ipvsadm" ]; then
    IPVSADM="/usr/sbin/ipvsadm";
    else
    ha_log "ERROR: Can not find ipvsadm";
    exit 1
    fi


    get_status() {
    if echo $PS | grep " \[ipvs[ _]sync$1\]$" > /dev/null; then
    echo "running"
    return 3
    fi

    echo "stopped"
    return 0
    }

    status() {
    echo -n "$1 "
    get_status $1
    RC=$?

    if A=$( echo "$PS" | grep " \[ipvs[ _]syncmaster\]$"); then
    B=${A# *}
    echo "(ipvs_syncmaster pid: ${B%% *})"
    fi
    if A=$( echo "$PS" | grep " \[ipvs[ _]syncbackup\]$"); then
    B=${A# *}
    echo "(ipvs_syncbackup pid: ${B%% *})"
    fi

    return $RC
    }

    run_ipvsadm () {
    echo $IPVSADM $@
    $IPVSADM $@
    rc=$?
    if [ $rc -ne 0 ]; then
    echo "ERROR: ipvsadm $@ failed."
    return $rc
    fi

    return 0
    }

    ying_yan() {
    if [ "$1" = "master" ]; then
    echo "backup"
    else
    echo "master"
    fi
    }

    start_stop() {
    YING=$1
    YANG=$2

    if [ $(get_status $YING) = "running" ]; then
    return 0
    fi

    if [ $(get_status $YANG) = "running" ]; then
    run_ipvsadm --stop-daemon $YANG || return $?
    ha_log "info: ipvs_sync$YANG down"
    fi

    run_ipvsadm --start-daemon $YING || return $?

    ha_log "info: ipvs_sync$YING up"
    return 0
    }

    start() {
    start_stop $1 $(ying_yan $1) || return $?
    ha_log "info: ipvs_sync$YING obtained"
    return 0
    }

    stop() {
    start_stop $(ying_yan $1) $1 || return $?
    ha_log "info: ipvs_sync$YANG released"
    return 0
    }

    cleanup() {
    if [ $(get_status master) = "running" ]; then
    YING=master
    elif [ $(get_status backup) = "running" ]; then
    YING=backup
    else
    return 0
    fi


    run_ipvsadm --stop-daemon $YING || return $?
    ha_log "info: ipvs_sync$YING down"
    return 0
    }

    usage() {
    echo -e $USAGE >&2
    }

    if
    [ $# -ne 2 ]
    then
    usage
    exit 1
    fi

    PS=$(ps ax | grep " \[ipvs[ _]sync")

    case $2 in
    start)
    start $1
    ;;
    stop)
    stop $1
    ;;
    status)
    status $1
    ;;
    monitor)
    status $1
    ;;
    cleanup)
    cleanup $1
    ;;
    *)
    usage
    exit 1
    ;;
    esac

    exit $?
     
  4. Hoppie

    Hoppie New Member

    Oh THANK GOODNESS

    This is the only place on the entire internet that the solution exists. Thanks for posting!
     

Share This Page