javaAPI往ES批量创建索引:报错org.springframework.beans.factory.Unsatisfied

使用idea:javaAPI往公司ES集群批量随机生成索引,用于ES节点的压测,报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name

报错情况:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '**********’......
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.elasticsearch.client.RestHighLevelClient' available: expected at least 1 bean......



bug修复后成果效果如下:
kibana中查询结果
es-head中查看indices索引

原因:javaAPI连接公司es节点,能连上,但是无法进行增删改查,原因是公司es集群有ssl安全协议,使用http无法连接,要使用https,具体过程如下:

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.client.RestClients;
import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration;
import org.springframework.stereotype.Component;`

@Component
@Configuration
@ConfigurationPropert
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值