Windows10跑开源分布式搜索和分析引擎Elasticsearch源代码详细教程

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介: Windows10跑开源分布式搜索和分析引擎Elasticsearch源代码详细教程

一、软件环境


  • 操作系统

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环境,三者都有。

1666148175265.jpg

其中环境变量中的PATH里添加了JDK8的bin目录,如下图所示。

1666148190876.jpg


  • 项目构建工具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配置的详细信息为:

1666148240783.jpg

2.设置Gradle的国内源:

在gradle安装目录下的init.d文件夹中添加init.gradle文件。

1666148255602.jpg

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方式下载到本地或者直接下载压缩包然后解压到本地即可。源代码文件目录如下图所示。

1666148324856.jpg

使用IDEA直接打开项目的根目录即可。


四、构建项目


构建完成后的项目目录如下图所示。

1666148342077.jpg

所有的包依赖也下载了Gradle安装目录中的caches文件夹中,如下图所示。

1666148354797.jpg


五、跑源码详细步骤


1. 跑源码前的准备


在源码根目录下新建文件夹eshome,将发行版中的config和modules文件夹复制过来。

1666148382630.jpg


2. 找到程序主文件Elasticsearch


文件路径为:

elasticsearch-7.12.1\server\src\main\java\org\elasticsearch\bootstrap\Elasticsearch.java

1666148424016.jpg


3. 点击运行按钮

1666148437249.jpg


这一步会报错


4. 编辑运行参数


点击工具栏中执行文本框中的下拉菜单,点击Edit Configurations...按钮。

1666148457659.jpg

弹出的运行配置界面如下图所示。

1666148468022.jpg


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. 根据提示修改安全文件


1666148855937.jpg

将提示的三处地方进行注释接即可。


7. 运行


修改好参数后,点击Apply按钮,接着点击运行按钮。运行成功后的控制台输出如图所示。

1666148881600.jpg

输出的详细日志为

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/,就会显示出如下所示的响应结果。

1666148994849.jpg


六、建议看看另一个搜索和分析引擎工具Splunk软件


参见强烈推荐大数据软件Splunk,用于分析日志文件。能够像谷歌搜索一样使用。


相关实践学习
使用阿里云Elasticsearch体验信息检索加速
通过创建登录阿里云Elasticsearch集群,使用DataWorks将MySQL数据同步至Elasticsearch,体验多条件检索效果,简单展示数据同步和信息检索加速的过程和操作。
ElasticSearch 入门精讲
ElasticSearch是一个开源的、基于Lucene的、分布式、高扩展、高实时的搜索与数据分析引擎。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr(也是基于Lucene)。 ElasticSearch的实现原理主要分为以下几个步骤: 用户将数据提交到Elastic Search 数据库中 通过分词控制器去将对应的语句分词,将其权重和分词结果一并存入数据 当用户搜索数据时候,再根据权重将结果排名、打分 将返回结果呈现给用户 Elasticsearch可以用于搜索各种文档。它提供可扩展的搜索,具有接近实时的搜索,并支持多租户。
相关文章
|
12天前
|
存储 缓存 固态存储
Elasticsearch高性能搜索
【11月更文挑战第1天】
30 6
|
10天前
|
API 索引
Elasticsearch实时搜索
【11月更文挑战第2天】
25 1
|
10天前
|
存储 索引
Elasticsearch分布式架构
【11月更文挑战第2天】
19 1
|
17天前
|
存储 监控 安全
|
16天前
|
存储 数据采集 监控
开源日志分析Elasticsearch
【10月更文挑战第22天】
44 5
|
1月前
|
人工智能
云端问道12期-构建基于Elasticsearch的企业级AI搜索应用陪跑班获奖名单公布啦!
云端问道12期-构建基于Elasticsearch的企业级AI搜索应用陪跑班获奖名单公布啦!
172 2
|
1月前
|
Web App开发 JavaScript Java
elasticsearch学习五:springboot整合 rest 操作elasticsearch的 实际案例操作,编写搜索的前后端,爬取京东数据到elasticsearch中。
这篇文章是关于如何使用Spring Boot整合Elasticsearch,并通过REST客户端操作Elasticsearch,实现一个简单的搜索前后端,以及如何爬取京东数据到Elasticsearch的案例教程。
174 0
elasticsearch学习五:springboot整合 rest 操作elasticsearch的 实际案例操作,编写搜索的前后端,爬取京东数据到elasticsearch中。
|
1月前
|
SQL NoSQL MongoDB
一款基于分布式文件存储的数据库MongoDB的介绍及基本使用教程
一款基于分布式文件存储的数据库MongoDB的介绍及基本使用教程
41 0
|
搜索推荐 索引 Windows
|
6天前
|
监控 安全 网络安全
Windows Server管理:配置与管理技巧
Windows Server管理:配置与管理技巧
26 3