[SCM] CTDB repository - branch master updated -
ctdb-1.0.81-16-gc967b23
Ronnie Sahlberg
sahlberg at samba.org
Tue May 12 08:23:03 GMT 2009
The branch, master has been updated
via c967b234f59e5998bc8f2250062f4b0d1f39d820 (commit)
via 2bd796b8a098074502fe20e3ab69098b2109c133 (commit)
via 5b0067a4e335cbbf6e606646e612d4bfcfdb7441 (commit)
via 4467b5f88d749d455854512f60a5d313cafa828b (commit)
from 723413f246399b25166462d2018237920515655f (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit c967b234f59e5998bc8f2250062f4b0d1f39d820
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue May 12 18:21:26 2009 +1000
remove NATGW_PRIVATE_IFACE from the documentation since we do not need
it any more.
commit 2bd796b8a098074502fe20e3ab69098b2109c133
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue May 12 18:42:13 2009 +1000
assign the natgw address to loopback and not the private network so that natgw will still work even when public and private networks are one and the same
commit 5b0067a4e335cbbf6e606646e612d4bfcfdb7441
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue May 12 18:39:34 2009 +1000
add extra debug statements to the log to make it easier to see when a recovery dameon has hung due to the underlying filesystem hanging.
commit 4467b5f88d749d455854512f60a5d313cafa828b
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue May 12 18:32:41 2009 +1000
check that a node is banned before trying to unban it.
-----------------------------------------------------------------------
Summary of changes:
config/ctdb.sysconfig | 1 -
config/events.d/11.natgw | 4 ++--
doc/ctdbd.1 | 10 ++--------
doc/ctdbd.1.html | 17 ++++++-----------
doc/ctdbd.1.xml | 10 ----------
doc/onnode.1 | 19 +++++++++++++++++--
doc/onnode.1.html | 46 +++++++++++++++++++++++++++++++++-------------
server/ctdb_recover.c | 13 ++++++++++---
tools/ctdb.c | 12 ++++++++++++
9 files changed, 82 insertions(+), 50 deletions(-)
Changeset truncated at 500 lines:
diff --git a/config/ctdb.sysconfig b/config/ctdb.sysconfig
index f1f3676..340ac75 100644
--- a/config/ctdb.sysconfig
+++ b/config/ctdb.sysconfig
@@ -182,7 +182,6 @@
# NATGW_PUBLIC_IP=10.0.0.227/24
# NATGW_PUBLIC_IFACE=eth0
# NATGW_DEFAULT_GATEWAY=10.0.0.1
-# NATGW_PRIVATE_IFACE=eth1
# NATGW_PRIVATE_NETWORK=10.1.1.0/24
# NATGW_NODES=/etc/ctdb/natgw_nodes
diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw
index 1e0543d..0fee6ff 100644
--- a/config/events.d/11.natgw
+++ b/config/events.d/11.natgw
@@ -17,7 +17,7 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
delete_all() {
remove_ip $NATGW_PUBLIC_IP $NATGW_PUBLIC_IFACE
- remove_ip $NATGW_PUBLIC_IP_HOST $NATGW_PRIVATE_IFACE
+ remove_ip $NATGW_PUBLIC_IP_HOST lo
ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null
@@ -50,7 +50,7 @@ case $cmd in
# We do this so that the ip address will exist on a
# non-loopback interface so that samba may send it along in the
# KDC requests.
- ip addr add $NATGW_PUBLIC_IP_HOST dev $NATGW_PRIVATE_IFACE
+ ip addr add $NATGW_PUBLIC_IP_HOST dev lo
ip route add 0.0.0.0/0 via $NATGWIP metric 10
fi
diff --git a/doc/ctdbd.1 b/doc/ctdbd.1
index 13e4a6b..b7a89eb 100644
--- a/doc/ctdbd.1
+++ b/doc/ctdbd.1
@@ -1,11 +1,11 @@
.\" Title: ctdbd
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/25/2009
+.\" Date: 05/12/2009
.\" Manual:
.\" Source:
.\"
-.TH "CTDBD" "1" "03/25/2009" "" ""
+.TH "CTDBD" "1" "05/12/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@@ -471,7 +471,6 @@ NAT\-GW is configured in /etc/sysconfigctdb by setting the following variables:
# NATGW_PUBLIC_IP=10\.0\.0\.227/24
# NATGW_PUBLIC_IFACE=eth0
# NATGW_DEFAULT_GATEWAY=10\.0\.0\.1
-# NATGW_PRIVATE_IFACE=eth1
# NATGW_PRIVATE_NETWORK=10\.1\.1\.0/24
# NATGW_NODES=/etc/ctdb/natgw_nodes
@@ -492,11 +491,6 @@ Format of this parameter is INTERFACE
This is the default gateway to use on the node that is elected to host the NATGW_PUBLIC_IP\. This is the default gateway on the public network\.
.PP
Format of this parameter is IPADDRESS
-.SS "NATGW_PRIVATE_IFACE"
-.PP
-This is the interface used for the interal private network\.
-.PP
-Format of this parameter is INTERFACE
.SS "NATGW_PRIVATE_NETWORK"
.PP
This is the network/netmask used for the interal private network\.
diff --git a/doc/ctdbd.1.html b/doc/ctdbd.1.html
index 6781477..ff7e37e 100644
--- a/doc/ctdbd.1.html
+++ b/doc/ctdbd.1.html
@@ -490,7 +490,6 @@ CTDB_CAPABILITY_RECMASTER=no
# NATGW_PUBLIC_IP=10.0.0.227/24
# NATGW_PUBLIC_IFACE=eth0
# NATGW_DEFAULT_GATEWAY=10.0.0.1
-# NATGW_PRIVATE_IFACE=eth1
# NATGW_PRIVATE_NETWORK=10.1.1.0/24
# NATGW_NODES=/etc/ctdb/natgw_nodes
</pre></div><div class="refsect2" lang="en"><a name="id2476123"></a><h3>NATGW_PUBLIC_IP</h3><p>
@@ -505,23 +504,19 @@ CTDB_CAPABILITY_RECMASTER=no
assigned to. This should be an interface connected to the public network.
</p><p>
Format of this parameter is INTERFACE
- </p></div><div class="refsect2" lang="en"><a name="id2476157"></a><h3>NATGW_DEFAULT_GATEWAY</h3><p>
+ </p></div><div class="refsect2" lang="en"><a name="id2476156"></a><h3>NATGW_DEFAULT_GATEWAY</h3><p>
This is the default gateway to use on the node that is elected to host
the NATGW_PUBLIC_IP. This is the default gateway on the public network.
</p><p>
Format of this parameter is IPADDRESS
- </p></div><div class="refsect2" lang="en"><a name="id2476172"></a><h3>NATGW_PRIVATE_IFACE</h3><p>
- This is the interface used for the interal private network.
- </p><p>
- Format of this parameter is INTERFACE
- </p></div><div class="refsect2" lang="en"><a name="id2476187"></a><h3>NATGW_PRIVATE_NETWORK</h3><p>
+ </p></div><div class="refsect2" lang="en"><a name="id2476171"></a><h3>NATGW_PRIVATE_NETWORK</h3><p>
This is the network/netmask used for the interal private network.
</p><p>
Format of this parameter is IPADDRESS/NETMASK
- </p></div><div class="refsect2" lang="en"><a name="id2476201"></a><h3>NATGW_NODES</h3><p>
+ </p></div><div class="refsect2" lang="en"><a name="id2476186"></a><h3>NATGW_NODES</h3><p>
This is the list of all nodes that belong to the same NATGW group
as this node. The default is /etc/ctdb/natgw_nodes.
- </p></div><div class="refsect2" lang="en"><a name="id2476212"></a><h3>Operation</h3><p>
+ </p></div><div class="refsect2" lang="en"><a name="id2476197"></a><h3>Operation</h3><p>
When the NAT-GW fiunctionality is used, one of the nodes is elected
to act as a NAT router for all the other nodes in the group when
they need to originate traffic to the external public network.
@@ -536,10 +531,10 @@ CTDB_CAPABILITY_RECMASTER=no
</p><p>
This is implemented in the 11.natgw eventscript. Please see the
eventscript for further information.
- </p></div></div><div class="refsect1" lang="en"><a name="id2476245"></a><h2>SEE ALSO</h2><p>
+ </p></div></div><div class="refsect1" lang="en"><a name="id2476230"></a><h2>SEE ALSO</h2><p>
ctdb(1), onnode(1)
<a class="ulink" href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
- </p></div><div class="refsect1" lang="en"><a name="id2476258"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
+ </p></div><div class="refsect1" lang="en"><a name="id2476243"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
Copyright (C) Andrew Tridgell 2007<br>
Copyright (C) Ronnie sahlberg 2007<br>
<br>
diff --git a/doc/ctdbd.1.xml b/doc/ctdbd.1.xml
index f90b671..10f9ed4 100644
--- a/doc/ctdbd.1.xml
+++ b/doc/ctdbd.1.xml
@@ -868,7 +868,6 @@ CTDB_CAPABILITY_RECMASTER=no
# NATGW_PUBLIC_IP=10.0.0.227/24
# NATGW_PUBLIC_IFACE=eth0
# NATGW_DEFAULT_GATEWAY=10.0.0.1
-# NATGW_PRIVATE_IFACE=eth1
# NATGW_PRIVATE_NETWORK=10.1.1.0/24
# NATGW_NODES=/etc/ctdb/natgw_nodes
</screen>
@@ -906,15 +905,6 @@ CTDB_CAPABILITY_RECMASTER=no
</para>
</refsect2>
- <refsect2><title>NATGW_PRIVATE_IFACE</title>
- <para>
- This is the interface used for the interal private network.
- </para>
- <para>
- Format of this parameter is INTERFACE
- </para>
- </refsect2>
-
<refsect2><title>NATGW_PRIVATE_NETWORK</title>
<para>
This is the network/netmask used for the interal private network.
diff --git a/doc/onnode.1 b/doc/onnode.1
index a4e6014..99abd80 100644
--- a/doc/onnode.1
+++ b/doc/onnode.1
@@ -1,11 +1,11 @@
.\" Title: onnode
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 09/23/2008
+.\" Date: 05/12/2009
.\" Manual:
.\" Source:
.\"
-.TH "ONNODE" "1" "09/23/2008" "" ""
+.TH "ONNODE" "1" "05/12/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@@ -41,6 +41,16 @@ con | connected
All nodes that are not disconnected\.
.RE
.PP
+lvs | lvsmaster
+.RS 4
+The current LVS master\.
+.RE
+.PP
+natgw | natgwlist
+.RS 4
+The current NAT gateway\.
+.RE
+.PP
rm | recmaster
.RS 4
The current recovery master\.
@@ -52,6 +62,11 @@ The current recovery master\.
Execute COMMAND in the current working directory on the specified nodes\.
.RE
.PP
+\-o <prefix>
+.RS 4
+Causes standard output from each node to be saved into a file with name <prefix>\.<ip>\.
+.RE
+.PP
\-p
.RS 4
Run COMMAND in parallel on the specified nodes\. The default is to run COMMAND sequentially on each node\.
diff --git a/doc/onnode.1.html b/doc/onnode.1.html
index 11c80d7..03d4055 100644
--- a/doc/onnode.1.html
+++ b/doc/onnode.1.html
@@ -1,20 +1,40 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode — run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2507974"></a><h2>DESCRIPTION</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode — run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2477311"></a><h2>DESCRIPTION</h2><p>
onnode is a utility to run commands on a specific node of a CTDB
cluster, or on all nodes.
</p><p>
- The NODES option specifies which node to run a command on. You
- can specify a numeric node number (from 0 to N-1) or the special
- node 'all'. You can also specify lists of nodes, separated by
- commas, and ranges of numeric node numbers, separated by dashes.
- If nodes are specified multiple times then the command will be
- executed multiple times on those nodes. The order of nodes is
- significant.
+ The NODES option specifies which node to run a command on. You
+ can specify a numeric node number (from 0 to N-1) or a
+ descriptive node specification (see DESCRIPTIVE NODE
+ SPECIFICATIONS below). You can also specify lists of nodes,
+ separated by commas, and ranges of numeric node numbers,
+ separated by dashes. If nodes are specified multiple times then
+ the command will be executed multiple times on those nodes. The
+ order of nodes is significant.
</p><p>
The COMMAND can be any shell command. The onnode utility uses
ssh or rsh to connect to the remote nodes and run the command.
- </p></div><div class="refsect1" lang="en"><a name="id2508000"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
+ </p></div><div class="refsect1" lang="en"><a name="id2478322"></a><h2>DESCRIPTIVE NODE SPECIFICATIONS</h2><p>
+ The following descriptive node specification can be used in
+ place of numeric node numbers:
+ </p><div class="variablelist"><dl><dt><span class="term">all</span></dt><dd><p>
+ All nodes.
+ </p></dd><dt><span class="term">ok | healthy</span></dt><dd><p>
+ All nodes that are not disconnected, banned, disabled or
+ unhealthy.
+ </p></dd><dt><span class="term">con | connected</span></dt><dd><p>
+ All nodes that are not disconnected.
+ </p></dd><dt><span class="term">lvs | lvsmaster</span></dt><dd><p>
+ The current LVS master.
+ </p></dd><dt><span class="term">natgw | natgwlist</span></dt><dd><p>
+ The current NAT gateway.
+ </p></dd><dt><span class="term">rm | recmaster</span></dt><dd><p>
+ The current recovery master.
+ </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479544"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
Execute COMMAND in the current working directory on the
specified nodes.
+ </p></dd><dt><span class="term">-o <prefix></span></dt><dd><p>
+ Causes standard output from each node to be saved into a
+ file with name <prefix>.<ip>.
</p></dd><dt><span class="term">-p</span></dt><dd><p>
Run COMMAND in parallel on the specified nodes. The
default is to run COMMAND sequentially on each node.
@@ -28,7 +48,7 @@
more than one node is specified.
</p></dd><dt><span class="term">-h, --help</span></dt><dd><p>
Show a short usage guide.
- </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2511602"></a><h2>EXAMPLES</h2><p>
+ </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479637"></a><h2>EXAMPLES</h2><p>
The following command would show the process ID of ctdb on all nodes
</p><pre class="screen">
onnode all pidof ctdbd
@@ -46,7 +66,7 @@
directory, in parallel, on nodes 0, 2, 3 and 4.
</p><pre class="screen">
onnode -c -p 0,2-4 ./foo
- </pre></div><div class="refsect1" lang="en"><a name="id2511652"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
+ </pre></div><div class="refsect1" lang="en"><a name="id2479688"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
Contains a list of each node's IP address or hostname.
</p></dd><dt><span class="term">/etc/ctdb/onnode.conf</span></dt><dd><p>
If this file exists it is sourced by onnode. The main
@@ -54,9 +74,9 @@
something other than "ssh". In this case the -t option is
ignored. For example, the administrator may choose to use
use rsh instead of ssh.
- </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2511691"></a><h2>SEE ALSO</h2><p>
+ </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479727"></a><h2>SEE ALSO</h2><p>
ctdbd(1), ctdb(1), <a class="ulink" href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
- </p></div><div class="refsect1" lang="en"><a name="id2511703"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
+ </p></div><div class="refsect1" lang="en"><a name="id2479739"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
Copyright (C) Andrew Tridgell 2007<br>
Copyright (C) Ronnie sahlberg 2007<br>
Copyright (C) Martin Schwenke 2008<br>
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 374b324..c979398 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -713,6 +713,9 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
{
struct flock lock;
+ if (keep) {
+ DEBUG(DEBUG_ERR, ("Take the recovery lock\n"));
+ }
if (ctdb->recovery_lock_fd != -1) {
close(ctdb->recovery_lock_fd);
}
@@ -745,6 +748,10 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
ctdb->recovery_lock_fd = -1;
}
+ if (keep) {
+ DEBUG(DEBUG_ERR, ("Recovery lock taken successfully\n"));
+ }
+
DEBUG(DEBUG_NOTICE,("ctdb_recovery_lock: Got recovery lock on '%s'\n", ctdb->recovery_lock_file));
return true;
@@ -1070,7 +1077,7 @@ static void ctdb_recd_ping_timeout(struct event_context *ev, struct timed_event
struct ctdb_context *ctdb = talloc_get_type(p, struct ctdb_context);
uint32_t *count = talloc_get_type(ctdb->recd_ping_count, uint32_t);
- DEBUG(DEBUG_ERR, (__location__ " Recovery daemon ping timeout. Count : %u\n", *count));
+ DEBUG(DEBUG_ERR, ("Recovery daemon ping timeout. Count : %u\n", *count));
if (*count < ctdb->tunable.recd_ping_failcount) {
(*count)++;
@@ -1080,7 +1087,7 @@ static void ctdb_recd_ping_timeout(struct event_context *ev, struct timed_event
return;
}
- DEBUG(DEBUG_ERR, (__location__ " Final timeout for recovery daemon ping. Shutting down ctdb daemon\n"));
+ DEBUG(DEBUG_ERR, ("Final timeout for recovery daemon ping. Shutting down ctdb daemon. (This can be caused if the cluster filesystem has hung)\n"));
ctdb_stop_recoverd(ctdb);
ctdb_stop_keepalive(ctdb);
@@ -1090,7 +1097,7 @@ static void ctdb_recd_ping_timeout(struct event_context *ev, struct timed_event
ctdb->methods->shutdown(ctdb);
}
ctdb_event_script(ctdb, "shutdown");
- DEBUG(DEBUG_ERR, (__location__ " Recovery daemon ping timeout. Daemon has been shut down.\n"));
+ DEBUG(DEBUG_ERR, ("Recovery daemon ping timeout. Daemon has been shut down.\n"));
exit(0);
}
diff --git a/tools/ctdb.c b/tools/ctdb.c
index ab631f8..35a4190 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1618,6 +1618,7 @@ static int control_unban(struct ctdb_context *ctdb, int argc, const char **argv)
int ret;
TDB_DATA data;
uint32_t generation, next_generation;
+ struct ctdb_node_map *nodemap=NULL;
/* record the current generation number */
generation = get_generation(ctdb);
@@ -1625,6 +1626,17 @@ static int control_unban(struct ctdb_context *ctdb, int argc, const char **argv)
data.dptr = (uint8_t *)&options.pnn;
data.dsize = sizeof(uint32_t);
+ ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, ctdb, &nodemap);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get nodemap from local node\n"));
+ return ret;
+ }
+
+ if (!(nodemap->nodes[options.pnn].flags & NODE_FLAGS_BANNED)) {
+ DEBUG(DEBUG_ERR, ("Node %d is not banned. Can not unban\n", options.pnn));
+ return -1;
+ }
+
ret = ctdb_send_message(ctdb, options.pnn, CTDB_SRVID_UNBAN_NODE, data);
if (ret != 0) {
DEBUG(DEBUG_ERR,("Failed to to unban node %u\n", options.pnn));
--
CTDB repository
More information about the samba-cvs
mailing list