Rev 472: merged vsftpd event script from ronnie in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Jun 6 00:29:28 GMT 2007


------------------------------------------------------------
revno: 472
revision-id: tridge at samba.org-20070606002927-x2zgceuujia96o9q
parent: tridge at samba.org-20070606002546-0qw4bar4ckcwt50m
parent: sahlberg at ronnie-20070605084249-0l895p3hyaw15czd
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-06-06 10:29:27 +1000
message:
  merged vsftpd event script from ronnie
added:
  config/events.d/40.vsftpd      40.vsftpd-20070605080716-mih15mjbgsjt7niv-1
modified:
  config/events.d/59.nfslock     nfslock-20070601105340-vlcvnp6euoj3zdwy-2
  packaging/RPM/ctdb.spec        ctdb.spec-20070527204758-biuh7znabuwan3zn-3
  tools/ctdb_control.c           ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
  web/ctdb.html                  ctdb.html-20070601052353-vgod9lfo4an4o83j-2
    ------------------------------------------------------------
    revno: 432.1.27
    merged: sahlberg at ronnie-20070605084249-0l895p3hyaw15czd
    parent: sahlberg at ronnie-20070605084043-wzqhm9lrjokae4hc
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 18:42:49 +1000
    message:
      ctdb is only a ha solution when combined with a cluster filesystem
    ------------------------------------------------------------
    revno: 432.1.26
    merged: sahlberg at ronnie-20070605084043-wzqhm9lrjokae4hc
    parent: sahlberg at ronnie-20070605083206-amcsg8vky52w2293
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 18:40:43 +1000
    message:
      add some text about CTDB and in which scenarios it would be a good
      candidate to solve the users needs for a HA solution
    ------------------------------------------------------------
    revno: 432.1.25
    merged: sahlberg at ronnie-20070605083206-amcsg8vky52w2293
    parent: sahlberg at ronnie-20070605081645-gmj5biig34hgw2hw
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 18:32:06 +1000
    message:
      provide machinereadable output for  ctdb ip
    ------------------------------------------------------------
    revno: 432.1.24
    merged: sahlberg at ronnie-20070605081645-gmj5biig34hgw2hw
    parent: sahlberg at ronnie-20070605081401-81yjnnlig9a37788
    parent: tridge at samba.org-20070605075707-2kpo0bzgbgat4ik1
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 18:16:45 +1000
    message:
      merge from tridge
    ------------------------------------------------------------
    revno: 432.1.23
    merged: sahlberg at ronnie-20070605081401-81yjnnlig9a37788
    parent: sahlberg at ronnie-20070605024335-h3su0gfytwva0qyt
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 18:14:01 +1000
    message:
      add a simple events script to manage vsftpd 
    ------------------------------------------------------------
    revno: 432.1.22
    merged: sahlberg at ronnie-20070605024335-h3su0gfytwva0qyt
    parent: sahlberg at ronnie-20070604224330-1ly6b84wu57s34u7
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 12:43:35 +1000
    message:
      dont use CTDB_MANAGES_NFS for controlling the lockmanager
      use a dedicated variable CTDB_MANAGES_NFSLOCK   since some might want to 
      use nfs but no lockmanager
    ------------------------------------------------------------
    revno: 432.1.21
    merged: sahlberg at ronnie-20070604224330-1ly6b84wu57s34u7
    parent: sahlberg at ronnie-20070604111151-q97kri6nnlhugk88
    parent: tridge at samba.org-20070604122852-z351kj9m6s28x08f
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Tue 2007-06-05 08:43:30 +1000
    message:
      merge from tridge
