springboot整合elasticsearch,并使用docker desktop运行elasticsearch镜像容器遇到的问题。

springboot和elasticsearch版本兼容性问题:

使用easy-es组件,简化es的操作,

Easy-Es​官网:https://www.easy-es.cn/

参考easy-es组件官网的文档的内容,调整版本问题。

​​​​

Java代码如下:

java 复制代码
package cn.dao789.elasticsearch;

import cn.dao789.CacheApplication;
import cn.hutool.core.date.DateUtil;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest(classes = CacheApplication.class)
public class TestElasticSearch {

    @Autowired
    private ArticleMapper articleMapper;

    @Test
    void saveArticle() {
        System.out.println("插入文档数据测试");
        ArticleElastic elastic = new ArticleElastic();
        elastic.setTitle("使用easy-es操作elasticsearch");
        String context = "在当今信息爆炸的时代,数据的搜索、存储和管理成为了企业和个人不可或缺的需求。" +
                "Elasticsearch,作为一款强大且灵活的开源搜索和分析引擎,因其高效的搜索性能、分布式存储能力和可扩展性,得到了广泛的应用。" +
                "然而,Elasticsearch的复杂配置和操作对于初学者来说可能存在一定的门槛。" +
                "为了降低这一门槛,让更多的人能够轻松地使用Elasticsearch,Easy-ES应运而生。";
        elastic.setSummary(context);
        elastic.setDeleted(0);
        elastic.setIsPublish(1);
        elastic.setCreateTime(DateUtil.formatTime(new Date()));
        Integer insert = articleMapper.insert(elastic);
        System.out.println("插入数据条数:" + insert);

    }

    @Test
    void queryArticle() {
        LambdaEsQueryWrapper<ArticleElastic> wrapper = new LambdaEsQueryWrapper<>();
        wrapper.multiMatchQuery("elasticsearch", ArticleElastic::getTitle, ArticleElastic::getSummary)
                .eq(ArticleElastic::getIsPublish, 1);
        EsPageInfo<ArticleElastic> pageInfo = articleMapper.pageQuery(wrapper, 0, 10);
    }

    @Test
    void updateArticle() {
        LambdaEsQueryWrapper<ArticleElastic> wrapper = new LambdaEsQueryWrapper<>();
        wrapper.eq(ArticleElastic::getId, 1L);
        ArticleElastic articleElastic = new ArticleElastic();
        articleElastic.setTitle("使用easy-es操作elasticsearch");
        articleElastic.setSummary("123123");
        articleMapper.update(articleElastic, wrapper);
    }

    @Test
    void deleteArticle() {
        LambdaEsQueryWrapper<ArticleElastic> wrapper = new LambdaEsQueryWrapper<>();
        wrapper.eq(ArticleElastic::getId, 1L);
        articleMapper.delete(wrapper);
    }
}

完整的pom文件如下:

yaml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>cn.dao789</groupId>
    <artifactId>demo-cache-spring</artifactId>
    <version>1.0-SNAPSHOT</version>


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.elasticsearch.client</groupId>
                    <artifactId>elasticsearch-rest-high-level-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.elasticsearch</groupId>
                    <artifactId>elasticsearch</artifactId>
                </exclusion>
            </exclusions>

        </dependency>

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

        <!--mongodb依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>

        <!--spring cache依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>

        <!--ehcache3.0版本-->
        <dependency>
            <groupId>org.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>3.6.3</version>
        </dependency>

        <!--elasticsearch相关依赖开始-->
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.14.0</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.14.0</version>
        </dependency>

        <!-- 引入easy-es最新版本的依赖-->
        <dependency>
            <groupId>org.dromara.easy-es</groupId>
            <artifactId>easy-es-boot-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!--elasticsearch相关依赖结束-->


        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.8.25</version>
        </dependency>


        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

    </dependencies>

</project>

测试过程中出现的问题:

1:启动报错

text 复制代码
java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy96.insert(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy97.insert(Unknown Source)
	at cn.dao789.elasticsearch.TestElasticSearch.saveArticle(TestElasticSearch.java:32)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.dromara.easyes.core.proxy.EsMapperProxy$PlainMethodInvoker.invoke(EsMapperProxy.java:130)
	at org.dromara.easyes.core.proxy.EsMapperProxy.invoke(EsMapperProxy.java:75)
	... 82 more
Caused by: ElasticsearchException[java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused: no further information]; nested: ExecutionException[java.net.ConnectException: Connection refused: no further information]; nested: ConnectException[Connection refused: no further information];
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2078)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702)
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1672)
	at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:1029)
	at org.dromara.easyes.core.kernel.BaseEsMapperImpl.doInsert(BaseEsMapperImpl.java:728)
	at org.dromara.easyes.core.kernel.BaseEsMapperImpl.lambda$insert$8(BaseEsMapperImpl.java:363)
	at java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:210)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.IntPipeline.reduce(IntPipeline.java:457)
	at java.util.stream.IntPipeline.sum(IntPipeline.java:415)
	at org.dromara.easyes.core.kernel.BaseEsMapperImpl.insert(BaseEsMapperImpl.java:364)
	at org.dromara.easyes.core.kernel.BaseEsMapperImpl.insert(BaseEsMapperImpl.java:334)
	... 88 more
Caused by: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused: no further information
	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:262)
	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:249)
	at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:76)
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2075)
	... 104 more
