未验证 提交 6e250e54 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2877 from taosdata/hotfix/sangshuduo/fix-opentsdb-test-ip

fix hard code server ip in opentsdb test program.
......@@ -206,16 +206,6 @@
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
......
import com.stumbleupon.async.Callback;
import com.stumbleupon.async.Deferred;
import lombok.extern.slf4j.Slf4j;
import net.opentsdb.core.TSDB;
import net.opentsdb.uid.NoSuchUniqueName;
......@@ -40,13 +39,19 @@ import java.util.concurrent.*;
import java.math.*;
import java.lang.reflect.Method;
import org.apache.log4j.Logger;
import org.apache.log4j.LogManager;
import org.apache.log4j.Level;
public class OpentsdbTest{
public class OpentsdbTest{
//static { System.setProperty("logback.configurationFile", "/home/ubuntu/fang/opentsdb/opentsdbtest/logback.xml");}
static { System.setProperty("logback.configurationFile", "/etc/opentsdb/logback.xml");}
public static void main(String args[]) {
Logger logger = LogManager.getLogger(OpentsdbTest.class);
logger.setLevel(Level.OFF);
// begin to parse argument
String datadir = "/home/ubuntu/testdata";
String sqlchoice = "q1";
......@@ -156,7 +161,7 @@ public class OpentsdbTest{
}
switch (sqlchoice) {
case "q1":
get_url = "http://192.168.1.114:4242/api/query?";
get_url = "http://127.0.0.1:4242/api/query?";
/*
get_url = get_url + "start=1563249700&m=none:temperature{devgroup=";
get_url = get_url + String.valueOf(ig-10) +"}";
......
import com.stumbleupon.async.Callback;
import com.stumbleupon.async.Deferred;
import lombok.extern.slf4j.Slf4j;
import net.opentsdb.core.TSDB;
import net.opentsdb.uid.NoSuchUniqueName;
......@@ -64,7 +63,7 @@ public class WriteThread extends Thread {
public void run() {
StringEntity stringEntity;
String port = "4242";
String put_url = "http://192.168.1.114:"+port+"/api/put?summary";
String put_url = "http://127.0.0.1:"+port+"/api/put?summary";
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
/*
httpclient.getHttpConnectionManager().getParams()
......@@ -152,4 +151,4 @@ public class WriteThread extends Thread {
System.out.println("failed to connect");
}
}//end run
}//end class
\ No newline at end of file
}//end class
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册