elasticsearch中堆转储的默认位置是什么?

时间:2017-07-06 08:14:42

标签: elasticsearch

我让ES在3Node集群中运行。最近我在日志中看到了OutofMemory异常。我的ES已启用XX:+HeapDumpOnOutOfMemoryError,这会在发生OutofMemoryError时创建堆转储。即使我用ps -ef | grep elastic命令检查我也得到了这样的响应

elastic+ 2527 1 11 08:47 ? 00:03:59 /usr/bin/java -Xms1720m -Xmx1720m -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Dmapper.allow_dots_in_name=true -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/elasticsearch-2.4.1.jar:/usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch start -d -p /var/run/elasticsearch/elasticsearch.pid --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.conf=/etc/elasticsearch

我的错误是这样的

[2017-06-27 06:29:36,325][DEBUG][action.search            ] [data] [content-2017][3], node[GDyfoO1ySQ-FgKGFmuJxJg], [P], v[61], s[STARTED], a[id=PN-9iOlNTICPLABsgyd3Qw]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3fbfc52e] lastShard [true]
RemoteTransportException[[data][10.0.x.x:9300][indices:data/read/search[phase/query]]]; nested: QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: OutOfMemoryError[Java heap space];
Caused by: QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: OutOfMemoryError[Java heap space];
        at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:409)
        at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:113)
        at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:372)
        at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:385)
        at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
        at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
        at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
        at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
        at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:376)
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space

我通过给出find . -type f -name \*.hprof这个命令检查了我服务器中的所有.hprof文件,但没找到任何文件

想知道是否会为上述异常生成堆转储,如果它位于该位置的位置?

谢谢

1 个答案:

答案 0 :(得分:1)

你的命令不是一个错字 find . -type f -name \*.hprof代替find . -type f -name \*.hrpf

检查pwdx <processid> - &gt; U将获得进程开始的路径。它也有可能在那条道路上被创造出来。

搜索所有路径,例如'/ etc / elasticsearch','/ var / log / elasticsearch',/ usr / share / elasticsearch .. etc(来自命令输出的路径)

应包含

-XX:HeapDumpPath=<Path>