如何在IntelliJ IDEA中设置和运行/调试ElasticSearch [英] How can I setup and run/debug ElasticSearch in IntelliJ IDEA

查看:646
本文介绍了如何在IntelliJ IDEA中设置和运行/调试ElasticSearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习ES的工作原理,但是我无法从IDE中运行它.我想运行2.3.3构建,该构建仍将Maven用作其构建系统,但会不断出错.在我详细下载存储库后,有人可以告诉我如何在IDEA中执行此操作.配置等.

I am trying to learn how ES works however I haven't been able to run it from an IDE. I want to run the 2.3.3 build which still uses Maven as its build system but keep getting errors. Can someone tell me how I can do this in IDEA after I download the repository in detail ie. the configuration etc.

我从github下载了存储库,然后将项目导入了intellij 并使用了以下配置:

I downloaded the repository from github, then I imported the project into intellij and used the following configurations:

主类:org.elasticsearch.bootstrap.Elasticsearch

Main class: org.elasticsearch.bootstrap.Elasticsearch

Vm选项:

-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:\elasticsearch-2.3.3\core\src\test\resources\config\elasticsearch.yaml>/elasticsearch.yml
-Des.logger.level=DEBUG
-Des.path.home=C:\elasticsearch-2.3.3

工作目录:ES目录

环境变量:ES_TEST_LOCAL = true

environment variable: ES_TEST_LOCAL=true

使用模块的类路径:elasticsearch(1)(org.elasticsearch)

use classpath of module: elasticsearch(1)(org.elasticsearch)

然后尝试运行时出现以下错误:

and then I get the following errors when i try to run:

错误

推荐答案

先决条件:

  1. 构建根项目:mvn清洁包-DskipTests(或执行run.sh)
  2. 将./distribution/src/main/resources/config复制到./core/.

创建运行/调试配置,如下所示:

Create a Run/Debug configuration as follows:

Main Class: org.elasticsearch.bootstrap.Elasticsearch   
VM Options: -Des.path.home=/code/elasticsearch/core   
Program Arguments: start   
Classpath of Module : [select the core project]   

这篇关于如何在IntelliJ IDEA中设置和运行/调试ElasticSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