Caused by: java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715)
	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
	at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
	at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
	at java.lang.Thread.run(Thread.java:750)

经测试,端口填写错误或者es未启动都会报上面的错。

easy-es的官网提供的一些排查思路

docker desktop运行elasticsearch的镜像可能遇到的问题

  • 启动单个实例容器报错,容器启动失败。
    如下图:只配置了端口和容器名称。

启动的时候出现了如下错误:

text 复制代码
2024-11-14 15:49:15 OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,634Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "using [1] data paths, mounts [[/ (overlay)]], net usable_space [54.9gb], net total_space [62.6gb], types [overlay]" }
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,637Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "heap size [989.8mb], compressed ordinary object pointers [true]" }
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,769Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "node name [e9ae4b1d4b35], node ID [yhayJkM3TQuDtp1aJjWySQ], cluster name [docker-cluster]" }
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,770Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "version[7.6.2], pid[1], build[default/docker/ef48eb35cf30adf4db14086e8aabd07ef6fb113f/2020-03-26T06:34:37.794943Z], OS[Linux/6.10.0-linuxkit/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/13.0.2/13.0.2+8]" }
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,771Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "JVM home [/usr/share/elasticsearch/jdk]" }
2024-11-14 15:49:24 {"type": "server", "timestamp": "2024-11-14T07:49:24,771Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=COMPAT, -Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-5454867559535222002, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Des.cgroups.hierarchy.override=/, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=docker, -Des.bundled_jdk=true]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [aggs-matrix-stats]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [analysis-common]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [flattened]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [frozen-indices]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [ingest-common]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,958Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [ingest-geoip]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [ingest-user-agent]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [lang-expression]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [lang-mustache]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [lang-painless]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [mapper-extras]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [parent-join]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [percolator]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,959Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [rank-eval]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [reindex]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [repository-url]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [search-business-rules]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [spatial]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [transform]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [transport-netty4]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [vectors]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,960Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-analytics]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-ccr]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-core]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-deprecation]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-enrich]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-graph]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-ilm]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-logstash]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-ml]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,961Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-monitoring]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-rollup]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-security]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-sql]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-voting-only-node]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "loaded module [x-pack-watcher]" }
2024-11-14 15:49:26 {"type": "server", "timestamp": "2024-11-14T07:49:26,962Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "no plugins loaded" }
2024-11-14 15:49:30 {"type": "server", "timestamp": "2024-11-14T07:49:30,307Z", "level": "INFO", "component": "o.e.x.s.a.s.FileRolesStore", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]" }
2024-11-14 15:49:30 {"type": "server", "timestamp": "2024-11-14T07:49:30,887Z", "level": "INFO", "component": "o.e.x.m.p.l.CppLogMessageHandler", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "[controller/105] [Main.cc@110] controller (64 bit): Version 7.6.2 (Build e06ef9d86d5332) Copyright (c) 2020 Elasticsearch BV" }
2024-11-14 15:49:31 {"type": "server", "timestamp": "2024-11-14T07:49:31,538Z", "level": "DEBUG", "component": "o.e.a.ActionModule", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "Using REST wrapper from plugin org.elasticsearch.xpack.security.Security" }
2024-11-14 15:49:31 {"type": "server", "timestamp": "2024-11-14T07:49:31,664Z", "level": "INFO", "component": "o.e.d.DiscoveryModule", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "using discovery type [zen] and seed hosts providers [settings]" }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,386Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "initialized" }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,386Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "starting ..." }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,512Z", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "publish_address {172.17.0.5:9300}, bound_addresses {[::]:9300}" }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,793Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
2024-11-14 15:49:32 ERROR: [1] bootstrap checks failed
2024-11-14 15:49:32 [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
2024-11-14 15:49:32 ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,800Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "stopping ..." }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,846Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "stopped" }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,847Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "closing ..." }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,863Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "closed" }
2024-11-14 15:49:32 {"type": "server", "timestamp": "2024-11-14T07:49:32,867Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "e9ae4b1d4b35", "message": "Native controller process has stopped - no new native processes can be started" }

错误信息中包含需要配置注册中心等内容,搜索发现如果只启动单个实例的话,需要配置discovery.type: single-node

该配置的作用是以单节点形式启动集群,配置完成之后能正常启动。

相关推荐
落落落sss4 分钟前
MQ集群
java·服务器·开发语言·后端·elasticsearch·adb·ruby
河岸飞流44 分钟前
Centos安装Elasticsearch教程
elasticsearch·centos
_江南一点雨1 小时前
SpringBoot 3.3.5 试用CRaC,启动速度提升3到10倍
java·spring boot·后端
深情废杨杨1 小时前
后端-实现excel的导出功能(超详细讲解)
java·spring boot·excel
代码小鑫1 小时前
A034-基于Spring Boot的供应商管理系统的设计与实现
java·开发语言·spring boot·后端·spring·毕业设计
paopaokaka_luck2 小时前
基于Spring Boot+Vue的多媒体素材管理系统的设计与实现
java·数据库·vue.js·spring boot·后端·算法
微刻时光2 小时前
Docker部署Nginx
运维·nginx·docker·容器·经验
陈小肚2 小时前
k8s 1.28.2 集群部署 docker registry 接入 MinIO 存储
docker·容器·kubernetes
程序猿麦小七2 小时前
基于springboot的景区网页设计与实现
java·spring boot·后端·旅游·景区
蓝田~2 小时前
SpringBoot-自定义注解,拦截器
java·spring boot·后端