hadoop 报错 org.apache.hadoop.mapred.TaskTracker: Process Thread Dump: lost task

本文介绍Hadoop中TaskTracker超时问题的原因与解决办法,包括调整超时时间及通过代码自动报告状态来避免超时。同时分享了一个实例,即因集群时间不同步导致的死循环问题及解决方案。

项目最近报错,形如:

org.apache.hadoop.mapred.TaskTracker: Process Thread Dump: lost task
Thread 2958 (process reaper):
   State: RUNNABLE
    Blocked count: 0
   Waited count: 0
   Stack:
     java.lang.UNIXProcess.waitForProcessExit(Native Method)
     java.lang.UNIXProcess.access$900(UNIXProcess.java:20)
     java.lang.UNIXProcess$1$1.run(UNIXProcess.java:132)
Thread 2957 (JVM Runner jvm_201005091721_0012_m_209736581 spawned.):
   State: WAITING
   Blocked count: 1
   Waited count: 2
   Waiting on [url=mailto:java.lang.UNIXProcess@874c04]java.lang.UNIXProcess@874c04[/url]
   Stack:
     java.lang.Object.wait(Native Method)
     java.lang.Object.wait(Object.java:485)
     java.lang.UNIXProcess.waitFor(UNIXProcess.java:165)
    org.apache.hadoop.util.Shell.runCommand(Shell.java:186)
    org.apache.hadoop.util.Shell.run(Shell.java:134)
    org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:286)        org.apache.hadoop.mapred.JvmManager$JvmManagerForType$JvmRunner.runChild(JvmManager.java:335)   org.apache.hadoop.mapred.JvmManager$JvmManagerForType$JvmRunner.run(JvmManager.java:324)

 错误是因为tasktracker没有在timeout规定时间内返回心跳状态,所以jobtracker就认为这个tasktracker死了,需要检查代码是否有死循环,或是处理时间过长等等。默认的timeout是10分钟

 

解决方法:

1. 设置超时时间:mapred.task.timeout : 1800000 设置为30分钟

或是设置为0,则不检查超时,这需要有信息代码是绝对没问题的,不建议设置为0,因为每个tasktracker就是slaver上的一个child进程,要是放任不管,这个进程会一直存在

 

2. 自动返回tasktracker状态:

context.progress();

 

 

在项目中,发现代码出现死循环,是因为集群时间不同步,不断的出现请求elasticsearch出错,在昨晚时钟同步后,bug解决了

 

 

 

 

