[SCM] CTDB repository - branch master updated - ctdb-1.0.114-24-g83446b2
Ronnie Sahlberg
sahlberg at samba.org
Thu Apr 22 17:09:49 MDT 2010
The branch, master has been updated
via 83446b2e7e28e3ed6627c1950053018b8799984a (commit)
via 234b86fb19aae7a43f1dd2c0f69b03164fe5aaca (commit)
from 1cdaaa0a3f53d1b075340a33dfdc42b534e99187 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 83446b2e7e28e3ed6627c1950053018b8799984a
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Fri Apr 23 08:52:09 2010 +1000
Add a setting where CTDB will monitor and warn for low memory conditions.
CTDB_MONITOR_FREE_MEMORY_WARN
BZ 59747
commit 234b86fb19aae7a43f1dd2c0f69b03164fe5aaca
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Fri Apr 23 08:35:01 2010 +1000
In the example script to remove all ip addresses after a ctdb crash,
add the NATGW address as one to be removed in addition to the
public addresses.
-----------------------------------------------------------------------
Summary of changes:
config/ctdb-crash-cleanup.sh | 2 +-
config/ctdb.sysconfig | 15 ++++++++++-----
config/events.d/00.ctdb | 8 ++++++++
3 files changed, 19 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/config/ctdb-crash-cleanup.sh b/config/ctdb-crash-cleanup.sh
index ca6a838..420db76 100755
--- a/config/ctdb-crash-cleanup.sh
+++ b/config/ctdb-crash-cleanup.sh
@@ -22,7 +22,7 @@ ctdb status 2>/dev/null && {
exit 0
}
-cat "$CTDB_PUBLIC_ADDRESSES" | cut -d/ -f1 | while read _IP; do
+(cat /etc/sysconfig/ctdb | egrep "^CTDB_NATGW_PUBLIC_IP" | sed -e "s/.*=//" -e "s/\/.*//";cat "$CTDB_PUBLIC_ADDRESSES" | cut -d/ -f1) | while read _IP; do
_IP_HELD=`/sbin/ip addr show | grep "inet $_IP/"`
[ -z "$_IP_HELD" ] || {
_IFACE=`echo $_IP_HELD | sed -e "s/.*\s//"`
diff --git a/config/ctdb.sysconfig b/config/ctdb.sysconfig
index a19dd0e..c94ce68 100644
--- a/config/ctdb.sysconfig
+++ b/config/ctdb.sysconfig
@@ -112,14 +112,19 @@ CTDB_RECOVERY_LOCK="/some/place/on/shared/storage"
# defaults to tcp
# CTDB_TRANSPORT="tcp"
-# When set, this variable makes ctdb monitor the amount of free memory
-# in the system (the second number in the buffers/cache output from free -m).
-# If the amount of free memory drops below this treshold the node will become
-# unhealthy and ctdb and all managed services will be shutdown.
+# These setting allow monitoring for low/out-out of memory conditions.
+#
+# If set, once available memory drops below CTDB_MONITOR_FREE_MEMORY_WARN
+# ctdb will start logging messages that memory is low, but will not
+# take any further action.
+#
+# If the amount of free memory drops below CTDB_MONITOR_FREE_MEMORY
+# ctdb will fail all service over to a different node and finally shutdown.
# Once this occurs, the administrator needs to find the reason for the OOM
# situation, rectify it and restart ctdb with "service ctdb start"
# The unit is MByte
-# CTDB_MONITOR_FREE_MEMORY=100
+# CTDB_MONITOR_FREE_MEMORY_WARN=100
+# CTDB_MONITOR_FREE_MEMORY=10
# When set to yes, the CTDB node will start in DISABLED mode and not host
# any public ip addresses. The administrator needs to explicitely enable
diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index 5255617..bfebcd2 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -44,6 +44,14 @@ case "$1" in
fi
}
+ # warn when we get low on memory
+ [ -z "$CTDB_MONITOR_FREE_MEMORY_WARN" ] || {
+ FREE_MEM=`free -m | grep "buffers/cache" | while read A B C D ;do /bin/echo -n $D ; done`
+ [ `expr "$FREE_MEM" "<" "$CTDB_MONITOR_FREE_MEMORY_WARN"` != "0" ] && {
+ echo "Running low on memory. Free:$FREE_MEM while CTDB treshold is $CTDB_MONITOR_FREE_MEMORY_WARN"
+ }
+ }
+
# monitor that we are not running out of memory
[ -z "$CTDB_MONITOR_FREE_MEMORY" ] || {
FREE_MEM=`free -m | grep "buffers/cache" | while read A B C D ;do /bin/echo -n $D ; done`
--
CTDB repository
More information about the samba-cvs
mailing list