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>
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"
}
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
"$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
<para>
File format:
<screen>
-<parameter>IPADDR</parameter> <optional>slave-only</optional>
+<parameter>IPADDR</parameter> <optional>follower-only</optional>
</screen>
</para>
<para>
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.
<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>
</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
<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:
<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>
<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>
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
</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>
. "${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
. "${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
. "${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
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"
usage ()
{
cat >&2 <<EOF
-Usage: $prog { master | list }
+Usage: $prog { leader | list }
EOF
exit 1
}
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
######################################################################
case "$1" in
- master) ctdb_lvs_master "$@" ;;
+ leader) ctdb_lvs_leader "$@" ;;
list) ctdb_lvs_list "$@" ;;
*) not_implemented "$1" ;;
esac
required_result 255 <<EOF
EOF
-simple_test master
+simple_test leader
#####
0
EOF
-simple_test master
+simple_test leader
#####
0
EOF
-simple_test master
+simple_test leader
#####
1
EOF
-simple_test master
+simple_test leader
#####
0
EOF
-simple_test master
+simple_test leader
#####
2
EOF
-simple_test master
+simple_test leader
#####
required_result 255 <<EOF
EOF
-simple_test master
+simple_test leader
#####
Is this node part of CTDB cluster?
EOF
-simple_test master
+simple_test leader
#####
{ "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,
$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
\#*) continue ;;
esac
case "$_options" in
- slave-only|"") : ;;
+ follower-only|"") : ;;
*) die "${prog}: Invalid options \"${_options}\" in \"$CTDB_LVS_NODES\""
esac
done <<EOF
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
$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
cmd="$1"
case "$cmd" in
-master) find_master ;;
+leader) find_leader ;;
list) nodes_list ;;
status) nodes_status ;;
*) usage ;;