From: Martin Schwenke Date: Tue, 12 Apr 2016 01:31:41 +0000 (+1000) Subject: ctdb-tools: Change ctdb CLI to have a single "lvs" command X-Git-Tag: talloc-2.1.7~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3a71785110316eac0dd55fbd5f2e76be31049b4;p=thirdparty%2Fsamba.git ctdb-tools: Change ctdb CLI to have a single "lvs" command This simply calls out to the wrapper, so that commands are changed as follows: ctdb lvsmaster -> ctdb lvs master ctdb lvs -> ctdb lvs list This provides a simple, extensible interface and means that "ctdb lvs status" is also available. Unit tests are streamlined so that there is a single test for each CTDB state. Each test does "master", "list" and "status" sub-tests. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 7c5822cd89d..326c69580a0 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -723,38 +723,36 @@ MonitorInterval = 15 - lvsmaster + lvs {master|list|status} - This command shows which node is currently the LVSMASTER. The - LVSMASTER is the node in the cluster which drives the LVS system and - which receives all incoming traffic from clients. - - - LVS is the mode where the entire CTDB/Samba cluster uses a single - ip address for the entire cluster. In this mode all clients connect to - one specific node which will then multiplex/loadbalance the clients - evenly onto the other nodes in the cluster. This is an alternative to using - public ip addresses. See the manpage for ctdbd for more information - about LVS. - - - - - lvs - - This command shows which nodes in the cluster are currently active in the - LVS configuration. I.e. which nodes we are currently loadbalancing - the single ip address across. + This command shows different aspects of LVS status. For an + overview of CTDB's LVS functionality please see the + LVS section in + ctdb + 7. + + + master + + + Shows the PNN of the current LVS master node. + - LVS will by default only loadbalance across those nodes that are both - LVS capable and also HEALTHY. Except if all nodes are UNHEALTHY in which - case LVS will loadbalance across all UNHEALTHY nodes as well. - LVS will never use nodes that are DISCONNECTED, STOPPED, BANNED or - DISABLED. + Example output: - + +Node 2 is LVS master + + + + + list + + + Lists the currently usable LVS nodes. + Example output: @@ -762,6 +760,26 @@ MonitorInterval = 15 2:10.0.0.13 3:10.0.0.14 + + + + status + + + List the nodes in the current LVS group and their status. + + + Example output: + + +pnn:0 10.0.0.11 UNHEALTHY (THIS NODE) +pnn:1 10.0.0.12 UNHEALTHY +pnn:2 10.0.0.13 OK +pnn:3 10.0.0.14 OK + + + + diff --git a/ctdb/tests/tool/stubby.lvs.001.sh b/ctdb/tests/tool/stubby.lvs.001.sh index 2ff8eaa9314..46fbef55fea 100755 --- a/ctdb/tests/tool/stubby.lvs.001.sh +++ b/ctdb/tests/tool/stubby.lvs.001.sh @@ -7,10 +7,7 @@ define_test "3 nodes, no LVS, all ok" setup_lvs <" },