Springboot整合BBoss-Elasticsearch启动一直连127.0.0.1(解决方法)

官方解决方法

点我跳转

idea启动正常,打包启动报错127.0.0.1连不上看这里↓↓↓

必须使用这种方式,不要用ElasticSearchHelper,打包会有问题

@Autowired
private BBossESStarter bbossESStarter;

正常启动,读取到配置的application.yml

spring:
  application:
    name: xxx
  elasticsearch:
    bboss:
      elasticPassword: 123456
      elasticUser: elastic
      elasticsearch:
        dateFormat: yyyy.MM.dd
        discoverHost: false
        rest:
          hostNames: 192.168.3.51:9200
        scrollBlockedWaitTimeout: 0
        scrollThreadCount: 200
        scrollThreadQueue: 200
        showTemplate: false
        sliceScrollBlockedWaitTimeout: 0
        sliceScrollThreadCount: 100
        sliceScrollThreadQueue: 100
        timeZone: Asia/Shanghai
      http:
        connectionRequestTimeout: 5000
        customHttpRequestRetryHandler: org.frameworkset.spi.remote.http.ConnectionResetHttpRequestRetryHandler
        defaultMaxPerRoute: 200
        hostnameVerifier:
        keepAlive: 3600000
        keyPassword:
        keystore:
        maxHeaderCount: 200
        maxLineLength: -1
        maxTotal: 400
        retryTime: 1
        retryInterval: 1000
        soKeepAlive: false
        soReuseAddress: false
        staleConnectionCheckEnabled: false
        timeToLive: 3600000
        timeoutConnection: 5000
        timeoutSocket: 5000
        validateAfterInactivity: 2000
      dslfile:
        refreshInterval: -1

pom.xml

解决启动日志报错

        <!--ElasticsearchBboss启动类引入-->
        <dependency>
            <groupId>com.bbossgroups.plugins</groupId>
            <artifactId>bboss-elasticsearch-rest-jdbc</artifactId>
            <version>${bboss.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.bbossgroups.plugins</groupId>
            <artifactId>bboss-elasticsearch-spring-boot-starter</artifactId>
            <version>${bboss.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

官方说用这种获取配置

    @Autowired
    private BBossESStarter bbossESStarter;

这种好像也可以

    ClientInterface restClientUtil = ElasticSearchHelper.getRestClientUtil();

如果还是一直连127.0.0.1:9200,或许尝试修改下删除bboss配置再添加,我的就是什么也没动,又好了,或者新建一个demo,只保留springboot整合bboss的代码,然后测试.

注意elasticsearch的依赖不要多引用其他的,只用bboss整合的两个就够了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值