elasticsearch-8.8.1详细安装教程
时间: 2023-11-18 18:35:13 浏览: 172
elasticsearch的详细安装和简单使用
很抱歉,Elasticsearch当前最新版本为7.15.1,没有8.8.1版本。以下是Elasticsearch 7.15.1的详细安装教程:
1. 下载Elasticsearch
在官网 https://www.elastic.co/cn/downloads/elasticsearch 下载Elasticsearch的压缩包,选择适合自己操作系统的版本。下载完成后解压到任意目录。
2. 修改配置文件
进入Elasticsearch的config目录,修改elasticsearch.yml文件。比如:
```
# 设置集群名称
cluster.name: my-cluster
# 设置节点名称
node.name: my-node
# 设置数据存储路径
path.data: /path/to/data
# 设置日志文件路径
path.logs: /path/to/logs
```
3. 启动Elasticsearch
在终端中进入Elasticsearch的bin目录,执行以下命令启动Elasticsearch:
```
./elasticsearch
```
如果一切顺利,你应该能看到类似以下的输出:
```
[2021-10-20T14:12:18,394][INFO ][o.e.n.Node ] [my-node] version[7.15.1], pid[12345], build[default/tar/123abc/2021-10-11T22:34:29.218660Z], OS[Linux/4.14.143-89.123.amzn1.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/16.0.2/16.0.2+7]
[2021-10-20T14:12:18,396][INFO ][o.e.n.Node ] [my-node] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseG1GC, -XX:G1ReservePercent=25, -XX:InitiatingHeapOccupancyPercent=30, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, -Xms512m, -Xmx512m, -Des.path.home=/path/to/elasticsearch-7.15.1, -Des.path.conf=/path/to/elasticsearch-7.15.1/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2021-10-20T14:12:19,999][INFO ][o.e.p.PluginsService ] [my-node] loaded module [aggs-matrix-stats]
[2021-10-20T14:12:19,999][INFO ][o.e.p.PluginsService ] [my-node] loaded module [analysis-common]
[2021-10-20T14:12:19,999][INFO ][o.e.p.PluginsService ] [my-node] loaded module [geo]
[2021-10-20T14:12:19,999][INFO ][o.e.p.PluginsService ] [my-node] loaded module [ingest-common]
...
[2021-10-20T14:12:20,000][INFO ][o.e.p.PluginsService ] [my-node] loaded module [transport-netty4]
[2021-10-20T14:12:20,000][INFO ][o.e.p.PluginsService ] [my-node] no plugins loaded
[2021-10-20T14:12:23,123][INFO ][o.e.x.s.a.s.FileRolesStore] [my-node] parsed [0] roles from file [/path/to/elasticsearch-7.15.1/config/roles.yml]
[2021-10-20T14:12:24,456][INFO ][o.e.i.g.GatewayService ] [my-node] recovered [0] indices into cluster_state
[2021-10-20T14:12:27,521][INFO ][o.e.c.r.a.AllocationService] [my-node] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[my-index][0]]]).
```
这表示Elasticsearch已经成功启动。你可以通过访问`http://localhost:9200`来验证Elasticsearch是否运行正常。
4. 安装插件
Elasticsearch提供了很多插件,可以根据自己的需求进行安装。比如,安装kopf插件:
```
./bin/elasticsearch-plugin install lmenezes/elasticsearch-kopf/2.1.2
```
5. 配置Elasticsearch作为服务
如果你想将Elasticsearch作为服务在后台运行,可以参考官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html。
希望这个安装教程能够帮助到你。
阅读全文