CTDB_START_AS_DISABLED="yes"
and command line argument
--start-as-disabled
When set, this makes the ctdb node to always start in DISABLED mode and will thus not host any public ip addresses.
The administrator must manually "ctdb enable" the node after it has started when the administrator wants the node to start hosting public ip addresses.
Using this option it is possible to start ctdb on a node without causing any reallocation of ip addresses when it is starting. The node will still merge with the cluster and there will still be a recovery phase but the ip address allocations will not change in the cluster.
(This used to be ctdb commit
b93d29f43f5306c244c887b54a77bca8a061daf2)
[ -z "$CTDB_EVENT_SCRIPT_DIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --event-script-dir $CTDB_EVENT_SCRIPT_DIR"
[ -z "$CTDB_TRANSPORT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --transport $CTDB_TRANSPORT"
[ -z "$CTDB_DEBUGLEVEL" ] || CTDB_OPTIONS="$CTDB_OPTIONS -d $CTDB_DEBUGLEVEL"
+[ -z "$CTDB_START_AS_DISABLED" ] || [ "$CTDB_START_AS_DISABLED" != "yes" ] || {
+ CTDB_OPTIONS="$CTDB_OPTIONS --start-as-disabled"
+}
if [ -x /sbin/startproc ]; then
init_style="suse"
# When set, this variable makes ctdb monitor the amount of free memory
# in the system (the second number in the buffers/cache output from free -m).
# If the amount of free memory drops below this treshold the node will become
-# unhealthy and will be marked as DISABLED.
-# Once a node is disabled it requires administrator intervention to enable the
-# node again using the "ctdb enable" command.
+# unhealthy and ctdb and all managed services will be shutdown.
+# Once this occurs, the administrator needs to find the reason for the OOM
+# situation, rectify it and restart ctdb with "service ctdb start"
# The unit is MByte
# CTDB_MONITOR_FREE_MEMORY=100
+# When set to yes, the CTDB node will start in DISABLED mode and not host
+# any public ip addresses. The administrator needs to explicitely enable
+# the node with "ctdb enable"
+# CTDB_START_AS_DISABLED="yes"
+
# where to log messages
# the default is /var/log/log.ctdb
# CTDB_LOGFILE=/var/log/log.ctdb
const char *node_ip;
struct ctdb_monitor_state *monitor;
struct ctdb_log_state *log;
+ int start_as_disabled;
};
struct ctdb_db_context {
if (ctdb->address.address &&
ctdb_same_address(&ctdb->address, &node->address)) {
+ /* for automatic binding to interfaces, see tcp_connect.c */
ctdb->pnn = node->pnn;
node->flags &= ~NODE_FLAGS_DISCONNECTED;
+
+ /* do we start out in DISABLED mode? */
+ if (ctdb->start_as_disabled != 0) {
+ node->flags |= NODE_FLAGS_DISABLED;
+ }
}
ctdb->num_nodes++;
const char *node_ip;
int no_setsched;
int use_syslog;
+ int start_as_disabled;
} options = {
.nlist = ETCDIR "/ctdb/nodes",
.transport = "tcp",
{ "reclock", 0, POPT_ARG_STRING, &options.recovery_lock_file, 0, "location of recovery lock file", "filename" },
{ "nosetsched", 0, POPT_ARG_NONE, &options.no_setsched, 0, "disable setscheduler SCHED_FIFO call", NULL },
{ "syslog", 0, POPT_ARG_NONE, &options.use_syslog, 0, "log messages to syslog", NULL },
+ { "start-as-disabled", 0, POPT_ARG_NONE, &options.start_as_disabled, 0, "Node starts in disabled state", NULL },
POPT_TABLEEND
};
int opt, ret;
ctdb = ctdb_cmdline_init(ev);
+ ctdb->start_as_disabled = options.start_as_disabled;
+
ret = ctdb_set_logfile(ctdb, options.logfile, options.use_syslog);
if (ret == -1) {
printf("ctdb_set_logfile to %s failed - %s\n",
ctdb->address.address,
ctdb->address.port,
ctdb->pnn));
-
+ /* do we start out in DISABLED mode? */
+ if (ctdb->start_as_disabled != 0) {
+ ctdb->nodes[i]->flags |= NODE_FLAGS_DISABLED;
+ }
+
if (listen(ctcp->listen_fd, 10) == -1) {
goto failed;
}