SpringBoot连接elasticsearch异常

 2018-09-11 16:03:43.692 ERROR 8684 --- [           main] o.s.boot.SpringApplication               : Application run failed

 java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:826) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:807) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1269) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1257) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
at sample.data.elasticsearch.SampleElasticsearchApplication.main(SampleElasticsearchApplication.java:68) [classes/:na]
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{Yg5eMgPdSqiRy7T4al93qw}{127.0.0.1}{127.0.0.1:9300}]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:60) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:378) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:405) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:394) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:46) ~[elasticsearch-6.3.2.jar:6.3.2]
at org.springframework.data.elasticsearch.core.ElasticsearchTemplate.getSearchResponse(ElasticsearchTemplate.java:942) ~[spring-data-elasticsearch-3.1.0.RC2.jar:3.1.0.RC2]
at org.springframework.data.elasticsearch.core.ElasticsearchTemplate.doScroll(ElasticsearchTemplate.java:807) ~[spring-data-elasticsearch-3.1.0.RC2.jar:3.1.0.RC2]
at org.springframework.data.elasticsearch.core.ElasticsearchTemplate.startScroll(ElasticsearchTemplate.java:821) ~[spring-data-elasticsearch-3.1.0.RC2.jar:3.1.0.RC2]
at org.springframework.data.elasticsearch.core.ElasticsearchTemplate.delete(ElasticsearchTemplate.java:718) ~[spring-data-elasticsearch-3.1.0.RC2.jar:3.1.0.RC2]
at org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository.deleteAll(AbstractElasticsearchRepository.java:257) ~[spring-data-elasticsearch-3.1.0.RC2.jar:3.1.0.RC2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:359) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor$$Lambda$1251/56840345.get(Unknown Source) ~[na:na]
at org.springframework.data.repository.util.QueryExecutionConverters$$Lambda$1250/1996449989.apply(Unknown Source) ~[na:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61) ~[spring-data-commons-2.1.0.RC2.jar:2.1.0.RC2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.0.RC2.jar:5.1.0.RC2]
at com.sun.proxy.$Proxy44.deleteAll(Unknown Source) ~[na:na]
at sample.data.elasticsearch.SampleElasticsearchApplication.run(SampleElasticsearchApplication.java:35) [classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:823) [spring-boot-2.1.0.M2.jar:2.1.0.M2]
... 5 common frames omitted 2018-09-11 16:03:43.695 INFO 8684 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'

解决办法注释掉elasticsearch配置文件中 cluster.name。

org.elasticsearch.client.transport.NoNodeAvailableException的更多相关文章

  1. ES使用org.elasticsearch.client.transport.NoNodeAvailableException: No node available 错误解决方法

    1) 端口错 client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(ipAddress, ...

  2. 记录一次Elasticsearch线上部署后出现:org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []的问题解决

    说明:ES部署了3个节点,而一般情况只要这三个节点的IP其中一个都可以连接,Web端口使用的是9500,Client连接使用的是9600,调用程序使用了ES原生Client进行连接. 解决方法: 1. ...

  3. ES使用org.elasticsearch.client.transport.NoNodeAvailableException: No node available

    1) 端口错 client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(ipAddress, ...

  4. Failed to instantiate [org.elasticsearch.client.transport.TransportClient]

    Springboot 集成 ElasticSearch,springboot报错如下: Error starting ApplicationContext. To display the auto-c ...

  5. ElasticSearch client API

    从运行结果看并没有打印节点信息出来 从结果看出来,集群节点信道打印出来了,不过这种方法有个问题,就是当我们连接的节点挂掉了,就没法连接整个集群了,这个时候我们就利用他的一个嗅探的功能. 从这里我们可以 ...

  6. Elasticsearch教程(六) elasticsearch Client创建

    Elasticsearch  创建Client有几种方式. 首先在 Elasticsearch  的配置文件 elasticsearch.yml中.定义cluster.name.如下: cluster ...

  7. elasticsearch client

    你可以用client做很多事情: 在集群中执行index, get, delete, search,update 操作 在集群中执行administrative tasks 如果你想再程序中嵌入ela ...

  8. Elasticsearch+SpringBoot报NoNodeAvailableException解决方案

    Elasticsearch整合SpringBoot 首先大家在整合的时候一定要注意版本兼容问题,此问题尤为重要 Elasticsearch简称Es 在使用SpringBoot整合Elasticsear ...

  9. maven包引入问题ClassNotFoundException: org.elasticsearch.client.Cancellable

    业务需要,做搜索功能,在springboot聚合项目下,新建了es模块module 但是在引入elasticsearch依赖的时候,出现了问题 引入相应依赖后 <dependency> & ...

随机推荐

  1. Jenkins+Ansible+Gitlab自动化部署三剑客-gitlab本地搭建

    实际操作 准备linux初始环境 关闭防火墙 systemctl stop firewalld 开机自己关闭 systemctl disable firewalld 设置安全配置 为关闭 vim /e ...

  2. VGG网络

    VGG论文给出了一个非常振奋人心的结论:卷积神经网络的深度增加和小卷积核的使用对网络的最终分类识别效果有很大的作用.记得在AlexNet论文中,也做了最后指出了网络深度的对最终的分类结果有很大的作用. ...

  3. (1)Python基础

    几种常用类型 int float str bool 基本数值操作 绝对值 abs 四舍五入 round 最大值&最小值

  4. UVA1618-Weak Key(RMQ)

    Problem UVA1618-Weak Key Accept: 103  Submit: 588Time Limit: 3000 mSec Problem Description Cheolsoo ...

  5. AlexeyAB大神版yolo 待完善

    目录 darknet优化经验 1. AlexeyAB改进项 2. Linux下编译选项 3. 训练经验 4. 提升检测效果 5. 总结 6. AlexeyAB大神改进 darknet优化经验 主要来自 ...

  6. Java序列化由于没有指定serialVersionUID导致报错

    z.JobPersistenceException: Couldn't retrieve job because the BLOB couldn't be deserialized: com.mode ...

  7. P1638 逛画展(直尺法)

    这道题是直尺法的模板题: #include<iostream> using namespace std; ; ; int n, m, a[maxn], vis[M]; int main() ...

  8. 【angularjs】使用angular搭建项目,图片懒加载资料

    demo: <ion-view view-title="{{chat.name}}"> <style type="text/css"> ...

  9. 1、原生jdbc连接oracle数据库简单介绍

    一.jbdc的常用API1.Connection:数据库的链接对象2.statement:数据库sql执行对象3.preparedStatment:sql的预编译处理对象,是statement子接口4 ...

  10. 1.java的基础和数据类型

    一.学习要求1.听课一定要全神贯注2.课堂笔记,一定要自己总结,而且要有很严谨的逻辑关系.提纲很重要3.作业不折不扣的完成,并且多完成4.阶段项目一定要独立完成5.每天早上由一位同学来进行早分享,内容 ...