Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th November 2010, 11:04
abubin abubin is offline
Member
 
Join Date: Mar 2010
Posts: 81
Thanks: 0
Thanked 2 Times in 2 Posts
Default problems getting virtual IP for mysql-cluster guide

Hi,

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

I followed the guides in http://www.howtoforge.com/loadbalanc...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?
Reply With Quote
Sponsored Links
  #2  
Old 26th November 2010, 00:07
masche85 masche85 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I also have the same problem!
Reply With Quote
  #3  
Old 17th November 2011, 13:35
maykel535 maykel535 is offline
Member
 
Join Date: May 2009
Posts: 33
Thanks: 5
Thanked 3 Times in 2 Posts
Smile 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 $?
Reply With Quote
The Following 2 Users Say Thank You to maykel535 For This Useful Post:
Hoppie (19th May 2012), nflcorbin (19th November 2011)
  #4  
Old 19th May 2012, 04:41
Hoppie Hoppie is offline
Junior Member
 
Join Date: Aug 2007
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
 
Smile Oh THANK GOODNESS

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

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heartbeat on FreeBSD7.2 not changing to Virtual IP jodizzz Server Operation 1 15th April 2010 07:46
Problems with MySQL Cluster (Help) longvnit Server Operation 2 9th December 2009 17:22
MySQL Cluster on Virtual Machines? Srdan Dukic Server Operation 2 18th February 2009 11:15
problems with body and subject with Autoresponders to accompany Virtual Users guide shark_tico HOWTO-Related Questions 22 11th April 2007 12:20
MySQL Cluster HOWTO - Cannot load Virtual IP address samu HOWTO-Related Questions 6 11th January 2007 10:19


All times are GMT +2. The time now is 18:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.