How to debug elastic search in an IDE

I'm trying to learn the internal workings of ES. How can I get ES running on the IDEA ide ?

Hey,

check out elasticsearch on the master branch, run gradle idea and then just import the elasticsearch.ipr project (on osx just run open elasticsearch.ipr.

See https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md

--Alex

What should the configuration be to run elastic search ?

I used the following configuration:

main class: org.elasticsearch.bootstrap.Elasticsearch

Vm options:

-Xms256m
-Xmx1g
-Xss256k
-Djava.awt.headless=true
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=logs/heapdump.hprof
-Delasticsearch
-Des.foreground=yes
-Djava.library.path=lib/sigar
-ea
-Des.config=C:\Users\aditya.raghav\Documents\elasticsearch-master\core\src\test\resources\config\elasticsearch.yaml>/elasticsearch.yml
-Des.logger.level=DEBUG

working directory: ES directory

environment variable: ES_TEST_LOCAL=true

use classpath of module: core

and when i try to run i get the following error:

Exception in thread "main" java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)

Hey,

not sure what is wrong here, did you import the project differently (trying to import via IDEA's import functionality instead of using gradle idea and opening the project file? If you just want to debug something, you could take a look at the integration test cases, and extend from ESIntegTestCase

--Alex

See: https://www.elastic.co/blog/how-to-debug-elasticsearch-source-code-in-intellij-idea