Start elasticsearch with debug option

Hi everyone
i just start my elasticsearch with the following command
bin/elasticsearch -D "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

it starts successfully, by when i try to connect it with a eclipse, it shows connection refused.

Does any boy debug elasticsearch in this way?

Hopes your reply.

We support remote debugging simply by checking out elasticsearch from github and running gradle run --debug-jvm. See here.

I just tried that and it works for me, the port used is 8000. Gradle does all the work of configuring jvm arguments, you just have to get you IDE to connect to localhost:8000. This is convenient also to make sure that the code in your IDE is actually in sync with the code you are running, as you run and debug from the same directory.

As for passing the needed jvm arguments to the elasticsearch startup script like you are trying to do, I think it should be done by providing the ES_JAVA_OPTS environment variable instead (without -D).

Hi Luca
I successfully debug it by eclipse. Thanks for you quickly reply.