JanusGraph问题笔记-ResponseException(ES)

2,350 阅读1分钟

问题

E06:使用索引后端elasticsearch启动时报ResponseException

org.elasticsearch.client.ResponseException: method [GET], host [host1.bigdata:9200] ……

场景

  • JanusGraph使用hbase-es配置
  • 使用gremlin命令行启动,执行JanusGraphFactory.open方法时出错

详细报错日志

15:09:09 WARN  org.janusgraph.diskstorage.es.rest.RestElasticSearchClient  
- Unable to determine Elasticsearch server version. Default to FIVE.
org.elasticsearch.client.ResponseException: method [GET], host [http://host1.bigdata:9200], URI [/], 
status line [HTTP/1.1 503 Service Unavailable]
"cluster_uuid" : "_na_",
Could not instantiate implementation: org.janusgraph.diskstorage.es.ElasticSearchIndex

解决方案

  1. 报错日志看到http://host1.bigdata:9200的GET访问不正常,有503服务不可用异常。
  2. 集群uuid为_na_,ES集群状态不正常,检查es的日志,发现es因为没有足够的master节点没正常运行:not enough master nodes discovered during pinging (found
  3. 增加了es的master实例,ES集群正常运行了。重新运行gremlin,错误解决,可以正常加载图。

刚开始还以为是https的问题,这些个错误都是JanusGraph使用的索引后端状态异常引起的,容易走弯路。E05和E06都不是JanusGraph本身的问题,但在实践中躲不开,权当做个备忘。