mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Allow cluster management confliction detection to handle quick manageemnt server restarts
This commit is contained in:
parent
045b6ac319
commit
fa0dd8a228
@ -934,14 +934,22 @@ public class ClusterManagerImpl implements ClusterManager {
|
||||
String peerIP = peer.getServiceIP().trim();
|
||||
if(_clusterNodeIP.equals(peerIP)) {
|
||||
if("127.0.0.1".equals(_clusterNodeIP)) {
|
||||
String msg = "Detected another management node with localhost IP is already running, please check your cluster configuration";
|
||||
s_logger.error(msg);
|
||||
throw new ConfigurationException(msg);
|
||||
if(pingManagementNode(peer.getMsid())) {
|
||||
String msg = "Detected another management node with localhost IP is already running, please check your cluster configuration";
|
||||
s_logger.error(msg);
|
||||
throw new ConfigurationException(msg);
|
||||
} else {
|
||||
String msg = "Detected another management node with localhost IP is considered as running in DB, however it is not pingable, we will continue cluster initialization with this management server node";
|
||||
s_logger.info(msg);
|
||||
}
|
||||
} else {
|
||||
if(!pingManagementNode(peer.getMsid())) {
|
||||
String msg = "Detected that another management node with the same IP " + peer.getServiceIP() + " is already running";
|
||||
if(pingManagementNode(peer.getMsid())) {
|
||||
String msg = "Detected that another management node with the same IP " + peer.getServiceIP() + " is already running, please check your cluster configuration";
|
||||
s_logger.error(msg);
|
||||
throw new ConfigurationException(msg);
|
||||
} else {
|
||||
String msg = "Detected that another management node with the same IP " + peer.getServiceIP() + " is considered as running in DB, however it is not pingable, we will continue cluster initialization with this management server node";
|
||||
s_logger.info(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,11 +23,11 @@ import java.io.StringWriter;
|
||||
public class ExceptionUtil {
|
||||
public static String toString(Throwable th) {
|
||||
final StringWriter writer = new StringWriter();
|
||||
writer.append("Exception: " + th.getClass().getName() + "\n");
|
||||
writer.append("Message: ");
|
||||
writer.append(th.getMessage());
|
||||
writer.append("\n Stack: ");
|
||||
th.printStackTrace(new PrintWriter(writer));
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user