内容简介:说明:本文章使用的ES版本是:6.7.0Elastisearch 6.7.0编译需要JDK版本10.0及以上,我直接安装了JDK12.JDK下载地址:
环境准备
说明:本文章使用的ES版本是:6.7.0
JDK
Elastisearch 6.7.0编译需要JDK版本10.0及以上,我直接安装了JDK12.JDK下载地址: https://www.oracle.com/technetwork/java/javase/downloads/index.html
Gradle
brew install gradle
Elastisearch源码
git clone https://github.com/elastic/elasticsearch.git git tag git checkout v6.7.0
使用IDEA DEBUG 源码
将工程Import到IDEA
进入Elastisearch根目录,把源码编译为IDEA工程: ./gradlew idea
选择Elasticsearch目录进入:
选择Gradle导入后,下一步:
选择如上的选项,点击Finish,导入源码到IDEA完成。
本地Debug代码
使用IntelliJ在本地调试ES,有两种方式,一种是直接在IntelliJ上运行ES进行调试,但需要很多繁杂得配置。
配置方法:进入IDEA, Run -> Edit Configurations
其中VM options如下:
其中,elasticsearch.policy如下:
最后,运行org.elasticsearch.bootstrap.Elasticsearch::main(java.lang.String[]) 方法就可以调试了。
远程调试
另一种是远程调试,先用debug模式,在本地启动ES服务: ./gradlew run --debug-jvm
可以看到,debug模式监听的端口是8000
然后在IDE代码中设置断点,点击debug按钮:
同时也可以在浏览器中通过访问: http://127.0.0.1:9200 查看ES状态
http://127.0.0.1:9200/_cat/health?v
下一篇文章将说一下ES的启动过程。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Design Accessible Web Sites
Jeremy Sydik / Pragmatic Bookshelf / 2007-11-05 / USD 34.95
It's not a one-browser web anymore. You need to reach audiences that use cell phones, PDAs, game consoles, or other "alternative" browsers, as well as users with disabilities. Legal requirements for a......一起来看看 《Design Accessible Web Sites》 这本书的介绍吧!