|
|
|
@ -53,6 +53,7 @@ public class SetVolume {
|
|
|
|
|
command = "gluster volume create " + volumeName + " " + type + " " + count + " " + commandarg + "force";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// command=command+"& gluster volume start "+volumeName;
|
|
|
|
|
// 执行命令
|
|
|
|
|
List<String> reStrings = Constant.ganymedSSH.execCmdWaitAcquiescent(command);
|
|
|
|
|
|
|
|
|
@ -77,7 +78,7 @@ public class SetVolume {
|
|
|
|
|
if (reStrings3.size() == 0 || reStrings.get(0).contains("GlusterFS is already mounted")) {
|
|
|
|
|
log.info("mount point successed!");
|
|
|
|
|
String addRecord = "echo \"" + volumeName + ":" + mountPoint + "\" >> " + Constant.MountRecord;
|
|
|
|
|
Constant.ganymedSSH.execCmdNoWaitAcquiescent(addRecord);
|
|
|
|
|
List<String> reStrings1=Constant.ganymedSSH.execCmdWaitAcquiescent(addRecord);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -483,16 +484,16 @@ public class SetVolume {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
// @Test
|
|
|
|
|
public void test_deleteVolume(){
|
|
|
|
|
System.out.println(deleteVolume("lili_test1"));
|
|
|
|
|
System.out.println(deleteVolume("lili_test"));
|
|
|
|
|
}
|
|
|
|
|
// @Test
|
|
|
|
|
@Test
|
|
|
|
|
public void test_createVolume(){
|
|
|
|
|
List<String> bricksToCreate = new ArrayList<String>();
|
|
|
|
|
bricksToCreate.add("192.168.0.110:/lili_test1");
|
|
|
|
|
bricksToCreate.add("192.168.0.116:/lili_test1");
|
|
|
|
|
System.out.println(createVolume("lili_test1", 0, "distributed", bricksToCreate, "/home/lili_test1_point"));
|
|
|
|
|
bricksToCreate.add("192.168.191.22:/lili_test");
|
|
|
|
|
bricksToCreate.add("192.168.191.23:/lili_test");
|
|
|
|
|
System.out.println(createVolume("lili_test", 0, "distributed", bricksToCreate, "/home/lili_test_point"));
|
|
|
|
|
}
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
SetVolume setVolume = new SetVolume();
|
|
|
|
|