一、None of the configured nodes are available 或者html
org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from streamjava
緣由:spring data elasticSearch 的版本與Spring boot、Elasticsearch版本不匹配。node
解決:spring
Spring Boot Version (x) | Spring Data Elasticsearch Version (y) | Elasticsearch Version (z) |
---|---|---|
x <= 1.3.5 | y <= 1.3.4 | z <= 1.7.2* |
x >= 1.4.x | 2.0.0 <=y < 5.0.0** | 2.0.0 <= z < 5.0.0** |
這是版本之間的對應關係。Spring boot 1.3.5默認的elasticsearch版本是1.5.2,此時啓動1.7.2版本如下的Elasticsearch客戶端鏈接正常。elasticsearch
注:注意java的es默認鏈接端口是9300,9200是http端口,這兩個在使用中應注意區分。spa
二、Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)htm
緣由:spring boot是1.3.x版本,而es採用了2.x版本。在es的2.x版本去除了一些類,而這些類在spring boot的1.3.x版本中仍然被使用,致使此錯誤。blog
解決:依照問題1中的版本對應關係,啓動特定版本的es便可。ci