Spring Boot Elastic Serach连接问题

时间:2019-04-28 15:24:24

标签: spring-boot elasticsearch spring-data-jpa

使用Spring Data JPA从Elastic Search启动。为此,我创建了一个示例Amazon帐户,并在AWS控制台中启动了示例Elasticsearch实例,并获得了详细信息。

现在的问题是,由于与AWS ElasticSeach的连接问题,Spring BOOT应用程序失败。不确定,我要添加正确的依赖项。我感谢有人对此提供帮助。

AmazonElasticSearch详细信息: https://search-elasticsearch-3wqyu7ekb7nymtxwosu7nxkbkq.us-east-2.es.amazonaws.com/

Pom.xml

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>3.1.6.RELEASE</version>
        </dependency>



        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

ElasticSearchConfiuration:

enter image description here

application.properties

elasticsearch.clustername = 008026978848:elasticsearch elasticsearch.host = https://search-elasticsearch-3wqyu7ekb7nymtxwosu7nxkbkq.us-east-2.es.amazonaws.com/ elasticsearch.port = 9300

异常详细信息

org.springframework.beans.factory.BeanCreationException:在类路径资源[com / aws / elasticsearch / config / ElasticSearchConfig.class]中创建名称为“ client”的bean时出错:通过工厂方法实例化Bean失败;嵌套的异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.elasticsearch.client.Client]:工厂方法“ client”抛出了异常;嵌套的异常是java.net.UnknownHostException:https://search-elasticsearch-3wqyu7ekb7nymtxwosu7nxkbkq.us-east-2.es.amazonaws.com/

0 个答案:

没有答案