idea debug elasticsearch8.6.2 源码

前置依赖:

gradle 7.5.1:Gradle | Releases

配置gradle阿里云镜像
1、找到您的 GRADLE_HOME 目录,这通常是您安装Gradle的目录。
2、在 GRADLE_HOME/init.d/ 目录下新建一个文件,命名为 init.gradle。
3、编辑 init.gradle 文件,添加以下内容:
allprojects {
    repositories {
        mavenLocal()
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/jcenter/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
    }
}

openJDK 17:https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe 

idea:IntelliJ IDEA 2022.1 (Ultimate Edition)

1、下载源码 8.6.2 zip包 并解压

地址:Releases · elastic/elasticsearch · GitHub

2、idea打开项目工程,设置gradle和jdk

 4、确定后等待初次构建完成

 5、cmd进入源码目录

 6、运行源码

.\gradlew run

 该版本默认开启了权限,访问localhost:9200需要输入账号密码

禁用安全策略启动

.\gradlew run  -Dtests.es.xpack.security.enabled=false

 7、debug源码

打开idea es代码,配置debug参数,ok后运行

 然后cmd bug模式启动源码

.\gradlew run  -Dtests.es.xpack.security.enabled=false --debug-jvm

在 idea打上断点

class:org.elasticsearch.rest.RestController#dispatchRequest(org.elasticsearch.rest.RestRequest, org.elasticsearch.rest.RestChannel, org.elasticsearch.common.util.concurrent.ThreadContext)

访问 http://localhost:9200/  已经成功进idea断点中

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Here is an example `docker-compose.yml` file to run Elasticsearch 8.6.2 and Kibana 8.6.2 using Docker Compose: ```yaml version: '3' services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2 container_name: elasticsearch environment: - discovery.type=single-node ports: - "9200:9200" volumes: - esdata:/usr/share/elasticsearch/data kibana: image: docker.elastic.co/kibana/kibana:8.6.2 container_name: kibana ports: - "5601:5601" environment: - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 volumes: esdata: ``` In this example, we define two services: `elasticsearch` and `kibana`. The `elasticsearch` service uses the official Elasticsearch 8.6.2 Docker image, sets the `discovery.type` environment variable to `single-node` (to run a single Elasticsearch node), maps port 9200 to the host machine, and creates a volume named `esdata` to persist Elasticsearch data. The `kibana` service uses the official Kibana 8.6.2 Docker image, maps port 5601 to the host machine, and sets the `ELASTICSEARCH_HOSTS` environment variable to the hostname of the `elasticsearch` service (which is `http://elasticsearch:9200`). To run these services, navigate to the directory where the `docker-compose.yml` file is located and run the following command: ```bash docker-compose up -d ``` This will start both services in detached mode (in the background). To stop the services, run the following command: ```bash docker-compose down ``` Note that you may need to adjust the configuration options (such as ports and environment variables) to fit your specific use case.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值