Elasticsearch: can't run jstack command in elasticsearch docker container

Created on 8 Jan 2020  路  2Comments  路  Source: elastic/elasticsearch

Elasticsearch version:
7.1.0

Plugins installed:
repository-hdfs ,elasticsearch-analysis-ik,dynamic-synonym

JVM version (java -version):
openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment (build 12.0.1+12)
OpenJDK 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

OS version (uname -a if on a Unix-like system):
Linux SmartSearch-es01 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
I use the docker image elasticsearch:7.1.0 , I can not run jstack command in docker container and got the error beloow :
1: Unable to open socket file /proc/1/root/tmp/.java_pid1: target process 1 doesn't respond within 10500ms or HotSpot VM not loaded

Steps to reproduce:

  1. setp into docker container es01
docker exec -it es01 bash
  1. change user to elasticsearch
[root@docker-221 elasticsearch]# su elasticsearch
[elasticsearch@docker-221 ~]$ 
  1. run jstack comman
[elasticsearch@docker-221 ~]$ /usr/share/elasticsearch/jdk/bin/jps
1 Elasticsearch
966 Jps
[elasticsearch@docker-221 ~]$ /usr/share/elasticsearch/jdk/bin/jstack 1
1: Unable to open socket file /proc/1/root/tmp/.java_pid1: target process 1 doesn't respond within 10500ms or HotSpot VM not loaded

Provide logs (if relevant):

Most helpful comment

Thanks very much for your interest in Elasticsearch.

The issue is that the elasticsearch process runs as uid 1000 and gid 0, but when you su elasticsearch uid:gid 1000:1000; instead you should try docker exec -u 1000:0 -ti es01 /bin/bash and run jstack from there without su'ing.

Having said that, this appears to be a user question, and we'd like to direct these kinds of things to the Elasticsearch forum. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.

There's an active community in the forum that should be able to help get an answer to your question. As such, I hope you don't mind that I close this.

All 2 comments

Thanks very much for your interest in Elasticsearch.

The issue is that the elasticsearch process runs as uid 1000 and gid 0, but when you su elasticsearch uid:gid 1000:1000; instead you should try docker exec -u 1000:0 -ti es01 /bin/bash and run jstack from there without su'ing.

Having said that, this appears to be a user question, and we'd like to direct these kinds of things to the Elasticsearch forum. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.

There's an active community in the forum that should be able to help get an answer to your question. As such, I hope you don't mind that I close this.

@dliappis Thank you very much , It works

Was this page helpful?
0 / 5 - 0 ratings