Dump Stack on Linux User Space

#include <stdio.h>
#include <stdlib.h>
#include <execinfo.h>

int dump_stack(void)
{
        int j, nptrs;
        void *buffer[16];
        char ** strings;

        nptrs = backtrace(buffer,16);

        printf("backtrace() returned %d addresses\n",nptrs);

        strings = backtrace_symbols(buffer, nptrs);
        if (strings == NULL) {
                printf("error backtrace_symbols\n");
                return -1;
        }
        for(j = 0; j<nptrs; j++)
                printf("[%02d] %s\n",j,strings[j]);

        free(strings);
        return 0;
}

volatile void test_call_3(void)
{
        printf("I am %s\n",__func__);
        dump_stack();
        printf("I exit %s\n",__func__);
}
volatile void test_call_2(void)
{
        printf("I am %s\n",__func__);
        test_call_3();
        printf("I exit %s\n",__func__);
}

int main(int argc,char **argv)
{
        test_call_2();
}

 

[2025-05-12T16:43:47,345][INFO ][o.e.b.Elasticsearch ] [DESKTOP-A854GSO] version[9.0.1], pid[10096], build[zip/73f7594ea00db50aa7e941e151a5b3985f01e364/2025-04-30T10:07:41.393025990Z], OS[Windows 11/10.0/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/24/24+36-3646] [2025-05-12T16:43:47,356][INFO ][o.e.b.Elasticsearch ] [DESKTOP-A854GSO] JVM home [D:\elasticsearch\elasticsearch-9.0.1\jdk], using bundled JDK [true] [2025-05-12T16:43:47,357][INFO ][o.e.b.Elasticsearch ] [DESKTOP-A854GSO] 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, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=CLDR, -Dorg.apache.lucene.vectorization.upperJavaFeatureVersion=24, -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, -Des.entitlements.enabled=true, -XX:+EnableDynamicAgentLoading, -Djdk.attach.allowAttachSelf=true, --patch-module=java.base=lib\entitlement-bridge\elasticsearch-entitlement-bridge-9.0.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\鍥AppData\Local\Temp\elasticsearch, --add-modules=jdk.incubator.vector, -Dorg.apache.lucene.store.defaultReadAdvice=normal, -XX:+HeapDumpOnOutOfMemoryError, -XX:+ExitOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,level,pid,tags:filecount=32,filesize=64m, -Xms7778m, -Xmx7778m, -XX:MaxDirectMemorySize=4078960640, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, --module-path=D:\elasticsearch\elasticsearch-9.0.1\lib, --add-modules=jdk.net, --add-modules=jdk.management.agent, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server] [2025-05-12T16:43:47,358][INFO ][o.e.b.Elasticsearch ] [DESKTOP-A854GSO] Default Locale [zh_CN] [2025-05-12T16:43:47,528][INFO ][o.e.n.NativeAccess ] [DESKTOP-A854GSO] Using [jdk] native provider and native methods for [Windows] [2025-05-12T16:43:47,660][INFO ][o.a.l.i.v.PanamaVectorizationProvider] [DESKTOP-A854GSO] Java vector incubator API enabled; uses preferredBitSize=256; FMA enabled [2025-05-12T16:43:47,802][INFO ][o.e.b.Elasticsearch ] [DESKTOP-A854GSO] Bootstrapping Entitlements [2025-05-12T16:43:52,351][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [repository-url] [2025-05-12T16:43:52,352][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [rest-root] [2025-05-12T16:43:52,352][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-core] [2025-05-12T16:43:52,353][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-redact] [2025-05-12T16:43:52,353][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [ingest-user-agent] [2025-05-12T16:43:52,353][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-async-search] [2025-05-12T16:43:52,354][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-monitoring] [2025-05-12T16:43:52,354][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [repository-s3] [2025-05-12T16:43:52,354][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-analytics] [2025-05-12T16:43:52,354][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-esql-core] [2025-05-12T16:43:52,355][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-ent-search] [2025-05-12T16:43:52,355][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-autoscaling] [2025-05-12T16:43:52,355][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [lang-painless] [2025-05-12T16:43:52,356][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-ml] [2025-05-12T16:43:52,356][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [lang-mustache] [2025-05-12T16:43:52,356][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [legacy-geo] [2025-05-12T16:43:52,356][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [logsdb] [2025-05-12T16:43:52,357][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-ql] [2025-05-12T16:43:52,357][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [rank-rrf] [2025-05-12T16:43:52,357][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [analysis-common] [2025-05-12T16:43:52,358][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [health-shards-availability] [2025-05-12T16:43:52,358][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [transport-netty4] [2025-05-12T16:43:52,358][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [aggregations] [2025-05-12T16:43:52,358][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [ingest-common] [2025-05-12T16:43:52,359][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [frozen-indices] [2025-05-12T16:43:52,359][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-identity-provider] [2025-05-12T16:43:52,359][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-shutdown] [2025-05-12T16:43:52,359][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-text-structure] [2025-05-12T16:43:52,360][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [snapshot-repo-test-kit] [2025-05-12T16:43:52,360][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [ml-package-loader] [2025-05-12T16:43:52,360][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [kibana] [2025-05-12T16:43:52,360][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [constant-keyword] [2025-05-12T16:43:52,361][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-logstash] [2025-05-12T16:43:52,361][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-ccr] [2025-05-12T16:43:52,361][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-graph] [2025-05-12T16:43:52,361][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [rank-vectors] [2025-05-12T16:43:52,362][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-esql] [2025-05-12T16:43:52,362][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [parent-join] [2025-05-12T16:43:52,362][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [counted-keyword] [2025-05-12T16:43:52,362][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-enrich] [2025-05-12T16:43:52,363][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [repositories-metering-api] [2025-05-12T16:43:52,363][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [transform] [2025-05-12T16:43:52,363][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [repository-azure] [2025-05-12T16:43:52,364][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [dot-prefix-validation] [2025-05-12T16:43:52,364][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [repository-gcs] [2025-05-12T16:43:52,364][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [spatial] [2025-05-12T16:43:52,364][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-otel-data] [2025-05-12T16:43:52,364][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [apm] [2025-05-12T16:43:52,365][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [mapper-extras] [2025-05-12T16:43:52,365][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [mapper-version] [2025-05-12T16:43:52,365][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-rollup] [2025-05-12T16:43:52,365][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [percolator] [2025-05-12T16:43:52,366][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-migrate] [2025-05-12T16:43:52,366][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [data-streams] [2025-05-12T16:43:52,366][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-stack] [2025-05-12T16:43:52,366][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [rank-eval] [2025-05-12T16:43:52,366][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [reindex] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-security] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [blob-cache] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [searchable-snapshots] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-slm] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-geoip-enterprise-downloader] [2025-05-12T16:43:52,367][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [snapshot-based-recoveries] [2025-05-12T16:43:52,368][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-watcher] [2025-05-12T16:43:52,368][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [old-lucene-versions] [2025-05-12T16:43:52,368][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-ilm] [2025-05-12T16:43:52,368][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-inference] [2025-05-12T16:43:52,368][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-voting-only-node] [2025-05-12T16:43:52,369][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-deprecation] [2025-05-12T16:43:52,369][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-fleet] [2025-05-12T16:43:52,369][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-aggregate-metric] [2025-05-12T16:43:52,369][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-downsample] [2025-05-12T16:43:52,369][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-profiling] [2025-05-12T16:43:52,370][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [ingest-geoip] [2025-05-12T16:43:52,370][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-write-load-forecaster] [2025-05-12T16:43:52,370][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [search-business-rules] [2025-05-12T16:43:52,370][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [ingest-attachment] [2025-05-12T16:43:52,370][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [wildcard] [2025-05-12T16:43:52,371][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-apm-data] [2025-05-12T16:43:52,371][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [unsigned-long] [2025-05-12T16:43:52,371][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-sql] [2025-05-12T16:43:52,371][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [runtime-fields-common] [2025-05-12T16:43:52,372][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-async] [2025-05-12T16:43:52,372][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [vector-tile] [2025-05-12T16:43:52,372][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-kql] [2025-05-12T16:43:52,372][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [lang-expression] [2025-05-12T16:43:52,372][INFO ][o.e.p.PluginsService ] [DESKTOP-A854GSO] loaded module [x-pack-eql] [2025-05-12T16:43:54,309][INFO ][o.e.e.NodeEnvironment ] [DESKTOP-A854GSO] using [1] data paths, mounts [[(D:)]], net usable_space [546.3gb], net total_space [953.8gb], types [NTFS] [2025-05-12T16:43:54,310][INFO ][o.e.e.NodeEnvironment ] [DESKTOP-A854GSO] heap size [7.5gb], compressed ordinary object pointers [true] [2025-05-12T16:43:54,399][INFO ][o.e.n.Node ] [DESKTOP-A854GSO] node name [DESKTOP-A854GSO], node ID [oThuyDfhTraitepa21vwPA], cluster name [elasticsearch], roles [ingest, data_frozen, ml, data_hot, transform, data_content, data_warm, master, remote_cluster_client, data, data_cold] [2025-05-12T16:43:57,587][INFO ][o.e.i.r.RecoverySettings ] [DESKTOP-A854GSO] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b] [2025-05-12T16:43:57,830][INFO ][o.e.f.FeatureService ] [DESKTOP-A854GSO] Registered local node features [ES_V_8, ES_V_9, cluster.reroute.ignores_metric_param, cluster.stats.source_modes, linear_retriever_supported, lucene_10_1_upgrade, lucene_10_upgrade, security.queryable_built_in_roles, simulate.ignored.fields] [2025-05-12T16:43:57,873][INFO ][o.e.c.m.DataStreamGlobalRetentionSettings] [DESKTOP-A854GSO] Updated default factory retention to [null] [2025-05-12T16:43:57,874][INFO ][o.e.c.m.DataStreamGlobalRetentionSettings] [DESKTOP-A854GSO] Updated max factory retention to [null] [2025-05-12T16:43:58,428][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [DESKTOP-A854GSO] [controller/15508] [Main.cc@123] controller (64 bit): Version 9.0.1 (Build 5ac89bc732bee2) Copyright (c) 2025 Elasticsearch BV [2025-05-12T16:43:58,907][INFO ][o.e.x.o.OTelPlugin ] [DESKTOP-A854GSO] OTel ingest plugin is enabled [2025-05-12T16:43:58,937][INFO ][o.e.x.c.t.YamlTemplateRegistry] [DESKTOP-A854GSO] OpenTelemetry index template registry is enabled [2025-05-12T16:43:58,953][INFO ][o.e.t.a.APM ] [DESKTOP-A854GSO] Sending apm metrics is disabled [2025-05-12T16:43:58,954][INFO ][o.e.t.a.APM ] [DESKTOP-A854GSO] Sending apm tracing is disabled [2025-05-12T16:43:59,004][INFO ][o.e.x.s.Security ] [DESKTOP-A854GSO] Security is enabled [2025-05-12T16:43:59,379][INFO ][o.e.x.s.a.s.FileRolesStore] [DESKTOP-A854GSO] parsed [0] roles from file [D:\elasticsearch\elasticsearch-9.0.1\config\roles.yml] [2025-05-12T16:44:00,003][INFO ][o.e.x.w.Watcher ] [DESKTOP-A854GSO] Watcher initialized components at 2025-05-12T08:44:00.002Z [2025-05-12T16:44:00,143][INFO ][o.e.x.p.ProfilingPlugin ] [DESKTOP-A854GSO] Profiling is enabled [2025-05-12T16:44:00,162][INFO ][o.e.x.p.ProfilingPlugin ] [DESKTOP-A854GSO] profiling index templates will not be installed or reinstalled [2025-05-12T16:44:00,170][INFO ][o.e.x.a.APMPlugin ] [DESKTOP-A854GSO] APM ingest plugin is enabled [2025-05-12T16:44:00,207][INFO ][o.e.x.c.t.YamlTemplateRegistry] [DESKTOP-A854GSO] apm index template registry is enabled [2025-05-12T16:44:00,764][INFO ][o.e.t.n.NettyAllocator ] [DESKTOP-A854GSO] 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-05-12T16:44:00,837][INFO ][o.e.d.DiscoveryModule ] [DESKTOP-A854GSO] using discovery type [multi-node] and seed hosts providers [settings] [2025-05-12T16:44:02,474][INFO ][o.e.n.Node ] [DESKTOP-A854GSO] initialized [2025-05-12T16:44:02,475][INFO ][o.e.n.Node ] [DESKTOP-A854GSO] starting ... [2025-05-12T16:44:02,520][INFO ][o.e.x.s.c.f.PersistentCache] [DESKTOP-A854GSO] persistent cache index loaded [2025-05-12T16:44:02,521][INFO ][o.e.x.d.l.DeprecationIndexingComponent] [DESKTOP-A854GSO] deprecation component started [2025-05-12T16:44:02,642][INFO ][o.e.t.TransportService ] [DESKTOP-A854GSO] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300} [2025-05-12T16:44:03,031][WARN ][o.e.c.c.ClusterBootstrapService] [DESKTOP-A854GSO] this node is locked into cluster UUID [_h3NONUQTr-ueBQPxrmidA] but [cluster.initial_master_nodes] is set to [DESKTOP-A854GSO]; 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.0#initial_master_nodes [2025-05-12T16:44:03,176][INFO ][o.e.c.s.MasterService ] [DESKTOP-A854GSO] elected-as-master ([1] nodes joined in term 4)[_FINISH_ELECTION_, {DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}{ELpoXthvShu35FsJ-XSBeA}{DESKTOP-A854GSO}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{9.0.1}{8000099-9009000} completing election], term: 4, version: 98, delta: master node changed {previous [], current [{DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}{ELpoXthvShu35FsJ-XSBeA}{DESKTOP-A854GSO}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{9.0.1}{8000099-9009000}]} [2025-05-12T16:44:03,257][INFO ][o.e.c.s.ClusterApplierService] [DESKTOP-A854GSO] master node changed {previous [], current [{DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}{ELpoXthvShu35FsJ-XSBeA}{DESKTOP-A854GSO}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{9.0.1}{8000099-9009000}]}, term: 4, version: 98, reason: Publication{term=4, version=98} [2025-05-12T16:44:03,312][INFO ][o.e.c.c.NodeJoinExecutor ] [DESKTOP-A854GSO] node-join: [{DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}{ELpoXthvShu35FsJ-XSBeA}{DESKTOP-A854GSO}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{9.0.1}{8000099-9009000}] with reason [completing election] [2025-05-12T16:44:03,317][INFO ][o.e.h.AbstractHttpServerTransport] [DESKTOP-A854GSO] publish_address {192.168.10.4:9200}, bound_addresses {[::]:9200} [2025-05-12T16:44:03,328][INFO ][o.e.x.w.LicensedWriteLoadForecaster] [DESKTOP-A854GSO] license state changed, now [valid] [2025-05-12T16:44:03,341][INFO ][o.e.n.Node ] [DESKTOP-A854GSO] started {DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}{ELpoXthvShu35FsJ-XSBeA}{DESKTOP-A854GSO}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{9.0.1}{8000099-9009000}{ml.allocated_processors_double=16.0, ml.max_jvm_size=8157921280, ml.config_version=12.0.0, xpack.installed=true, transform.config_version=10.0.0, ml.machine_memory=16312721408, ml.allocated_processors=16} [2025-05-12T16:44:03,387][WARN ][o.e.x.i.s.e.a.ElasticInferenceServiceAuthorizationHandler] [DESKTOP-A854GSO] Failed to revoke access to default inference endpoint IDs: [rainbow-sprinkles], error: org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized]; [2025-05-12T16:44:03,738][INFO ][o.e.x.m.MlIndexRollover ] [DESKTOP-A854GSO] ML legacy indices rolled over [2025-05-12T16:44:03,739][INFO ][o.e.x.m.MlAnomaliesIndexUpdate] [DESKTOP-A854GSO] legacy ml anomalies indices rolled over and aliases updated [2025-05-12T16:44:03,751][INFO ][o.e.x.s.a.Realms ] [DESKTOP-A854GSO] license mode is [basic], currently licensed security realms are [reserved/reserved,file/default_file,native/default_native] [2025-05-12T16:44:03,754][INFO ][o.e.l.ClusterStateLicenseService] [DESKTOP-A854GSO] license [c457fd5c-94b5-44ae-ba97-7a8de1c2a152] mode [basic] - valid [2025-05-12T16:44:03,756][INFO ][o.e.c.f.AbstractFileWatchingService] [DESKTOP-A854GSO] starting file watcher ... [2025-05-12T16:44:03,761][INFO ][o.e.c.f.AbstractFileWatchingService] [DESKTOP-A854GSO] file settings service up and running [tid=109] [2025-05-12T16:44:03,762][INFO ][o.e.r.s.FileSettingsService] [DESKTOP-A854GSO] setting file [D:\elasticsearch\elasticsearch-9.0.1\config\operator\settings.json] not found, initializing [file_settings] as empty [2025-05-12T16:44:03,775][INFO ][o.e.g.GatewayService ] [DESKTOP-A854GSO] recovered [3] indices into cluster_state [2025-05-12T16:44:03,878][INFO ][o.e.x.w.LicensedWriteLoadForecaster] [DESKTOP-A854GSO] license state changed, now [not valid] [2025-05-12T16:44:04,273][INFO ][o.e.h.n.s.HealthNodeTaskExecutor] [DESKTOP-A854GSO] Node [{DESKTOP-A854GSO}{oThuyDfhTraitepa21vwPA}] is selected as the current health node. [2025-05-12T16:44:04,277][INFO ][o.e.c.r.a.AllocationService] [DESKTOP-A854GSO] current.health="GREEN" message="Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.ds-.logs-elasticsearch.deprecation-default-2025.05.12-000001][0], [.ds-ilm-history-7-2025.05.12-000001][0], [.security-7][0]]])." previous.health="RED" reason="shards started [[.ds-.logs-elasticsearch.deprecation-default-2025.05.12-000001][0], [.ds-ilm-history-7-2025.05.12-000001][0], [.security-7][0]]" 中文回答
最新发布
05-13
<think>好的,我现在需要帮助用户查看和分析Elasticsearch 9.0.1的启动日志,涉及模块加载、JVM配置、插件信息和集群健康状态。首先,我应该回忆一下Elasticsearch日志的位置和常用配置。根据引用中的信息,日志目录通常是在安装路径下的logs文件夹里,比如/opt/elasticsearch/logs,不过具体可能根据安装方式有所不同。用户可能已经按照之前的步骤部署了Elasticsearch,所以需要确认日志路径是否正确。 接下来,用户想分析模块加载情况。Elasticsearch启动时会加载不同的模块,比如网络模块、安全模块等。在日志中搜索“loaded module”应该能找到相关信息。例如,日志中可能出现“[INFO ][o.e.p.PluginsService ] [node-1] loaded module [analysis-common]”这样的条目,这说明某个模块已经加载。需要提醒用户注意是否有模块加载失败的情况,这可能导致功能缺失。 然后是JVM配置。Elasticsearch的JVM参数通常在jvm.options文件中配置,用户可能已经设置了内存参数,如-Xms和-Xmx。在日志中,启动时可能会输出JVM版本和内存信息,比如“JVM arguments: -Xms2g -Xmx2g”,用户需要确认这些参数是否合理,是否与预期一致。如果用户没有自定义配置,Elasticsearch默认会使用堆内存的50%,但生产环境建议明确设置。 插件信息方面,Elasticsearch启动时会列出已安装的插件。用户需要检查日志中类似“[INFO ][o.e.p.PluginsService ] [node-1] loaded plugin [analysis-ik]”的条目,确认所有需要的插件都已正确加载。如果有插件加载失败,可能需要检查插件版本是否兼容9.0.1,或者安装是否正确。 集群健康状态分析可能需要用户在启动后执行健康检查命令,比如curl -XGET 'http://localhost:9200/_cluster/health?pretty',但日志中可能在启动过程中也会输出集群形成的状态。例如,节点加入集群时会记录“[INFO ][o.e.c.c.Coordinator ] [node-1] cluster has formed”等信息。如果集群未能形成,可能是网络配置或发现机制的问题,需要检查配置文件中的network.host和discovery.seed_hosts设置。 另外,用户可能遇到启动错误,比如内存不足、文件描述符限制或权限问题。需要提醒用户查看日志中的ERROR或WARN级别信息,并根据提示进行调整,比如调整ulimit设置或修改elasticsearch.yml中的配置。 最后,需要总结分析步骤,帮助用户系统地检查各个部分,并给出相关问题的建议,比如如何优化JVM配置、如何安装插件或如何解决集群节点无法加入的问题。同时,根据用户之前的引用,他们可能是在Linux环境下部署,需要注意路径和权限是否正确,比如用户es8是否有足够的权限访问数据和日志目录。</think>### Elasticsearch 9.0.1 启动日志分析指南 #### 一、日志文件定位 Elasticsearch 启动日志默认存储在安装目录下的 `logs` 子目录中: ```bash /opt/elasticsearch/logs/elasticsearch.log # 根据引用[2]的安装路径 ``` 若使用 systemd 管理服务(如引用[1]),可通过以下命令查看实时日志: ```bash journalctl -u elasticsearch.service --since "5 minutes ago" ``` --- #### 二、关键信息分析步骤 ##### 1. **模块加载情况** 在日志中搜索 `loaded module` 或 `modules`: ```log [INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggs-matrix-stats] [INFO ][o.e.p.PluginsService ] [node-1] loaded module [analysis-common] ``` - **重点关注**:安全模块(如 `x-pack-security`)、网络模块(`transport-netty4`)是否加载成功 - **异常处理**:若出现 `failed to load module`,检查配置文件 `elasticsearch.yml`(引用[3]) --- ##### 2. **JVM 配置验证** 通过日志中 `JVM arguments` 确认配置: ```log [INFO ][o.e.n.Node ] [node-1] JVM arguments [... -Xms4g -Xmx4g ...] ``` - **关键参数**: - 堆内存设置(`-Xms`/`-Xmx`)建议不超过物理内存的50% - GC 算法(如 `-XX:+UseG1GC`) - **配置文件**:`config/jvm.options`(引用[1]中的环境变量关联) --- ##### 3. **插件信息检查** 查找 `loaded plugin` 条目: ```log [INFO ][o.e.p.PluginsService ] [node-1] loaded plugin [repository-s3] [INFO ][o.e.p.PluginsService ] [node-1] loaded plugin [analysis-ik] ``` - **核心插件**:`x-pack`(安全监控)、`analysis-*`(分词器) - **兼容性**:需确认插件版本与 Elasticsearch 9.0.1 匹配 --- ##### 4. **集群健康状态诊断** 启动完成后检查集群状态: ```bash curl -XGET "http://localhost:9200/_cluster/health?pretty" ``` 日志中关键阶段: ```log [INFO ][o.e.c.c.Coordinator ] [node-1] cluster has formed # 集群形成 [INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices # 索引恢复 ``` - **健康状态**: - `GREEN`:所有主/副本分片正常 - `YELLOW`:主分片正常但副本未分配(常见于单节点) - `RED`:主分片缺失(需紧急处理) --- #### 三、常见问题排查 1. **启动失败**: ```log [ERROR][o.e.b.Bootstrap ] [node-1] node validation exception [1] bootstrap checks failed. You must address the points described... ``` - **解决方案**:调整 `vm.max_map_count` 或文件描述符限制(引用[1]中 `LimitNOFILE` 配置) 2. **节点无法加入集群**: ```log [WARN ][o.e.d.DiscoveryModule ] [node-1] discovery type [zen] is deprecated ``` - **检查**:`discovery.seed_hosts` 配置(引用[4]的集群发现机制) --- #### 四、日志分析示例 ```log [INFO ][o.e.n.Node ] [node-1] version[9.0.1], pid[1234], build[default/tar/...] [INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/export/data]] # 引用[2]数据目录 [INFO ][o.e.g.DanglingIndicesState] [node-1] gateway.auto_import_dangling_indices is [false] [INFO ][o.e.c.r.a.DiskThresholdMonitor] [node-1] low disk watermark [85%] exceeded on ... ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值