From 5eb13b2eeb778b77587e48b8ceb5c2fd21371529 Mon Sep 17 00:00:00 2001 From: Bin Qian Date: Fri, 1 Jun 2018 13:45:08 -0400 Subject: [PATCH] Controller Services swact/failover time reduction Add full support for Active/Active redudancy model 1. services could have enable dependency to services in other service groups (standby group) 2. An active/active service failure will degraded the service group it is in 3. A failure of active/active service would not prevent a swact 4. Locking a controller that is sole active/active service provider will be rejected. But lock with force option will still proceed to lock the node. 5. sm-api bind to port 7777 on mgmt interface. (was localhost:7777) Change-Id: I0da78a51a50fd60ec128edc91c2eeec31af4a956 Signed-off-by: Jack Ding --- .../cgts-mtce-common-1.0/common/hostUtil.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mtce-common/cgts-mtce-common-1.0/common/hostUtil.cpp b/mtce-common/cgts-mtce-common-1.0/common/hostUtil.cpp index ed079ea1..dc75442c 100644 --- a/mtce-common/cgts-mtce-common-1.0/common/hostUtil.cpp +++ b/mtce-common/cgts-mtce-common-1.0/common/hostUtil.cpp @@ -11,6 +11,17 @@ */ #include "hostUtil.h" +#include "nodeBase.h" +static char local_hostname[MAX_HOST_NAME_SIZE+1] = {0}; + +const char* hostUtil_get_hostname() +{ + if(*local_hostname == '\0') + { + gethostname(local_hostname, MAX_HOST_NAME_SIZE); + } + return local_hostname; +} string hostUtil_getServiceIp ( mtc_service_enum service ) { @@ -38,6 +49,8 @@ string hostUtil_getServiceIp ( mtc_service_enum service ) break ; } case SERVICE_SMGR: + ip = hostUtil_get_hostname(); + break; case SERVICE_VIM: { ip = "localhost" ;