From 9f5fde414d114e02e686f59f40e5080fedc70224 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 7 Jun 2017 13:29:14 +0800 Subject: [PATCH] main: Display reason why cluster cannot be formed --- exec/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/exec/main.c b/exec/main.c index 7d2dcf7c..da9e1ecd 100644 --- a/exec/main.c +++ b/exec/main.c @@ -497,6 +497,7 @@ static void corosync_totem_stats_updater (void *data) uint32_t total_token_holdtime; int t, prev, i; int32_t token_count; + const char *cstr; char key_name[ICMAP_KEYNAME_MAXLEN]; stats = api->totem_get_stats(); @@ -535,11 +536,18 @@ static void corosync_totem_stats_updater (void *data) if (stats->mrp->srp->continuous_gather > MAX_NO_CONT_GATHER || stats->mrp->srp->continuous_sendmsg_failures > MAX_NO_CONT_SENDMSG_FAILURES) { + cstr = ""; + if (stats->mrp->srp->continuous_sendmsg_failures > MAX_NO_CONT_SENDMSG_FAILURES) { + cstr = "number of multicast sendmsg failures is above threshold"; + } + if (stats->mrp->srp->continuous_gather > MAX_NO_CONT_GATHER) { + cstr = "totem is continuously in gather state"; + } log_printf (LOGSYS_LEVEL_WARNING, "Totem is unable to form a cluster because of an " - "operating system or network fault. The most common " + "operating system or network fault(reason: %s). The most common " "cause of this message is that the local firewall is " - "configured improperly."); + "configured improperly.", cstr); icmap_set_uint8("runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure", 1); } else { icmap_set_uint8("runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure", 0); -- 2.12.0