@@ -120,6 +120,7 @@ OPTIONS:
120120 -d Cleanup the cluster containers
121121 -u Run test as a normal user like in Public Cloud, eg. Azure
122122 -q Create a qnetd node(with -n and -x option, and named 'qnetd-node')
123+ -S Not start cluster right after creating the cluster node
123124
124125EXAMPLES:
125126To launch 2 nodes with the running cluster with the very basic corosync.conf
@@ -335,11 +336,8 @@ config_cluster() {
335336}
336337
337338
338- start_cluster () {
339- if [ ${# hanode_list_current_cluster[@]} -ne 0 ] && [ ${# hanode_list_new_members[@]} -ne 0 ]; then
340- podman_exec hanode1 " corosync-cfgtool -R > /dev/null"
341- info On the existing cluster hanode{1..${# hanode_list_current_cluster[@]} }: reloading corosync.conf ... Done
342- fi
339+ start_cluster_on_new_nodes () {
340+ [ " $START_CLUSTER_NOW " -eq 0 ] && return
343341
344342 for node in ${hanode_list_new_members[@]} ; do
345343 podman_exec $node " crm cluster enable && crm cluster start" 1> /dev/null
@@ -352,6 +350,16 @@ start_cluster() {
352350}
353351
354352
353+ start_cluster () {
354+ if [ ${# hanode_list_current_cluster[@]} -ne 0 ] && [ ${# hanode_list_new_members[@]} -ne 0 ]; then
355+ podman_exec hanode1 " corosync-cfgtool -R > /dev/null"
356+ info On the existing cluster hanode{1..${# hanode_list_current_cluster[@]} }: reloading corosync.conf ... Done
357+ fi
358+
359+ start_cluster_on_new_nodes
360+ }
361+
362+
355363search_running_container_by_name () {
356364 podman ps -a --format ' {{.Names}}' | grep -q " ^$1 $"
357365}
@@ -470,7 +478,8 @@ WITH_QNETD_NODE=0
470478NORMAL_USER_FLAG=0
471479CONFIG_COROSYNC_FLAG=1
472480SETUP_N_NODES_CLUSTER=0
473- options=$( getopt -l " help" -o " hldxuqn:" -- " $@ " )
481+ START_CLUSTER_NOW=1
482+ options=$( getopt -l " help" -o " hldxuqn:S" -- " $@ " )
474483eval set -- " $options "
475484while true ; do
476485case $1 in
@@ -501,6 +510,10 @@ case $1 in
501510 SETUP_N_NODES_CLUSTER=$1
502511 shift
503512 ;;
513+ -S)
514+ START_CLUSTER_NOW=0
515+ shift
516+ ;;
504517--)
505518 shift
506519 break
0 commit comments