Kaa DataCollectionDemo无法正常工作

时间:2017-09-18 00:59:21

标签: kaa

我下载了DataCollectionDemo(java版)。它抛出以下错误

注意:我的Kaa-sandbox服务器正在AWS上运行,并且没有网络连接问题

$ java -jar DataCollectionDemo.jar
2017-09-18 06:24:59,181 [main] INFO  o.k.k.d.d.DataCollectionDemo - --= Data collection demo started =--
2017-09-18 06:25:02,869 [pool-2-thread-1] INFO  o.k.k.d.d.DataCollectionDemo - --= Kaa client started =--
2017-09-18 06:25:04,868 [main] INFO  o.k.k.d.d.DataCollectionDemo - --= Temperature measurement is started =--
2017-09-18 06:25:04,868 [main] INFO  o.k.k.d.d.DataCollectionDemo - *** Press Enter to stop sending log records ***
2017-09-18 06:25:04,872 [pool-6-thread-1] INFO  o.k.k.d.d.DataCollectionDemo - Log record {"temperature": 17, "timeStamp": 1505696104869} submitted for sending
2017-09-18 06:25:20,770 [pool-1-thread-1] ERROR o.k.k.c.c.i.c.DefaultBootstrapChannel - Failed to receive operation servers list {}
org.apache.http.conn.HttpHostConnectException: Connect to ec2-52-201-214-219.compute-1.amazonaws.com:9889 [ec2-52-201-214-219.compute-1.amazonaws.com/52.201.214.219] failed: Connection timed out: connect
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[DataCollectionDemo.jar:na]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106) ~[DataCollectionDemo.jar:na]
    at org.kaaproject.kaa.client.transport.DesktopHttpClient.executeHttpRequest(DesktopHttpClient.java:74) ~[DataCollectionDemo.jar:na]
    at org.kaaproject.kaa.client.channel.impl.channels.DefaultBootstrapChannel.processTypes(DefaultBootstrapChannel.java:56) ~[DataCollectionDemo.jar:na]
    at org.kaaproject.kaa.client.channel.impl.channels.DefaultBootstrapChannel.access$200(DefaultBootstrapChannel.java:32) ~[DataCollectionDemo.jar:na]
    at org.kaaproject.kaa.client.channel.impl.channels.DefaultBootstrapChannel$BootstrapRunnable.run(DefaultBootstrapChannel.java:92) ~[DataCollectionDemo.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_144]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_144]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_144]
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.8.0_144]
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[na:1.8.0_144]
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[na:1.8.0_144]
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[na:1.8.0_144]
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
    at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72) ~[DataCollectionDemo.jar:na]
    at         org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:118) ~[DataCollectionDemo.jar:na]
    ... 18 common frames omitted

1 个答案:

答案 0 :(得分:0)

这是因为您尚未启用kaa管理标签。启用后,必须将Amazon IP地址提供给所提供的空间,然后进行更新。您可以使用

更改gui_change_host_enabled=true中的/usr/lib/kaa-sandbox/conf来启用管理标签
$ sudo nano sandbox-server.properties