ES源码可以直接从svn下载
https://github.com/elasticsearch/elasticsearch
下载后,用Maven导入(import——》Existing Maven Projects)
待Maven下载完响应的jar包即可。
如图:
--------------------------------
运行方式一:
bin/elasticsearch.bat 启动
修改elasticsearch.bat中的参数:
set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/${project.build.finalName}.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
改为:
set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/target/classes;%ES_HOME%/target/lib/*;%ES_HOME%/target/lib/sigar/*
运行方式二:
直接找到org.elasticsearch.bootstrap.Elasticsearch,进行启动。(可debug调试)
-------------------------------------
1)插件无法安装的问题!
在plugin.bat脚本中修改如下:
set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/target/classes;%ES_HOME%/target/lib/*;%ES_HOME%/target/lib/sigar/*
"%JAVA_HOME%\bin\java" %JAVA_OPTS% -Xmx64m -Xms16m -Des.path.home="%ES_HOME%" -cp "%ES_CLASSPATH%" "org.elasticsearch.plugins.PluginManager" %*
plugin安装:
bin>plugin.bat --install mobz/elasticsearch-head