|
|
|
@ -39,7 +39,7 @@ public class ClusterInfo {
|
|
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, String> showClusterInfo() {
|
|
|
|
|
log.info("get cluster info");
|
|
|
|
|
// log.info("get cluster info");
|
|
|
|
|
Map<String, String> peerIps = new HashMap<String, String>();
|
|
|
|
|
|
|
|
|
|
List<String> reStrings = Constant.ganymedSSH.execCmdWaitAcquiescent(Constant.glusterPeerStatus);
|
|
|
|
@ -90,24 +90,28 @@ public class ClusterInfo {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (Map.Entry<String, String> entry:peerIps.entrySet()){
|
|
|
|
|
String key=entry.getKey();
|
|
|
|
|
String value=entry.getValue();
|
|
|
|
|
if(Constant.ganymedSSH.otherConns==null){
|
|
|
|
|
Constant.ganymedSSH.otherConns=new HashMap<String,Connection>();
|
|
|
|
|
}
|
|
|
|
|
if(!Constant.ganymedSSH.otherConns.containsKey(key)){
|
|
|
|
|
Connection connection=null;
|
|
|
|
|
try {
|
|
|
|
|
connection = Constant.ganymedSSH.getOpenedConnection(key, Constant.rootUser, Constant.rootPasswd, Constant.port);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
Constant.ganymedSSH.otherConns.put(key,connection);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
peerIps.put(Constant.hostIp, Constant.peerincluster_connected);
|
|
|
|
|
// for (Map.Entry<String, String> entry:peerIps.entrySet()){
|
|
|
|
|
// String key=entry.getKey();
|
|
|
|
|
// if(key.equals(Constant.hostIp)){
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// String value=entry.getValue();
|
|
|
|
|
// if(Constant.ganymedSSH.otherConns==null){
|
|
|
|
|
// Constant.ganymedSSH.otherConns=new HashMap<String,Connection>();
|
|
|
|
|
// }
|
|
|
|
|
// if(!Constant.ganymedSSH.otherConns.containsKey(key)){
|
|
|
|
|
// Connection connection=null;
|
|
|
|
|
// try {
|
|
|
|
|
// connection = Constant.ganymedSSH.getOpenedConnection(key, Constant.rootUser, Constant.rootPasswd, Constant.port);
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// // TODO Auto-generated catch block
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// Constant.ganymedSSH.otherConns.put(key,connection);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return peerIps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|