=== added file 'config/events.d/40.vsftpd'
--- a/config/events.d/40.vsftpd	1970-01-01 00:00:00 +0000
+++ b/config/events.d/40.vsftpd	2007-06-05 08:14:01 +0000
@@ -0,0 +1,45 @@
+#!/bin/sh
+# event strict to manage vsftpd in a cluster environment
+
+. /etc/ctdb/functions
+loadconfig vsftpd
+
+[ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
+
+cmd="$1"
+shift
+
+case $cmd in 
+     startup)
+	/bin/mkdir -p /etc/ctdb/state/vsftpd
+
+	# make sure the service is stopped first
+	service vsftpd stop > /dev/null 2>&1
+	service vsftpd start
+	;;
+
+     shutdown)
+	service vsftpd stop
+	;;
+
+     takeip)
+	echo "restart" >> /etc/ctdb/state/vsftpd/restart
+	;;
+
+     releaseip)
+	echo "restart" >> /etc/ctdb/state/vsftpd/restart
+	;;
+
+     recovered)
+	# if we have taken or released any ips we must 
+	# restart vsftpd to ensure that all tcp connections are reset
+	[ -f /etc/ctdb/state/vsftpd/restart ] && {
+		service vsftpd stop > /dev/null 2>&1
+		service vsftpd start
+	} >/dev/null 2>&1
+
+	/bin/rm -f /etc/ctdb/state/vsftpd/restart
+	;;
+esac
+
+exit 0

=== modified file 'config/events.d/59.nfslock'
--- a/config/events.d/59.nfslock	2007-06-05 05:18:37 +0000
+++ b/config/events.d/59.nfslock	2007-06-05 08:16:45 +0000
@@ -4,7 +4,7 @@
 . /etc/ctdb/functions
 loadconfig nfs
 
-[ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
+[ "$CTDB_MANAGES_NFSLOCK" = "yes" ] || exit 0
 
 [ -z "$STATD_SHARED_DIRECTORY" ] && exit 0
 

=== modified file 'packaging/RPM/ctdb.spec'
--- a/packaging/RPM/ctdb.spec	2007-06-04 05:09:03 +0000
+++ b/packaging/RPM/ctdb.spec	2007-06-05 08:14:01 +0000
@@ -94,6 +94,7 @@
 %{_sysconfdir}/ctdb/events
 %{_sysconfdir}/ctdb/functions
 %{_sysconfdir}/ctdb/events.d/10.interface
+%{_sysconfdir}/ctdb/events.d/40.vsftpd
 %{_sysconfdir}/ctdb/events.d/50.samba
 %{_sysconfdir}/ctdb/events.d/59.nfslock
 %{_sysconfdir}/ctdb/events.d/60.nfs

=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c	2007-06-06 00:25:46 +0000
+++ b/tools/ctdb_control.c	2007-06-06 00:29:27 +0000
@@ -355,6 +355,17 @@
 		return ret;
 	}
 
+	if(options.machinereadable){
+		printf(":Public IP:Node:\n");
+		for(i=0;i<ips->num;i++){
+			printf(":%s:%d:\n",
+			inet_ntoa(ips->ips[i].sin.sin_addr),
+			ips->ips[i].takeover_vnn);
+		}
+		return 0;
+	}
+
+
 	printf("Number of nodes:%d\n", ips->num);
 	for(i=0;i<ips->num;i++){
 		printf("%-16s %d\n",

=== modified file 'web/ctdb.html'
--- a/web/ctdb.html	2007-06-03 06:33:08 +0000
+++ b/web/ctdb.html	2007-06-05 08:42:49 +0000
@@ -81,6 +81,19 @@
 seconds. During the recovery period the databases are 'frozen', and
 all IO operations by ctdb clients are suspended.
 
+<h3>Is CTDB a HA solution?</h3>
+Yes and no.<br>
+CTDB alone is not a HA solution, but when you combine CTDB with a clustered 
+filesystem it becomes one.<br>
+CTDB is primarily developed around the concept of having a shared cluster 
+filesystem shared across all the nodes in the cluster to provide the features
+required for building a NAS cluster.<br>
+Thus CTDB relies on an external component (the cluster filesystem) to provide 
+the mechanisms for avoiding split-brain and other difficult tasks.<br><br>
+However, If you applications do need a clustered filesystem for all the nodes, 
+in that scenario CTDB will provide a very easy to install and manage 
+solution for your clustering HA needs.
+
 <h3>IP Takeover</h3>
 
 When a node in a cluster fails, CTDB will arrange that a different



More information about the samba-cvs mailing list