@@ -45,7 +45,7 @@ run it using Gradle:
45
45
46
46
==== Launching and debugging from an IDE
47
47
48
- If you want to run Elasticsearch from your IDE, the `./gradlew run` task
48
+ If you want to run and debug Elasticsearch from your IDE, the `./gradlew run` task
49
49
supports a remote debugging option. Run the following from your terminal:
50
50
51
51
---------------------------------------------------------------------------
@@ -55,7 +55,7 @@ supports a remote debugging option. Run the following from your terminal:
55
55
Next start the "Debug Elasticsearch" run configuration in IntelliJ. This will enable the IDE to connect to the process and allow debug functionality.
56
56
57
57
58
- As such the IDE needs to be instructed to listen for connections on this port.
58
+ As such the IDE needs to be instructed to listen for connections on the debug port.
59
59
Since we might run multiple JVMs as part of configuring and starting the cluster it's
60
60
recommended to configure the IDE to initiate multiple listening attempts. In case of IntelliJ, this option
61
61
is called "Auto restart" and needs to be checked.
@@ -64,6 +64,22 @@ NOTE: If you have imported the project into IntelliJ according to the instructio
64
64
link:/CONTRIBUTING.md#importing-the-project-into-intellij-idea[CONTRIBUTING.md] then a debug run configuration
65
65
named "Debug Elasticsearch" will be created for you and configured appropriately.
66
66
67
+ ===== Debugging the CLI launcher
68
+
69
+ The gradle task does not start the Elasticsearch server process directly; like in the Elasticsearch distribution,
70
+ the job of starting the server process is delegated to a launcher CLI tool. If you need to debug the launcher itself,
71
+ add the following option to the `run` task:
72
+ ---------------------------------------------------------------------------
73
+ ./gradlew run --debug-cli-jvm
74
+ ---------------------------------------------------------------------------
75
+ This option can be specified in isolation or combined with `--debug-jvm`. Since the CLI launcher lifespan may overlap
76
+ with the server process lifespan, the CLI launcher process will be started on a different port (5107 for the first node,
77
+ 5108 and following for additional cluster nodes).
78
+
79
+ As with the `--debug-jvm` command, the IDE needs to be instructed to listen for connections on the debug port.
80
+ You need to configure and start an appropriate Remote JVM Debug configuration, e.g. by cloning and editing
81
+ the "Debug Elasticsearch" run configuration to point to the correct debug port.
82
+
67
83
==== Disabling assertions
68
84
69
85
When running Elasticsearch with `./gradlew run`, assertions are enabled by
@@ -103,7 +119,8 @@ password: `elastic-password`.
103
119
- In order to start a node with a different max heap space add: `-Dtests.heap.size=4G`
104
120
- In order to use a custom data directory: `--data-dir=/tmp/foo`
105
121
- In order to preserve data in between executions: `--preserve-data`
106
- - In order to remotely attach a debugger to the process: `--debug-jvm`
122
+ - In order to remotely attach a debugger to the server process: `--debug-jvm`
123
+ - In order to remotely attach a debugger to the CLI launcher process: `--debug-cli-jvm`
107
124
- In order to set a different keystore password: `--keystore-password`
108
125
- In order to set an Elasticsearch setting, provide a setting with the following prefix: `-Dtests.es.`
109
126
- In order to pass a JVM setting, e.g. to disable assertions: `-Dtests.jvm.argline="-da"`
0 commit comments