以
win10下安装8.1.0版本为例jdk版本:
openjdk 17D:\> java -version openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
1、ElasticSearch8.1.0 下载与安装
1.1、下载ElasticSearch8.1.0
- 下载地址:ElasticSearch8.1.0


1.2、解压
解压至目标文件夹

1.3、配置
1.3.1、系统环境变量


1.3.2、ES参数
...\elasticsearch-8.1.0\config\elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
# cluster.name: my-application
cluster.name: es-tuwer
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
#修改一下ES的监听地址,这样别的机器也可以访问
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["node-1"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically
# generated to configure Elasticsea
...\elasticsearch-8.1.0\config\jvm.options

经过以上配置后,在初次启动时,遇到了闪退的情况,没有异常信息。后来重启后正常了。

- 正常启动


- 访问测试

1.4 开机自启动
1.4.1 es.vbs
该方式没有成功;可能跟系统安全权限有关;
- 编辑启动脚本文件
es.vbs
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "D:\program\environment\es\elasticsearch-8.1.0\bin\elasticsearch.bat /start",0
- 把文件放在win的启动目录下;需要有管理员权限

1.4.2 elasticsearch-service.bat
该bat脚本文件是官方提供;在cmd下
install即可;简单方便。推荐!!!




2、Head插件安装
ES 的可视化管理界面
elasticsearch-head

2.1、下载


2.2、解压至ES同级目录

2.3、安装依赖
在
cmd命令下进入elasticsearch-head-5.0.0目录,执行cnpm install,前提是系统要有node.js环境


2.4、启动测试
- 启动:
npm run start;在 HEAD 安装目录下进入cmd窗口执行


- 修改ES配置,解决跨域问题
在ES的
elasticsearch.yml中添加如下配置项:
http.cors.enabled: true
http.cors.allow-origin: "*"

- 重启ES测试,一切正常

3、Kibana 安装
官方介绍: Kibana 是一个免费且开放的用户界面,能够让您对 Elasticsearch 数据进行可视化,并让您在 Elastic Stack 中进行导航。您可以进行各种操作,从跟踪查询负载,到理解请求如何流经您的整个应用,都能轻松完成。

3.1、下载
下载对应的版本
8.1.0


3.2、解压至ES同级目录


3.3、启动
默认访问路径:
http://localhost:5601/



3.4、汉化
只需修改
kibana.yml配置即可;官方提供了中文配置文件zh-CN.json
i18n.locale: "zh-CN"

- 汉化文件路径

- 重启测试



本文介绍了在Windows 10上使用openjdk17安装Elasticsearch 8.1.0的步骤,包括下载、解压、环境变量设置、配置文件调整以解决闪退问题,以及Head插件的安装、Kibana的部署和跨域配置。重点讲解了开机自启动、安全性和可视化管理的实现。
&spm=1001.2101.3001.5002&articleId=126864053&d=1&t=3&u=ed089f361c94414c9b53fe7b331a83a4)
1629

被折叠的 条评论
为什么被折叠?



