|
|
|
@ -41,7 +41,7 @@ public class ClusterInfo {
|
|
|
|
|
public Map<String, String> showClusterInfo() {
|
|
|
|
|
// log.info("get cluster info");
|
|
|
|
|
Map<String, String> peerIps = new HashMap<String, String>();
|
|
|
|
|
|
|
|
|
|
peerIps.put(Constant.hostIp, Constant.peerincluster_connected);
|
|
|
|
|
List<String> reStrings = Constant.ganymedSSH.execCmdWaitAcquiescent(Constant.glusterPeerStatus);
|
|
|
|
|
if (reStrings == null) {
|
|
|
|
|
log.error("1101 command get result is null");
|
|
|
|
@ -51,9 +51,12 @@ public class ClusterInfo {
|
|
|
|
|
log.error("1102 command get result is nothing");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reStrings.get(0).contains("No peers present")) {
|
|
|
|
|
return peerIps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!(reStrings.get(0).split(":")[0].contains("Number of Peers"))) {
|
|
|
|
|
|
|
|
|
|
log.error("1103 get result string wrong");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -90,7 +93,7 @@ public class ClusterInfo {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
peerIps.put(Constant.hostIp, Constant.peerincluster_connected);
|
|
|
|
|
|
|
|
|
|
// for (Map.Entry<String, String> entry:peerIps.entrySet()){
|
|
|
|
|
// String key=entry.getKey();
|
|
|
|
|
// if(key.equals(Constant.hostIp)){
|
|
|
|
|