Remotly Debug ElasticSearch in IntelliJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|Pretty simple once you know how.
|Step 1: In IntelliJ, create a new remote debug configuration. Name it something ElasticSearchy. All of the default values should be fine. The only thing you need to change is the Host value. If ElasticSearch is gonna be running locally, just use "localhost", otherwise use the IP address of the remote machine ElasticSearch is gonna run on
|Step 2: When starting ElasticSearch, just add a -D argument with the standard java remote debug values like so:
|bin/elasticsearch -D "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
|ElasticSearch will start and if suspend is set to 'y', it'll pause execution until you have attached the IntelliJ debugger.
|Step 3: In IntilliJ, run the remote debug configuration you created in step 1.
|At this point any breakpoints you have set in, say, an ElasticSearch plugin will get hit