[2025-11-26T15:52:40,750][INFO ][o.e.b.Elasticsearch ] [node-1] version[9.2.1], pid[26788], build[zip/4ad0ef0e98a2e72fafbd79a19fa5cae2f026117d/2025-11-06T22:07:39.673130621Z], OS[Windows 11/10.0/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/25.0.1/25.0.1+8-27] [2025-11-26T15:52:40,841][INFO ][o.e.b.Elasticsearch ] [node-1] JVM home [D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1\jdk], using bundled JDK [true] [2025-11-26T15:52:40,846][INFO ][o.e.b.Elasticsearch ] [node-1] 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, --add-opens=org.apache.lucene.core/org.apache.lucene.codecs.lucene99=org.elasticsearch.server, --add-opens=org.apache.lucene.core/org.apache.lucene.internal.vectorization=org.elasticsearch.server, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=CLDR, -Dorg.apache.lucene.vectorization.upperJavaFeatureVersion=25, -Des.path.home=D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1, -Des.distribution.type=zip, -Des.java.type=bundled JDK, --enable-native-access=org.elasticsearch.nativeaccess,org.apache.lucene.core, --enable-native-access=ALL-UNNAMED, --illegal-native-access=deny, -XX:ReplayDataFile=logs/replay_pid%p.log, -XX:+EnableDynamicAgentLoading, -Djdk.attach.allowAttachSelf=true, --patch-module=java.base=D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1\lib\entitlement-bridge\elasticsearch-entitlement-bridge-9.2.1.jar, --add-exports=java.base/org.elasticsearch.entitlement.bridge=org.elasticsearch.entitlement,java.logging,java.net.http,java.naming,jdk.net, -XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\elasticsearch, --add-modules=jdk.incubator.vector, -Dorg.apache.lucene.store.defaultReadAdvice=normal, -Dorg.apache.lucene.store.MMapDirectory.sharedArenaMaxPermits=1, -XX:+HeapDumpOnOutOfMemoryError, -XX:+ExitOnOutOfMemoryError, -XX:ErrorFile=hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=gc.log:utctime,level,pid,tags:filecount=32,filesize=64m, -Xms8123m, -Xmx8123m, -XX:MaxDirectMemorySize=4259315712, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, --module-path=D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1\lib, --add-modules=jdk.net, --add-modules=jdk.management.agent, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server] [2025-11-26T15:52:40,854][INFO ][o.e.b.Elasticsearch ] [node-1] Default Locale [zh_CN] [2025-11-26T15:52:42,139][INFO ][o.e.n.NativeAccess ] [node-1] Using [jdk] native provider and native methods for [Windows] [2025-11-26T15:52:43,849][INFO ][o.a.l.i.v.PanamaVectorizationProvider] [node-1] Java vector incubator API enabled; uses preferredBitSize=256; FMA enabled [2025-11-26T15:52:44,054][INFO ][o.e.b.Elasticsearch ] [node-1] Bootstrapping Entitlements [2025-11-26T15:52:57,527][WARN ][o.e.x.g.GPUSupport ] [node-1] GPU based vector indexing is not supported on this platform; cuvs-java supports only Linux [2025-11-26T15:52:58,687][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-url] [2025-11-26T15:52:58,687][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rest-root] [2025-11-26T15:52:58,688][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-core] [2025-11-26T15:52:58,688][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-redact] [2025-11-26T15:52:58,688][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-user-agent] [2025-11-26T15:52:58,689][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-async-search] [2025-11-26T15:52:58,689][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-monitoring] [2025-11-26T15:52:58,689][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-s3] [2025-11-26T15:52:58,690][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-analytics] [2025-11-26T15:52:58,690][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-esql-core] [2025-11-26T15:52:58,690][INFO ][o.e.p.PluginsService ] [node-1] loaded module [search-business-rules] [2025-11-26T15:52:58,691][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ent-search] [2025-11-26T15:52:58,691][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-autoscaling] [2025-11-26T15:52:58,691][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless] [2025-11-26T15:52:58,692][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ml] [2025-11-26T15:52:58,692][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache] [2025-11-26T15:52:58,692][INFO ][o.e.p.PluginsService ] [node-1] loaded module [legacy-geo] [2025-11-26T15:52:58,693][INFO ][o.e.p.PluginsService ] [node-1] loaded module [logsdb] [2025-11-26T15:52:58,693][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ql] [2025-11-26T15:52:58,693][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rank-rrf] [2025-11-26T15:52:58,693][INFO ][o.e.p.PluginsService ] [node-1] loaded module [analysis-common] [2025-11-26T15:52:58,694][INFO ][o.e.p.PluginsService ] [node-1] loaded module [health-shards-availability] [2025-11-26T15:52:58,694][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4] [2025-11-26T15:52:58,694][INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggregations] [2025-11-26T15:52:58,694][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common] [2025-11-26T15:52:58,694][INFO ][o.e.p.PluginsService ] [node-1] loaded module [frozen-indices] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-identity-provider] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-shutdown] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-text-structure] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [snapshot-repo-test-kit] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ml-package-loader] [2025-11-26T15:52:58,695][INFO ][o.e.p.PluginsService ] [node-1] loaded module [kibana] [2025-11-26T15:52:58,696][INFO ][o.e.p.PluginsService ] [node-1] loaded module [constant-keyword] [2025-11-26T15:52:58,696][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-logstash] [2025-11-26T15:52:58,696][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ccr] [2025-11-26T15:52:58,697][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-graph] [2025-11-26T15:52:58,703][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rank-vectors] [2025-11-26T15:52:58,704][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-esql] [2025-11-26T15:52:58,705][INFO ][o.e.p.PluginsService ] [node-1] loaded module [parent-join] [2025-11-26T15:52:58,707][INFO ][o.e.p.PluginsService ] [node-1] loaded module [counted-keyword] [2025-11-26T15:52:58,708][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-enrich] [2025-11-26T15:52:58,708][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repositories-metering-api] [2025-11-26T15:52:58,709][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transform] [2025-11-26T15:52:58,710][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-azure] [2025-11-26T15:52:58,710][INFO ][o.e.p.PluginsService ] [node-1] loaded module [dot-prefix-validation] [2025-11-26T15:52:58,711][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-gcs] [2025-11-26T15:52:58,711][INFO ][o.e.p.PluginsService ] [node-1] loaded module [spatial] [2025-11-26T15:52:58,712][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-otel-data] [2025-11-26T15:52:58,712][INFO ][o.e.p.PluginsService ] [node-1] loaded module [apm] [2025-11-26T15:52:58,713][INFO ][o.e.p.PluginsService ] [node-1] loaded module [mapper-extras] [2025-11-26T15:52:58,717][INFO ][o.e.p.PluginsService ] [node-1] loaded module [mapper-version] [2025-11-26T15:52:58,717][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-rollup] [2025-11-26T15:52:58,718][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator] [2025-11-26T15:52:58,718][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-migrate] [2025-11-26T15:52:58,718][INFO ][o.e.p.PluginsService ] [node-1] loaded module [data-streams] [2025-11-26T15:52:58,718][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-stack] [2025-11-26T15:52:58,719][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rank-eval] [2025-11-26T15:52:58,719][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex] [2025-11-26T15:52:58,719][INFO ][o.e.p.PluginsService ] [node-1] loaded module [streams] [2025-11-26T15:52:58,720][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-security] [2025-11-26T15:52:58,720][INFO ][o.e.p.PluginsService ] [node-1] loaded module [blob-cache] [2025-11-26T15:52:58,720][INFO ][o.e.p.PluginsService ] [node-1] loaded module [searchable-snapshots] [2025-11-26T15:52:58,720][INFO ][o.e.p.PluginsService ] [node-1] loaded module [gpu] [2025-11-26T15:52:58,721][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-slm] [2025-11-26T15:52:58,721][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-geoip-enterprise-downloader] [2025-11-26T15:52:58,721][INFO ][o.e.p.PluginsService ] [node-1] loaded module [snapshot-based-recoveries] [2025-11-26T15:52:58,722][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-watcher] [2025-11-26T15:52:58,722][INFO ][o.e.p.PluginsService ] [node-1] loaded module [old-lucene-versions] [2025-11-26T15:52:58,722][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ilm] [2025-11-26T15:52:58,722][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-inference] [2025-11-26T15:52:58,722][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-voting-only-node] [2025-11-26T15:52:58,723][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-deprecation] [2025-11-26T15:52:58,723][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-fleet] [2025-11-26T15:52:58,723][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-aggregate-metric] [2025-11-26T15:52:58,723][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-downsample] [2025-11-26T15:52:58,723][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-profiling] [2025-11-26T15:52:58,724][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-geoip] [2025-11-26T15:52:58,724][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-write-load-forecaster] [2025-11-26T15:52:58,724][INFO ][o.e.p.PluginsService ] [node-1] loaded module [exponential-histogram] [2025-11-26T15:52:58,724][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-attachment] [2025-11-26T15:52:58,724][INFO ][o.e.p.PluginsService ] [node-1] loaded module [wildcard] [2025-11-26T15:52:58,725][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-apm-data] [2025-11-26T15:52:58,725][INFO ][o.e.p.PluginsService ] [node-1] loaded module [unsigned-long] [2025-11-26T15:52:58,725][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-sql] [2025-11-26T15:52:58,725][INFO ][o.e.p.PluginsService ] [node-1] loaded module [runtime-fields-common] [2025-11-26T15:52:58,726][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-async] [2025-11-26T15:52:58,726][INFO ][o.e.p.PluginsService ] [node-1] loaded module [vector-tile] [2025-11-26T15:52:58,726][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-kql] [2025-11-26T15:52:58,727][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression] [2025-11-26T15:52:58,727][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-otel] [2025-11-26T15:52:58,727][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-eql] [2025-11-26T15:53:02,856][WARN ][stderr ] [node-1] SLF4J: No SLF4J providers were found. [2025-11-26T15:53:02,857][WARN ][stderr ] [node-1] SLF4J: Defaulting to no-operation (NOP) logger implementation [2025-11-26T15:53:02,858][WARN ][stderr ] [node-1] SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. [2025-11-26T15:53:05,305][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[(D:)]], net usable_space [246.8gb], net total_space [310gb], types [NTFS] [2025-11-26T15:53:05,306][INFO ][o.e.e.NodeEnvironment ] [node-1] heap size [7.9gb], compressed ordinary object pointers [true] [2025-11-26T15:53:05,549][INFO ][o.e.n.Node ] [node-1] node name [node-1], node ID [dWfo4MO3STGwlTnFuIzuYw], cluster name [my-application], roles [master, remote_cluster_client, data, data_cold, ingest, data_frozen, ml, data_hot, transform, data_content, data_warm] [2025-11-26T15:53:12,703][INFO ][o.e.f.FeatureService ] [node-1] Registered local node features [ES_V_8, ES_V_9, cluster.reroute.ignores_metric_param, cluster.stats.source_modes, data_stream.failure_store, inference.endpoint.cache, ingest.field_access_pattern, linear_retriever_supported, lucene_10_1_upgrade, lucene_10_upgrade, resolve_index_returns_mode, security.queryable_built_in_roles, security_stats_endpoint, simulate.ignored.fields, snapshots.get.state_parameter] [2025-11-26T15:53:13,177][INFO ][o.e.i.r.RecoverySettings ] [node-1] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b] [2025-11-26T15:53:14,062][INFO ][o.e.c.m.DataStreamGlobalRetentionSettings] [node-1] Updated global default retention to [null] [2025-11-26T15:53:14,067][INFO ][o.e.c.m.DataStreamGlobalRetentionSettings] [node-1] Updated global max retention to [null] [2025-11-26T15:53:14,069][INFO ][o.e.c.m.DataStreamGlobalRetentionSettings] [node-1] Updated failures default retention to [30d] [2025-11-26T15:53:14,070][INFO ][o.e.c.m.DataStreamFailureStoreSettings] [node-1] Updated data stream name patterns for enabling failure store to [[]] [2025-11-26T15:53:15,902][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/6344] [Main.cc@123] controller (64 bit): Version 9.2.1 (Build 5b1f3417ee0e02) Copyright (c) 2025 Elasticsearch BV [2025-11-26T15:53:16,964][INFO ][o.e.x.o.OTelPlugin ] [node-1] OTel ingest plugin is enabled [2025-11-26T15:53:17,011][INFO ][o.e.x.c.t.YamlTemplateRegistry] [node-1] OpenTelemetry index template registry is enabled [2025-11-26T15:53:17,015][INFO ][o.e.t.a.APM ] [node-1] Sending apm metrics is disabled [2025-11-26T15:53:17,020][INFO ][o.e.t.a.APM ] [node-1] Sending apm tracing is disabled [2025-11-26T15:53:17,074][INFO ][o.e.x.s.Security ] [node-1] Security is enabled [2025-11-26T15:53:17,569][INFO ][o.e.x.s.a.s.FileRolesStore] [node-1] parsed [0] roles from file [D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1\config\roles.yml] [2025-11-26T15:53:18,378][INFO ][o.e.x.w.Watcher ] [node-1] Watcher initialized components at 2025-11-26T07:53:18.378Z [2025-11-26T15:53:18,579][INFO ][o.e.x.p.ProfilingPlugin ] [node-1] Profiling is enabled [2025-11-26T15:53:18,618][INFO ][o.e.x.p.ProfilingPlugin ] [node-1] profiling index templates will not be installed or reinstalled [2025-11-26T15:53:18,628][INFO ][o.e.x.a.APMPlugin ] [node-1] APM ingest plugin is enabled [2025-11-26T15:53:18,674][INFO ][o.e.x.c.t.YamlTemplateRegistry] [node-1] apm index template registry is enabled [2025-11-26T15:53:19,598][WARN ][stderr ] [node-1] SLF4J: No SLF4J providers were found. [2025-11-26T15:53:19,598][WARN ][stderr ] [node-1] SLF4J: Defaulting to no-operation (NOP) logger implementation [2025-11-26T15:53:19,599][WARN ][stderr ] [node-1] SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. [2025-11-26T15:53:19,600][WARN ][stderr ] [node-1] SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier. [2025-11-26T15:53:19,600][WARN ][stderr ] [node-1] SLF4J: Ignoring binding found at [jar:file:///D:/soft/ES/elasticsearch-9.2.1-windows-x86_64/elasticsearch-9.2.1/modules/x-pack-core/log4j-slf4j-impl-2.19.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] [2025-11-26T15:53:19,600][WARN ][stderr ] [node-1] SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation. [2025-11-26T15:53:19,727][INFO ][o.e.t.n.NettyAllocator ] [node-1] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=1mb, suggested_max_allocation_size=1mb, factors={es.unsafe.use_netty_default_chunk_and_page_size=false, g1gc_enabled=true, g1gc_region_size=4mb}] [2025-11-26T15:53:19,904][INFO ][o.e.d.DiscoveryModule ] [node-1] using discovery type [multi-node] and seed hosts providers [settings] [2025-11-26T15:53:22,000][INFO ][o.e.n.Node ] [node-1] initialized [2025-11-26T15:53:22,001][INFO ][o.e.n.Node ] [node-1] starting ... [2025-11-26T15:53:28,976][INFO ][o.e.x.s.c.f.PersistentCache] [node-1] persistent cache index loaded [2025-11-26T15:53:28,977][INFO ][o.e.x.d.l.DeprecationIndexingComponent] [node-1] deprecation component started [2025-11-26T15:53:29,180][INFO ][o.e.t.TransportService ] [node-1] publish_address {192.168.192.141:9300}, bound_addresses {[::]:9300} [2025-11-26T15:53:29,770][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks [2025-11-26T15:53:29,774][WARN ][o.e.c.c.ClusterBootstrapService] [node-1] this node is locked into cluster UUID [R0iGpbgjTlqpz5TLri_5jw] but [cluster.initial_master_nodes] is set to [node-1]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; for further information see https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration?version=9.2#initial_master_nodes [2025-11-26T15:53:30,045][INFO ][o.e.c.s.MasterService ] [node-1] elected-as-master ([1] nodes joined in term 2)[_FINISH_ELECTION_, {node-1}{dWfo4MO3STGwlTnFuIzuYw}{5dxl-uQnS1Kkrcq0gRMQ_w}{node-1}{192.168.192.141}{192.168.192.141:9300}{cdfhilmrstw}{9.2.1}{8000099-9039001} completing election], term: 2, version: 35, delta: master node changed {previous [], current [{node-1}{dWfo4MO3STGwlTnFuIzuYw}{5dxl-uQnS1Kkrcq0gRMQ_w}{node-1}{192.168.192.141}{192.168.192.141:9300}{cdfhilmrstw}{9.2.1}{8000099-9039001}]} [2025-11-26T15:53:30,375][INFO ][o.e.c.s.ClusterApplierService] [node-1] master node changed {previous [], current [{node-1}{dWfo4MO3STGwlTnFuIzuYw}{5dxl-uQnS1Kkrcq0gRMQ_w}{node-1}{192.168.192.141}{192.168.192.141:9300}{cdfhilmrstw}{9.2.1}{8000099-9039001}]}, term: 2, version: 35, reason: Publication{term=2, version=35} [2025-11-26T15:53:30,429][INFO ][o.e.c.c.NodeJoinExecutor ] [node-1] node-join: [{node-1}{dWfo4MO3STGwlTnFuIzuYw}{5dxl-uQnS1Kkrcq0gRMQ_w}{node-1}{192.168.192.141}{192.168.192.141:9300}{cdfhilmrstw}{9.2.1}{8000099-9039001}] with reason [completing election] [2025-11-26T15:53:30,465][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {192.168.192.141:9200}, bound_addresses {[::]:9200} [2025-11-26T15:53:30,474][INFO ][o.e.n.Node ] [node-1] started {node-1}{dWfo4MO3STGwlTnFuIzuYw}{5dxl-uQnS1Kkrcq0gRMQ_w}{node-1}{192.168.192.141}{192.168.192.141:9300}{cdfhilmrstw}{9.2.1}{8000099-9039001}{transform.config_version=10.0.0, ml.machine_memory=17036365824, ml.allocated_processors=6, ml.allocated_processors_double=6.0, ml.max_jvm_size=8518631424, ml.config_version=12.0.0, xpack.installed=true} [2025-11-26T15:53:30,520][INFO ][o.e.x.w.LicensedWriteLoadForecaster] [node-1] license state changed, now [valid] [2025-11-26T15:53:30,535][WARN ][o.e.x.i.s.e.a.ElasticInferenceServiceAuthorizationHandler] [node-1] Failed to revoke access to default inference endpoint IDs: [elser_model_2, rainbow-sprinkles, jina-embeddings-v3, elastic-rerank-v1], error: org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized]; [2025-11-26T15:53:31,043][INFO ][o.e.x.m.MlIndexRollover ] [node-1] ML legacy indices rolled over [2025-11-26T15:53:31,044][INFO ][o.e.x.m.MlAnomaliesIndexUpdate] [node-1] legacy ml anomalies indices rolled over and aliases updated [2025-11-26T15:53:31,095][INFO ][o.e.x.s.a.Realms ] [node-1] license mode is [basic], currently licensed security realms are [reserved/reserved,file/default_file,native/default_native] [2025-11-26T15:53:31,104][INFO ][o.e.l.ClusterStateLicenseService] [node-1] license [f5f77e2b-c130-4e78-b10a-474f4684da84] mode [basic] - valid [2025-11-26T15:53:31,108][INFO ][o.e.c.f.AbstractFileWatchingService] [node-1] starting file watcher ... [2025-11-26T15:53:31,124][INFO ][o.e.c.f.AbstractFileWatchingService] [node-1] file settings service up and running [tid=75] [2025-11-26T15:53:31,125][INFO ][o.e.r.s.FileSettingsService] [node-1] setting file [D:\soft\ES\elasticsearch-9.2.1-windows-x86_64\elasticsearch-9.2.1\config\operator\settings.json] not found, initializing [file_settings] as empty [2025-11-26T15:53:31,154][INFO ][o.e.g.GatewayService ] [node-1] recovered [3] indices into cluster_state [2025-11-26T15:53:31,173][INFO ][o.e.x.w.LicensedWriteLoadForecaster] [node-1] license state changed, now [not valid] [2025-11-26T15:53:32,507][INFO ][o.e.h.n.s.HealthNodeTaskExecutor] [node-1] Node [{node-1}{dWfo4MO3STGwlTnFuIzuYw}] is selected as the current health node. 这是否表明es启动成功了
最新发布
11-27
要根据 Elasticsearch 9.2.1 在 Windows 11 系统下的启动日志判断 ES 是否启动成功,可以关注以下几个关键信息: ### 成功启动的标志 - **服务绑定信息**:日志中会显示 Elasticsearch 成功绑定到指定的网络地址和端口,通常是 `9200` 和 `9300` 端口。例如: ```plaintext [2024-01-01T12:00:00,000][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200} ``` 这表明 Elasticsearch 已经成功绑定到 `127.0.0.1` 的 `9200` 端口,可以对外提供服务。 - **集群节点加入信息**:如果是集群模式,日志中会显示节点成功加入集群的信息。例如: ```plaintext [2024-01-01T12:00:01,000][INFO ][o.e.c.s.ClusterApplierService] [node-1] added {{node-2}{abcdefg}{127.0.0.2}{127.0.0.2:9300},}, reason: apply cluster state (from master [master {node-1}{1234567}{127.0.0.1}{127.0.0.1:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)[{node-1}{1234567}{127.0.0.1}{127.0.0.1:9300}]]]) ``` 这表明节点 `node-2` 成功加入了由 `node-1` 作为主节点的集群。 - **启动完成信息**:日志中会有明确的启动完成提示。例如: ```plaintext [2024-01-01T12:00:02,000][INFO ][o.e.n.Node ] [node-1] started ``` 这表明 Elasticsearch 节点 `node-1` 已经成功启动。 ### 启动失败的标志 - **异常堆栈信息**:日志中出现异常堆栈信息,通常表示启动过程中遇到了错误。例如: ```plaintext [2024-01-01T12:00:03,000][ERROR][o.e.b.Bootstrap ] [node-1] Exception in thread [main] java.lang.RuntimeException: Failed to bind to [9200] at org.elasticsearch.bootstrap.BootstrapInfo.handleBindFailure(BootstrapInfo.java:123) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.BootstrapInfo.bootstrap(BootstrapInfo.java:202) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:172) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:163) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:81) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:129) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-9.2.1.jar:9.2.1] Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) ~[?:?] at sun.nio.ch.Net.bind(Net.java:459) ~[?:?] at sun.nio.ch.Net.bind(Net.java:448) ~[?:?] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[?:?] at org.elasticsearch.http.netty4.Netty4HttpServerTransport$HttpPublishingChannelConnector.bind(Netty4HttpServerTransport.java:477) ~[elasticsearch-netty4-9.2.1.jar:9.2.1] at org.elasticsearch.http.netty4.Netty4HttpServerTransport$HttpPublishingChannelConnector.bind(Netty4HttpServerTransport.java:453) ~[elasticsearch-netty4-9.2.1.jar:9.2.1] at org.elasticsearch.http.AbstractHttpServerTransport.bindServerChannel(AbstractHttpServerTransport.java:247) ~[elasticsearch-9.2.1.jar:9.2.1] ... 8 more ``` 这表明 Elasticsearch 无法绑定到 `9200` 端口,因为该端口已经被其他程序占用。 - **配置错误信息**:日志中出现配置错误提示,通常是由于配置文件中的参数设置不正确导致的。例如: ```plaintext [2024-01-01T12:00:04,000][ERROR][o.e.b.Bootstrap ] [node-1] Exception in thread [main] org.elasticsearch.common.settings.SettingsException: Failed to load settings from [elasticsearch.yml] at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1234) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.common.settings.Settings$Builder.loadFromFile(Settings.java:1219) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.BootstrapSettings.init(BootstrapSettings.java:102) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:172) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:163) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:81) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:129) ~[elasticsearch-9.2.1.jar:9.2.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-9.2.1.jar:9.2.1] Caused by: java.io.FileNotFoundException: elasticsearch.yml (The system cannot find the file specified) at java.io.FileInputStream.open0(Native Method) ~[?:?] at java.io.FileInputStream.open(FileInputStream.java:219) ~[?:?] at java.io.FileInputStream.<init>(FileInputStream.java:157) ~[?:?] at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1231) ~[elasticsearch-9.2.1.jar:9.2.1] ... 9 more ``` 这表明 Elasticsearch 无法找到 `elasticsearch.yml` 配置文件。 ### 示例代码检查 ES 是否启动成功 可以使用以下 Python 代码检查 ES 是否启动成功: ```python from elasticsearch import Elasticsearch try: es = Elasticsearch(['http://localhost:9200']) if es.ping(): print('Elasticsearch is running.') else: print('Elasticsearch is not running.') except Exception as e: print(f'Error connecting to Elasticsearch: {e}') ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值