commit
bcf7c23d08
|
@ -77,7 +77,7 @@ public class TDNode {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(binPath.equals("")) {
|
if(binPath.isEmpty()) {
|
||||||
System.out.println("taosd not found");
|
System.out.println("taosd not found");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -106,14 +106,10 @@ public class TDNode {
|
||||||
String toBeKilled = "taosd";
|
String toBeKilled = "taosd";
|
||||||
|
|
||||||
if (this.running != 0) {
|
if (this.running != 0) {
|
||||||
String psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print " + toBeKilled + "}'";
|
String killCmd = "pkill -kill -x " + toBeKilled;
|
||||||
try {
|
String[] killCmds = {"sh", "-c", killCmd};
|
||||||
Process ps = Runtime.getRuntime().exec(psCmd);
|
try {
|
||||||
ps.waitFor();
|
Runtime.getRuntime().exec(killCmds).waitFor();
|
||||||
long pid = ps.pid();
|
|
||||||
|
|
||||||
String killCmd = "kill -9 " + pid;
|
|
||||||
Runtime.getRuntime().exec(killCmd).waitFor();
|
|
||||||
|
|
||||||
for(int port = 6030; port < 6041; port ++) {
|
for(int port = 6030; port < 6041; port ++) {
|
||||||
String fuserCmd = "fuser -k -n tcp " + port;
|
String fuserCmd = "fuser -k -n tcp " + port;
|
||||||
|
@ -124,7 +120,7 @@ public class TDNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.running = 0;
|
this.running = 0;
|
||||||
System.out.println("dnode:" + this.index + "is stopped by kill -9");
|
System.out.println("dnode:" + this.index + " is stopped by pkill");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +133,6 @@ public class TDNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void stopIP() {
|
public void stopIP() {
|
||||||
try{
|
try{
|
||||||
String cmd = "sudo ifconfig lo:" + index + "192.168.0." + index + " down";
|
String cmd = "sudo ifconfig lo:" + index + "192.168.0." + index + " down";
|
||||||
|
|
|
@ -16,11 +16,9 @@ public class TDNodes {
|
||||||
|
|
||||||
public void setPath(String path) {
|
public void setPath(String path) {
|
||||||
try {
|
try {
|
||||||
String psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'" ;
|
String killCmd = "pkill -kill -x taosd";
|
||||||
Process ps = Runtime.getRuntime().exec(psCmd);
|
String[] killCmds = {"sh", "-c", killCmd};
|
||||||
ps.waitFor();
|
Runtime.getRuntime().exec(killCmds).waitFor();
|
||||||
String killCmd = "kill -9 " + ps.pid();
|
|
||||||
Runtime.getRuntime().exec(killCmd).waitFor();
|
|
||||||
|
|
||||||
String binPath = System.getProperty("user.dir");
|
String binPath = System.getProperty("user.dir");
|
||||||
binPath += "/../../../debug";
|
binPath += "/../../../debug";
|
||||||
|
|
Loading…
Reference in New Issue