From 812f6e30f577ae1fae8b4d6a356653b8eac110aa Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 13 Jan 2017 14:57:40 +0100 Subject: Add documentation on remote debugging For a node which is launched outside the context of Gradle. --- TESTING.asciidoc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 13f8ca3ca7..83fe27a963 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -474,7 +474,7 @@ Combined (Unit+Integration) coverage: mvn -Dtests.coverage verify jacoco:report --------------------------------------------------------------------------- -== Debugging from an IDE +== Launching and debugging from an IDE If you want to run elasticsearch from your IDE, the `gradle run` task supports a remote debugging option: @@ -483,6 +483,23 @@ supports a remote debugging option: gradle run --debug-jvm --------------------------------------------------------------------------- +== Debugging remotely from an IDE + +If you want to run elasticsearch and be able to remotely attach the process +for debugging purposes from your IDE, you need to add the following line in +`config/jvm.options`: + +--------------------------------------------------------------------------- +-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n +--------------------------------------------------------------------------- + +Then start elasticsearch with `bin/elasticsearch` as usual. + +If you are using IntelliJ, create a new Run/Debug configuration, choose `Remote` +and define the same port you defined in `config/jvm.options`. Then start the +remote debug session from IntelliJ. + + == Building with extra plugins Additional plugins may be built alongside elasticsearch, where their dependency on elasticsearch will be substituted with the local elasticsearch -- cgit v1.2.3