一、软件环境
- 操作系统
Windows10
- 软件开发IDE
IDEA 2020.3.2
- Elasticsearch
{ "name" : "", "cluster_name" : "elasticsearch", "cluster_uuid" : "g3XhWHTmR-KelMCIPcq9Rw", "version" : { "number" : "7.12.1", "build_flavor" : "unknown", "build_type" : "unknown", "build_hash" : "unknown", "build_date" : "unknown", "build_snapshot" : true, "lucene_version" : "8.8.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }
- JDK
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
这是另外下载的JDK,因为在构建过程中发现JDK8和JDK11都会报错。
这是我的笔记本里下载JDK环境,三者都有。
其中环境变量中的PATH里添加了JDK8的bin目录,如下图所示。
- 项目构建工具Gradle
从Elasticsearch5.0开始,构建工具由Maven改为Gradle。
------------------------------------------------------------ Gradle 7.0 ------------------------------------------------------------ Build time: 2021-04-09 22:27:31 UTC Revision: d5661e3f0e07a8caff705f1badf79fb5df8022c4 Kotlin: 1.4.31 Groovy: 3.0.7 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 1.8.0_201 (Oracle Corporation 25.201-b09) OS: Windows 10 10.0 amd64
操作系统的环境变量设置JDK版本为1.8,因此这里显示的JVM版本是1.8,但是在后面的构建过程中,在IDEA中会进行配置选择ES项目自定义的JDK,如上为1.15。
1.Gradle配置的详细信息为:
2.设置Gradle的国内源:
在gradle安装目录下的init.d
文件夹中添加init.gradle
文件。
init.gradle
文件中添加如下代码:
allprojects{ repositories { def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public' def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/nexus/content/repositories/jcenter' def GRADLE_LOCAL_RELEASE_URL = 'https://repo.gradle.org/gradle/libs-releases-local' def ALIYUN_SPRING_RELEASE_URL = 'https://maven.aliyun.com/repository/spring-plugin' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL." remove repo } if (url.startsWith('http://repo.spring.io/plugins-release')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_SPRING_RELEASE_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL } maven { url ALIYUN_JCENTER_URL } maven { url ALIYUN_SPRING_RELEASE_URL } maven { url GRADLE_LOCAL_RELEASE_URL } } }
二、构建成功后的输出
======================================= Elasticsearch Build Hamster says Hello! Gradle Version : 7.0 OS Info : Windows 10 10.0 (amd64) JDK Version : 15 (Oracle) JAVA_HOME : D:\jdk-15.0.2 Random Testing Seed : 5882B1EC97E88DA1 In FIPS 140 mode : false ======================================= BUILD SUCCESSFUL in 1m 27s BUILD SUCCESSFUL in 2s
可以看到此时的JDK版本为1.15。
三、导入ES项目代码
Git方式下载到本地或者直接下载压缩包然后解压到本地即可。源代码文件目录如下图所示。
使用IDEA直接打开项目的根目录即可。
四、构建项目
构建完成后的项目目录如下图所示。
所有的包依赖也下载了Gradle安装目录中的caches文件夹中,如下图所示。
五、跑源码详细步骤
1. 跑源码前的准备
在源码根目录下新建文件夹eshome,将发行版中的config和modules文件夹复制过来。
2. 找到程序主文件Elasticsearch
文件路径为:
elasticsearch-7.12.1\server\src\main\java\org\elasticsearch\bootstrap\Elasticsearch.java
3. 点击运行按钮
这一步会报错
4. 编辑运行参数
点击工具栏中执行文本框中的下拉菜单,点击Edit Configurations...按钮。
弹出的运行配置界面如下图所示。
5. 修改运行参数
点击配置界面右上角的修改参数下拉菜单按钮。选择Add VM options。
在新增的虚拟机参数输入框中新增下述代码。
-Des.path.home=F:\respository\elasticsearch-7.12.1\eshome -Des.path.conf=F:\respository\elasticsearch-7.12.1\eshome\config -Xms1g -Xmx1g -Dlog4j2.disable.jmx=true -Djava.security.policy=F:\respository\elasticsearch-7.12.1\eshome\config\elasticsearch.policy
6. 根据提示修改安全文件
将提示的三处地方进行注释接即可。
7. 运行
修改好参数后,点击Apply按钮,接着点击运行按钮。运行成功后的控制台输出如图所示。
输出的详细日志为
D:\jdk-15.0.2\bin\java.exe -Des.path.home=F:\respository\elasticsearch-7.12.1\eshome -Des.path.conf=F:\respository\elasticsearch-7.12.1\eshome\config -Xms1g -Xmx1g -Dlog4j2.disable.jmx=true -Djava.security.policy=F:\respository\elasticsearch-7.12.1\eshome\config\elasticsearch.policy "-javaagent:D:\IntelliJ IDEA 2020.3.2\lib\idea_rt.jar=60827:D:\IntelliJ IDEA 2020.3.2\bin" -Dfile.encoding=UTF-8 -classpath F:\respository\elasticsearch-7.12.1\server\out\production\classes;F:\respository\elasticsearch-7.12.1\server\out\production\resources;F:\respository\elasticsearch-7.12.1\libs\x-content\out\production\classes;F:\respository\elasticsearch-7.12.1\libs\cli\out\production\classes;F:\respository\elasticsearch-7.12.1\libs\core\out\production\classes;F:\respository\elasticsearch-7.12.1\libs\secure-sm\out\production\classes;F:\respository\elasticsearch-7.12.1\libs\geo\out\production\classes;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-core\8.8.0\8e2212079fb5210de2d2bc4659c45d77b8a7621d\lucene-core-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-analyzers-common\8.8.0\e84afab753aba3872aba55a370926a9373942d0d\lucene-analyzers-common-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-backward-codecs\8.8.0\e13efc816c2677250f8a18da90bf1a3cb90e02a9\lucene-backward-codecs-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-grouping\8.8.0\38d560849363acb4f033ed967a0656cdcd75b776\lucene-grouping-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-highlighter\8.8.0\c4d1dca0147ff8ee64ee30c1824af04507c45131\lucene-highlighter-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-join\8.8.0\de35b7480e9d72fb677daf32fa7ac90ce192e738\lucene-join-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-memory\8.8.0\5523f18aefae46a37a928704c4d8bf5b6af108f3\lucene-memory-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-misc\8.8.0\2c0393fcc76c3738257fc223dd23a6565d506886\lucene-misc-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-queries\8.8.0\7ff67de8424a44ad47fb5b2688b025675ab36f9d\lucene-queries-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-queryparser\8.8.0\12c1fff58ee07ba310d8aad03a687e190487ea60\lucene-queryparser-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-sandbox\8.8.0\a75aefdd97af9590e04e8b2c82be04e37ad82162\lucene-sandbox-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-spatial-extras\8.8.0\d830e093a2e6b308a7bf7069e8d4b09cbf43963f\lucene-spatial-extras-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-spatial3d\8.8.0\4be2a3457e6113ef59606a24dc2cc210c67075e\lucene-spatial3d-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.lucene\lucene-suggest\8.8.0\2d5dcdad7e8b8284ddc0bad400e5633c12479e93\lucene-suggest-8.8.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.carrotsearch\hppc\0.8.1\ffc7ba8f289428b9508ab484b8001dea944ae603\hppc-0.8.1.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\joda-time\joda-time\2.10.4\8c10bb8815109067ce3c91a8e547b5a52e8a1c1a\joda-time-2.10.4.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.tdunning\t-digest\3.2\2ab94758b0276a8a26102adf8d528cf6d0567b9a\t-digest-3.2.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.hdrhistogram\HdrHistogram\2.1.9\e4631ce165eb400edecfa32e03d3f1be53dee754\HdrHistogram-2.1.9.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.locationtech.spatial4j\spatial4j\0.7\faa8ba85d503da4ab872d17ba8c00da0098ab2f2\spatial4j-0.7.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.locationtech.jts\jts-core\1.15.0\705981b7e25d05a76a3654e597dab6ba423eb79e\jts-core-1.15.0.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.11.1\268f0fe4df3eefe052b57c87ec48517d64fb2a10\log4j-api-2.11.1.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-core\2.11.1\592a48674c926b01a9a747c7831bcd82a9e6d6e4\log4j-core-2.11.1.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.elasticsearch\jna\5.7.0-1\8ffc051522e63292eaf757d89353c14e94233988\jna-5.7.0-1.jar;F:\respository\elasticsearch-7.12.1\libs\plugin-classloader\out\production\classes;D:\gradle-6.8.2\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.26\a78a8747147d2c5807683e76ec2b633e95c14fe9\snakeyaml-1.26.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.10.4\8796585e716440d6dd5128b30359932a9eb74d0d\jackson-core-2.10.4.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.fasterxml.jackson.dataformat\jackson-dataformat-smile\2.10.4\c872c2e224cfdcc5481037d477f5890f05c001b4\jackson-dataformat-smile-2.10.4.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.fasterxml.jackson.dataformat\jackson-dataformat-yaml\2.10.4\8a7f3c6b640bd89214807af6d8160b4b3b16af93\jackson-dataformat-yaml-2.10.4.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\com.fasterxml.jackson.dataformat\jackson-dataformat-cbor\2.10.4\c854bb2d46138198cb5d4aae86ef6c04b8bc1e70\jackson-dataformat-cbor-2.10.4.jar;D:\gradle-6.8.2\caches\modules-2\files-2.1\net.sf.jopt-simple\jopt-simple\5.0.2\98cafc6081d5632b61be2c9e60650b64ddbc637c\jopt-simple-5.0.2.jar org.elasticsearch.bootstrap.Elasticsearch [2021-05-11T10:33:12,072][INFO ][o.e.n.Node ] [] version[7.12.1], pid[5952], build[unknown/unknown/unknown/unknown], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/15.0.2/15.0.2+7-27] [2021-05-11T10:33:12,080][INFO ][o.e.n.Node ] [] JVM home [D:\jdk-15.0.2] [2021-05-11T10:33:12,087][INFO ][o.e.n.Node ] [] JVM arguments [-Des.path.home=F:\respository\elasticsearch-7.12.1\eshome, -Des.path.conf=F:\respository\elasticsearch-7.12.1\eshome\config, -Xms1g, -Xmx1g, -Dlog4j2.disable.jmx=true, -Djava.security.policy=F:\respository\elasticsearch-7.12.1\eshome\config\elasticsearch.policy, -javaagent:D:\IntelliJ IDEA 2020.3.2\lib\idea_rt.jar=60827:D:\IntelliJ IDEA 2020.3.2\bin, -Dfile.encoding=UTF-8] [2021-05-11T10:33:34,805][INFO ][o.e.p.PluginsService ] [] loaded module [aggs-matrix-stats] [2021-05-11T10:33:34,805][INFO ][o.e.p.PluginsService ] [] loaded module [analysis-common] [2021-05-11T10:33:34,805][INFO ][o.e.p.PluginsService ] [] loaded module [constant-keyword] [2021-05-11T10:33:34,805][INFO ][o.e.p.PluginsService ] [] loaded module [flattened] [2021-05-11T10:33:34,806][INFO ][o.e.p.PluginsService ] [] loaded module [frozen-indices] [2021-05-11T10:33:34,806][INFO ][o.e.p.PluginsService ] [] loaded module [ingest-common] [2021-05-11T10:33:34,806][INFO ][o.e.p.PluginsService ] [] loaded module [ingest-geoip] [2021-05-11T10:33:34,806][INFO ][o.e.p.PluginsService ] [] loaded module [ingest-user-agent] [2021-05-11T10:33:34,806][INFO ][o.e.p.PluginsService ] [] loaded module [kibana] [2021-05-11T10:33:34,807][INFO ][o.e.p.PluginsService ] [] loaded module [lang-expression] [2021-05-11T10:33:34,807][INFO ][o.e.p.PluginsService ] [] loaded module [lang-mustache] [2021-05-11T10:33:34,807][INFO ][o.e.p.PluginsService ] [] loaded module [lang-painless] [2021-05-11T10:33:34,808][INFO ][o.e.p.PluginsService ] [] loaded module [mapper-extras] [2021-05-11T10:33:34,808][INFO ][o.e.p.PluginsService ] [] loaded module [mapper-version] [2021-05-11T10:33:34,808][INFO ][o.e.p.PluginsService ] [] loaded module [parent-join] [2021-05-11T10:33:34,808][INFO ][o.e.p.PluginsService ] [] loaded module [percolator] [2021-05-11T10:33:34,808][INFO ][o.e.p.PluginsService ] [] loaded module [rank-eval] [2021-05-11T10:33:34,809][INFO ][o.e.p.PluginsService ] [] loaded module [reindex] [2021-05-11T10:33:34,809][INFO ][o.e.p.PluginsService ] [] loaded module [repositories-metering-api] [2021-05-11T10:33:34,809][INFO ][o.e.p.PluginsService ] [] loaded module [repository-encrypted] [2021-05-11T10:33:34,809][INFO ][o.e.p.PluginsService ] [] loaded module [repository-url] [2021-05-11T10:33:34,810][INFO ][o.e.p.PluginsService ] [] loaded module [search-business-rules] [2021-05-11T10:33:34,810][INFO ][o.e.p.PluginsService ] [] loaded module [searchable-snapshots] [2021-05-11T10:33:34,810][INFO ][o.e.p.PluginsService ] [] loaded module [snapshot-repo-test-kit] [2021-05-11T10:33:34,810][INFO ][o.e.p.PluginsService ] [] loaded module [spatial] [2021-05-11T10:33:34,811][INFO ][o.e.p.PluginsService ] [] loaded module [transform] [2021-05-11T10:33:34,811][INFO ][o.e.p.PluginsService ] [] loaded module [transport-netty4] [2021-05-11T10:33:34,811][INFO ][o.e.p.PluginsService ] [] loaded module [unsigned-long] [2021-05-11T10:33:34,811][INFO ][o.e.p.PluginsService ] [] loaded module [vectors] [2021-05-11T10:33:34,811][INFO ][o.e.p.PluginsService ] [] loaded module [wildcard] [2021-05-11T10:33:34,812][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-aggregate-metric] [2021-05-11T10:33:34,812][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-analytics] [2021-05-11T10:33:34,812][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-async] [2021-05-11T10:33:34,812][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-async-search] [2021-05-11T10:33:34,812][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-autoscaling] [2021-05-11T10:33:34,813][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-ccr] [2021-05-11T10:33:34,813][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-core] [2021-05-11T10:33:34,813][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-data-streams] [2021-05-11T10:33:34,813][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-deprecation] [2021-05-11T10:33:34,813][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-enrich] [2021-05-11T10:33:34,814][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-eql] [2021-05-11T10:33:34,814][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-fleet] [2021-05-11T10:33:34,814][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-graph] [2021-05-11T10:33:34,814][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-identity-provider] [2021-05-11T10:33:34,814][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-ilm] [2021-05-11T10:33:34,815][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-ingest] [2021-05-11T10:33:34,815][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-logstash] [2021-05-11T10:33:34,815][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-ml] [2021-05-11T10:33:34,815][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-monitoring] [2021-05-11T10:33:34,815][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-ql] [2021-05-11T10:33:34,816][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-rollup] [2021-05-11T10:33:34,816][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-runtime-fields] [2021-05-11T10:33:34,816][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-security] [2021-05-11T10:33:34,816][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-sql] [2021-05-11T10:33:34,816][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-stack] [2021-05-11T10:33:34,817][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-text-structure] [2021-05-11T10:33:34,817][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-voting-only-node] [2021-05-11T10:33:34,817][INFO ][o.e.p.PluginsService ] [] loaded module [x-pack-watcher] [2021-05-11T10:33:34,818][INFO ][o.e.p.PluginsService ] [] no plugins loaded [2021-05-11T10:33:35,388][INFO ][o.e.e.NodeEnvironment ] [] using [1] data paths, mounts [[工作 (F:)]], net usable_space [166.9gb], net total_space [172.6gb], types [NTFS] [2021-05-11T10:33:35,389][INFO ][o.e.e.NodeEnvironment ] [] heap size [1gb], compressed ordinary object pointers [true] [2021-05-11T10:33:35,473][INFO ][o.e.n.Node ] [] node name [], node ID [ktiYzgo8SX6bSW1j3nu7Sg], cluster name [elasticsearch], roles [transform, data_frozen, master, remote_cluster_client, data, ml, data_content, data_hot, data_warm, data_cold, ingest] [2021-05-11T10:33:35,675][INFO ][i.n.u.i.PlatformDependent] [] Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability. [2021-05-11T10:33:41,644][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [] [controller/1352] [Main.cc@117] controller (64 bit): Version 7.12.1 (Build 4172997de5701c) Copyright (c) 2021 Elasticsearch BV [2021-05-11T10:33:42,265][INFO ][o.e.x.s.a.s.FileRolesStore] [] parsed [0] roles from file [F:\respository\elasticsearch-7.12.1\eshome\config\roles.yml] [2021-05-11T10:33:45,172][INFO ][i.n.u.i.PlatformDependent] [] Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability. [2021-05-11T10:33:45,216][INFO ][o.e.t.NettyAllocator ] [] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=1gb}] [2021-05-11T10:33:45,308][INFO ][o.e.d.DiscoveryModule ] [] using discovery type [zen] and seed hosts providers [settings] [2021-05-11T10:33:46,079][INFO ][o.e.g.DanglingIndicesState] [] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually [2021-05-11T10:33:46,962][INFO ][o.e.n.Node ] [] initialized [2021-05-11T10:33:46,962][INFO ][o.e.n.Node ] [] starting ... [2021-05-11T10:33:46,982][INFO ][o.e.x.s.c.f.PersistentCache] [] persistent cache index loaded [2021-05-11T10:33:47,276][INFO ][o.e.t.TransportService ] [] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300} [2021-05-11T10:33:47,611][WARN ][o.e.b.BootstrapChecks ] [] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured [2021-05-11T10:33:47,613][INFO ][o.e.c.c.Coordinator ] [] cluster UUID [g3XhWHTmR-KelMCIPcq9Rw] [2021-05-11T10:33:47,625][INFO ][o.e.c.c.ClusterBootstrapService] [] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered [2021-05-11T10:33:47,727][INFO ][o.e.c.s.MasterService ] [] elected-as-master ([1] nodes joined)[{ktiYzgo8SX6bSW1j3nu7Sg}{XQXm5W_DQVeRT31WKSdhPQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=16919429120, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1073741824} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 2, version: 37, delta: master node changed {previous [], current [{ktiYzgo8SX6bSW1j3nu7Sg}{XQXm5W_DQVeRT31WKSdhPQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=16919429120, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1073741824}]} [2021-05-11T10:33:47,903][INFO ][o.e.c.s.ClusterApplierService] [] master node changed {previous [], current [{ktiYzgo8SX6bSW1j3nu7Sg}{XQXm5W_DQVeRT31WKSdhPQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=16919429120, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1073741824}]}, term: 2, version: 37, reason: Publication{term=2, version=37} [2021-05-11T10:33:48,029][INFO ][o.e.h.AbstractHttpServerTransport] [] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200} [2021-05-11T10:33:48,030][INFO ][o.e.n.Node ] [] started [2021-05-11T10:33:48,389][INFO ][o.e.l.LicenseService ] [] license [ae30e2c3-34d9-414f-bab3-07c27ea4c0ab] mode [basic] - valid [2021-05-11T10:33:48,395][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [] Active license is now [BASIC]; Security is disabled [2021-05-11T10:33:48,404][INFO ][o.e.g.GatewayService ] [] recovered [0] indices into cluster_state
8. 在浏览器中输入验证
在浏览器中输入http://127.0.0.1:9200/
,就会显示出如下所示的响应结果。
六、建议看看另一个搜索和分析引擎工具Splunk软件
参见强烈推荐大数据软件Splunk,用于分析日志文件。能够像谷歌搜索一样使用。