diff options
author | Martin Schwenke <martin@meltin.net> | 2020-07-17 20:46:07 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2020-07-24 08:37:31 +0000 |
commit | f37b3cf2a64e066d4f261d453233dc9a0988aed7 (patch) | |
tree | db60147560e348962e2c0b99a64b48eb17889553 /ctdb | |
parent | 16b848553da47f0716d74c13bbbfba50ef5d2cd1 (diff) | |
download | samba-f37b3cf2a64e066d4f261d453233dc9a0988aed7.tar.gz |
ctdb: Change LVS to use leader/follower
Instead of master/slave.
Nearly all of these are simple textual substitutions, which preserve
the case of the original. A couple of minor cleanups were made in the
documentation (such as "LVSMASTER" -> "LVS leader").
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/config/events/legacy/91.lvs.script | 12 | ||||
-rw-r--r-- | ctdb/doc/ctdb-script.options.5.xml | 8 | ||||
-rw-r--r-- | ctdb/doc/ctdb.1.xml | 6 | ||||
-rw-r--r-- | ctdb/doc/ctdb.7.xml | 22 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.013.sh | 4 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.014.sh | 4 | ||||
-rw-r--r-- | ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh | 10 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs | 10 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.001.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.002.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.003.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.004.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.005.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.006.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.007.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/tool/ctdb.lvs.008.sh | 2 | ||||
-rw-r--r-- | ctdb/tools/ctdb.c | 2 | ||||
-rwxr-xr-x | ctdb/tools/ctdb_lvs | 16 |
19 files changed, 56 insertions, 56 deletions
diff --git a/ctdb/config/events/legacy/91.lvs.script b/ctdb/config/events/legacy/91.lvs.script index b3d65f44607..05f0431b661 100755 --- a/ctdb/config/events/legacy/91.lvs.script +++ b/ctdb/config/events/legacy/91.lvs.script @@ -19,11 +19,11 @@ if ! type ipvsadm >/dev/null 2>&1 ; then fi -lvs_slave_only () +lvs_follower_only () { _ip_address=$(ctdb_get_ip_address) awk -v my_ip="$_ip_address" \ - '$1 == my_ip { if ($2 ~ "slave-only") { exit 0 } else { exit 1 } }' \ + '$1 == my_ip { if ($2 ~ "follower-only") { exit 0 } else { exit 1 } }' \ "$CTDB_LVS_NODES" } @@ -33,7 +33,7 @@ lvs_check_config () die "error: CTDB_LVS_NODES=${CTDB_LVS_NODES} unreadable" [ -n "$CTDB_LVS_PUBLIC_IP" ] || \ die "Invalid configuration: CTDB_LVS_PUBLIC_IP not set" - if ! lvs_slave_only ; then + if ! lvs_follower_only ; then [ -n "$CTDB_LVS_PUBLIC_IFACE" ] || \ die "Invalid configuration: CTDB_LVS_PUBLIC_IFACE not set" fi @@ -78,9 +78,9 @@ ipreallocated) "$CTDB_LVS_PUBLIC_IFACE" "$CTDB_LVS_PUBLIC_IP" pnn=$(ctdb_get_pnn) - lvsmaster=$("${CTDB_HELPER_BINDIR}/ctdb_lvs" master) - if [ "$pnn" != "$lvsmaster" ] ; then - # This node is not the LVS master so change the IP address + lvsleader=$("${CTDB_HELPER_BINDIR}/ctdb_lvs" leader) + if [ "$pnn" != "$lvsleader" ] ; then + # This node is not the LVS leader so change the IP address # to have scope "host" so this node won't respond to ARPs ip addr del "${CTDB_LVS_PUBLIC_IP}/32" dev lo >/dev/null 2>&1 ip addr add "${CTDB_LVS_PUBLIC_IP}/32" dev lo scope host diff --git a/ctdb/doc/ctdb-script.options.5.xml b/ctdb/doc/ctdb-script.options.5.xml index d46de369c5c..700d1f7bd35 100644 --- a/ctdb/doc/ctdb-script.options.5.xml +++ b/ctdb/doc/ctdb-script.options.5.xml @@ -451,7 +451,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 <para> File format: <screen> -<parameter>IPADDR</parameter> <optional>slave-only</optional> +<parameter>IPADDR</parameter> <optional>follower-only</optional> </screen> </para> <para> @@ -459,8 +459,8 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 group. </para> <para> - If "slave-only" is specified then the corresponding node - can not be the LVS master node. In this case + If "follower-only" is specified then the corresponding node + can not be the LVS leader node. In this case <varname>CTDB_LVS_PUBLIC_IFACE</varname> and <varname>CTDB_LVS_PUBLIC_IP</varname> are optional and unused. @@ -480,7 +480,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 <para> INTERFACE is the network interface that clients will use to connection to <varname>CTDB_LVS_PUBLIC_IP</varname>. - This is optional for slave-only nodes. + This is optional for follower-only nodes. No default. </para> </listitem> diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 9b530087e92..217a6d3e41a 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -864,7 +864,7 @@ MonitorInterval = 15 </refsect2> <refsect2> - <title>lvs {master|list|status}</title> + <title>lvs {leader|list|status}</title> <para> This command shows different aspects of LVS status. For an overview of CTDB's LVS functionality please see the @@ -875,10 +875,10 @@ MonitorInterval = 15 <variablelist> <varlistentry> - <term>master</term> + <term>leader</term> <listitem> <para> - Shows the PNN of the current LVS master node. + Shows the PNN of the current LVS leader node. </para> <para> Example output: diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml index 5ec69e4c871..7fd61af0964 100644 --- a/ctdb/doc/ctdb.7.xml +++ b/ctdb/doc/ctdb.7.xml @@ -528,13 +528,13 @@ Node 3:/usr/local/etc/ctdb/public_addresses <para> In each LVS group, one of the nodes is selected by CTDB to be - the LVS master. This node receives all traffic from clients + the LVS leader. This node receives all traffic from clients coming in to the LVS public address and multiplexes it across the internal network to one of the nodes that LVS is using. When responding to the client, that node will send the data back - directly to the client, bypassing the LVS master node. The - command <command>ctdb lvs master</command> will show which node - is the current LVS master. + directly to the client, bypassing the LVS leader node. The + command <command>ctdb lvs leader</command> will show which node + is the current LVS leader. </para> <para> @@ -542,12 +542,12 @@ Node 3:/usr/local/etc/ctdb/public_addresses <orderedlist> <listitem> <para> - Client sends request packet to LVSMASTER. + Client sends request packet to LVS leader. </para> </listitem> <listitem> <para> - LVSMASTER passes the request on to one node across the + LVS leader passes the request on to one node across the internal network. </para> </listitem> @@ -572,7 +572,7 @@ Node 3:/usr/local/etc/ctdb/public_addresses pattern is write-intensive since you will be limited in the available network bandwidth that node can handle. LVS does work very well for read-intensive workloads where only smallish READ - requests are going through the LVSMASTER bottleneck and the + requests are going through the LVS leader bottleneck and the majority of the traffic volume (the data in the read replies) goes straight from the processing node back to the clients. For read-intensive i/o patterns you can achieve very high throughput @@ -631,21 +631,21 @@ CTDB_LVS_NODES=/usr/local/etc/ctdb/lvs_nodes </screen> <para> - Normally any node in an LVS group can act as the LVS master. + Normally any node in an LVS group can act as the LVS leader. Nodes that are highly loaded due to other demands maybe - flagged with the "slave-only" option in the + flagged with the "follower-only" option in the <varname>CTDB_LVS_NODES</varname> file to limit the LVS functionality of those nodes. </para> <para> LVS nodes file that excludes 192.168.1.4 from being - the LVS master node: + the LVS leader node: </para> <screen format="linespecific"> 192.168.1.2 192.168.1.3 -192.168.1.4 slave-only +192.168.1.4 follower-only </screen> </refsect2> diff --git a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh index 970a4aa9ccf..15328efba97 100755 --- a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh +++ b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh @@ -2,7 +2,7 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -define_test "nodes in config, no master (e.g. all inactive)" +define_test "nodes in config, no leader (e.g. all inactive)" setup "10.1.1.201" "eth0" <<EOF 192.168.1.1 diff --git a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.013.sh b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.013.sh index 0720036b448..918b18db352 100755 --- a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.013.sh +++ b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.013.sh @@ -2,11 +2,11 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -define_test "nodes in config, other node is master" +define_test "nodes in config, other node is leader" setup "10.1.1.201" "eth0" <<EOF 192.168.1.1 -192.168.1.2 master +192.168.1.2 leader 192.168.1.3 EOF diff --git a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.014.sh b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.014.sh index 19788d7bc8c..8af31d7f618 100755 --- a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.014.sh +++ b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.014.sh @@ -2,10 +2,10 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -define_test "nodes in config, this is master" +define_test "nodes in config, this is leader" setup "10.1.1.201" "eth0" <<EOF -192.168.1.1 master +192.168.1.1 leader 192.168.1.2 192.168.1.3 EOF diff --git a/ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh b/ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh index a29c4d353fd..a8104eb0b3d 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh @@ -17,18 +17,18 @@ CTDB_LVS_PUBLIC_IP="$_ip" CTDB_LVS_PUBLIC_IFACE="$_iface" EOF - export FAKE_CTDB_LVS_MASTER="" + export FAKE_CTDB_LVS_LEADER="" # Read from stdin _pnn=0 while read _ip _opts ; do case "$_opts" in - master) - FAKE_CTDB_LVS_MASTER="$_pnn" + leader) + FAKE_CTDB_LVS_LEADER="$_pnn" echo "$_ip" ;; - slave-only) - printf "%s\tslave-only\n" "$_ip" + follower-only) + printf "%s\tfollower-only\n" "$_ip" ;; *) echo "$_ip" diff --git a/ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs b/ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs index 5dfb24901e3..85e005c0b36 100755 --- a/ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs +++ b/ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs @@ -13,7 +13,7 @@ not_implemented_exit_code=1 usage () { cat >&2 <<EOF -Usage: $prog { master | list } +Usage: $prog { leader | list } EOF exit 1 } @@ -24,10 +24,10 @@ not_implemented () exit $not_implemented_exit_code } -ctdb_lvs_master () +ctdb_lvs_leader () { - if [ -n "$FAKE_CTDB_LVS_MASTER" ] ; then - echo "$FAKE_CTDB_LVS_MASTER" + if [ -n "$FAKE_CTDB_LVS_LEADER" ] ; then + echo "$FAKE_CTDB_LVS_LEADER" return 0 else return 255 @@ -46,7 +46,7 @@ ctdb_lvs_list () ###################################################################### case "$1" in - master) ctdb_lvs_master "$@" ;; + leader) ctdb_lvs_leader "$@" ;; list) ctdb_lvs_list "$@" ;; *) not_implemented "$1" ;; esac diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.001.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.001.sh index 411072c5da4..70c726c7b3c 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.001.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.001.sh @@ -19,7 +19,7 @@ EOF required_result 255 <<EOF EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.002.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.002.sh index 5344b166a4e..edde656478b 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.002.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.002.sh @@ -23,7 +23,7 @@ required_result 0 <<EOF 0 EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.003.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.003.sh index c3d1f7221f1..0045ae47281 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.003.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.003.sh @@ -22,7 +22,7 @@ required_result 0 <<EOF 0 EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.004.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.004.sh index ea1d1887fe6..255966d2588 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.004.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.004.sh @@ -23,7 +23,7 @@ required_result 0 <<EOF 1 EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.005.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.005.sh index 592224863ea..73fcd80b5be 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.005.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.005.sh @@ -23,7 +23,7 @@ required_result 0 <<EOF 0 EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.006.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.006.sh index 2f9859a6be8..55b43103b0c 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.006.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.006.sh @@ -23,7 +23,7 @@ required_result 0 <<EOF 2 EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.007.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.007.sh index dd47b9e69ca..3dd1104623a 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.007.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.007.sh @@ -22,7 +22,7 @@ EOF required_result 255 <<EOF EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tests/UNIT/tool/ctdb.lvs.008.sh b/ctdb/tests/UNIT/tool/ctdb.lvs.008.sh index 6cdd702c57c..1997f4c2909 100755 --- a/ctdb/tests/UNIT/tool/ctdb.lvs.008.sh +++ b/ctdb/tests/UNIT/tool/ctdb.lvs.008.sh @@ -41,7 +41,7 @@ Failed to detect PNN of the current node. Is this node part of CTDB cluster? EOF -simple_test master +simple_test leader ##### diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 01803efa696..171069d7ebf 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5954,7 +5954,7 @@ static const struct ctdb_cmd { { "pnn", control_pnn, false, false, "show the pnn of the currnet node", NULL }, { "lvs", control_lvs, false, false, - "show lvs configuration", "master|list|status" }, + "show lvs configuration", "leader|list|status" }, { "setdebug", control_setdebug, false, true, "set debug level", "ERROR|WARNING|NOTICE|INFO|DEBUG" }, { "getdebug", control_getdebug, false, true, diff --git a/ctdb/tools/ctdb_lvs b/ctdb/tools/ctdb_lvs index ec679c5e357..ee521ba2bc1 100755 --- a/ctdb/tools/ctdb_lvs +++ b/ctdb/tools/ctdb_lvs @@ -23,7 +23,7 @@ usage () $0 <option> <option> is one of: - master Display node number of master node + leader Display node number of leader node list List node number and private IP address of usable nodes in group status Show status of all nodes in LVS group EOF @@ -72,7 +72,7 @@ get_lvs_nodes () \#*) continue ;; esac case "$_options" in - slave-only|"") : ;; + follower-only|"") : ;; *) die "${prog}: Invalid options \"${_options}\" in \"$CTDB_LVS_NODES\"" esac done <<EOF @@ -124,13 +124,13 @@ $nodestatus_X EOF } -# Print the PNN of the LVS master node -find_master () +# Print the PNN of the LVS leader node +find_leader () { get_lvs_nodes || \ die "${prog}: LVS nodes file \"$CTDB_LVS_NODES\" not found" - # $_ms is an @-delimited list of nodes that are allowed to be the master + # $_ms is an @-delimited list of nodes that are allowed to be the leader _ms="@" while read _ip _options ; do case "$_options" in @@ -140,8 +140,8 @@ find_master () $lvs_nodes EOF - _master_candidates=$(filter_nodes "$_ms") || return $? - echo "${_master_candidates%% *}" + _leader_candidates=$(filter_nodes "$_ms") || return $? + echo "${_leader_candidates%% *}" } # List all usable nodes in the LVS group @@ -197,7 +197,7 @@ prog=$(basename "$0") cmd="$1" case "$cmd" in -master) find_master ;; +leader) find_leader ;; list) nodes_list ;; status) nodes_status ;; *) usage ;; |