stormcrawler无法连接到elasticsearch

lnxxn5zx  于 2021-06-24  发布在  Storm
关注(0)|答案(2)|浏览(636)

运行命令时:

storm jar target/crawlIndexer-1.0-SNAPSHOT.jar  org.apache.storm.flux.Flux --local es-injector.flux --sleep 86400000

我得到一个错误,说:

8710 [Thread-26-status-executor[4 4]] ERROR c.d.s.e.p.StatusUpdaterBolt - 
Can't connect to ElasticSearch

运行时http://localhost:9200/浏览器中es成功加载。kibana还连接到es。所以这一定是stromcrawler和elasticsearch之间的联系。
有什么问题吗?
完整错误片段:

8710 [Thread-26-status-executor[4 4]] ERROR c.d.s.e.p.StatusUpdaterBolt - Can't connect to ElasticSearch
java.lang.RuntimeException: java.net.UnknownHostException: http: nodename nor servname provided, or not known
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getClient(ElasticSearchConnection.java:107) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getConnection(ElasticSearchConnection.java:151) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at com.digitalpebble.stormcrawler.elasticsearch.persistence.StatusUpdaterBolt.prepare(StatusUpdaterBolt.java:141) [crawlIndexer-1.0-SNAPSHOT.jar:?]
        at org.apache.storm.daemon.executor$fn__5044$fn__5057.invoke(executor.clj:791) [storm-core-1.1.0.jar:1.1.0]
        at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:482) [storm-core-1.1.0.jar:1.1.0]
        at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.net.UnknownHostException: http: nodename nor servname provided, or not known
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_151]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[?:1.8.0_151]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[?:1.8.0_151]
        at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[?:1.8.0_151]
        at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[?:1.8.0_151]
        at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_151]
        at java.net.InetAddress.getByName(InetAddress.java:1076) ~[?:1.8.0_151]
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getClient(ElasticSearchConnection.java:104) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        ... 6 more
8710 [Thread-18-__metricscom.digitalpebble.stormcrawler.elasticsearch.metrics.MetricsConsumer-executor[2 2]] ERROR c.d.s.e.m.MetricsConsumer - Can't connect to ElasticSearch
java.lang.RuntimeException: java.net.UnknownHostException: http
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getClient(ElasticSearchConnection.java:107) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getConnection(ElasticSearchConnection.java:151) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getConnection(ElasticSearchConnection.java:133) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at com.digitalpebble.stormcrawler.elasticsearch.metrics.MetricsConsumer.prepare(MetricsConsumer.java:68) [crawlIndexer-1.0-SNAPSHOT.jar:?]
        at org.apache.storm.metric.MetricsConsumerBolt.prepare(MetricsConsumerBolt.java:77) [storm-core-1.1.0.jar:1.1.0]
        at org.apache.storm.daemon.executor$fn__5044$fn__5057.invoke(executor.clj:791) [storm-core-1.1.0.jar:1.1.0]
        at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:482) [storm-core-1.1.0.jar:1.1.0]
        at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.net.UnknownHostException: http
        at java.net.InetAddress.getAllByName0(InetAddress.java:1280) ~[?:1.8.0_151]
        at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[?:1.8.0_151]
        at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_151]
        at java.net.InetAddress.getByName(InetAddress.java:1076) ~[?:1.8.0_151]
        at com.digitalpebble.stormcrawler.elasticsearch.ElasticSearchConnection.getClient(ElasticSearchConnection.java:104) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        ... 8 more
8714 [Thread-26-status-executor[4 4]] ERROR o.a.s.util - Async loop died!
java.lang.RuntimeException: java.lang.RuntimeException: java.net.UnknownHostException: http: nodename nor servname provided, or not known
        at com.digitalpebble.stormcrawler.elasticsearch.persistence.StatusUpdaterBolt.prepare(StatusUpdaterBolt.java:145) ~[crawlIndexer-1.0-SNAPSHOT.jar:?]
        at org.apache.storm.daemon.executor$fn__5044$fn__5057.invoke(executor.clj:791) ~[storm-core-1.1.0.jar:1.1.0]

也许我需要在elasticsearch.yml或es-conf.yml中修改一些内容(它们都有默认设置)

jslywgbw

jslywgbw1#

通过玩(几个小时)使应用程序正常工作。
步骤:
在maven文件中将storm crawler core和storm crawler elastic search恢复到1.5版本。
使用了storm crawler elastic search的1.5 flux/yaml配置文件版本
使用elastic search 5.4.0
使用kibana 5.4.0

6jygbczu

6jygbczu2#

上面的错误消息提到elasticsearchconnection。java:104 so 您必须使用版本,而不是主分支的代码。确保es conf对应于相同的版本。你从主分支复制了conf吗?下一版本的地址将有不同的格式

相关问题