Windows 部署 Elasticsearch + kibana 8.0 指南

简介: Windows 部署 Elasticsearch + kibana 8.0 指南

以下内容图示为主,主要探讨和早期版本的不同,给大家升级 8.0 或者更高版本铺路。

一、Windows 单节点集群部署

1、步骤1:下载并解压 elasticsearch、kibana 安装包。

2、步骤2:启动 elasticsearch。

注意!!!!!

不要修改任何配置,一会我会讲为什么。

启动 elasticsearch 后,记录命令行提示的信息。如下:

-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.
 
->  Password for the elastic user (reset with bin/elasticsearch-reset-password -u elastic):
  E28HdAOZEdumJU7A9wL7
 
->  HTTP CA certificate SHA-256 fingerprint:
  264b58e0f92f1e7492cc4cd407aac886012b026af6a20d777a05cd0ddccb43b4
 
->  Configure Kibana to use this cluster:
* Run Kibana and click the configuration link in the terminal when Kibana starts.
* Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyIxNzIuMjAuNi4yMjU6OTIwMCIsIjE5Mi4xNjguMTAxLjU6OTIwMCJdLCJmZ3IiOiIyNjRiNThlMGY5MmYxZTc0OTJjYzRjZDQwN2FhYzg4NjAxMmIwMjZhZjZhMjBkNzc3YTA1Y2QwZGRjY2I0M2I0Iiwia2V5IjoiWUdxX0IzOEI3enY2MVdWT2pDeUI6ak1zZ3o3a1FUSE9pMHd1aHFfUjNvZyJ9
 
->  Configure other nodes to join this cluster:
* On this node:
  - Create an enrollment token with bin/elasticsearch-create-enrollment-token -s node.
  - Uncomment the transport.host setting at the end of config/elasticsearch.yml.
  - Restart Elasticsearch.
* On other nodes:
  - Start Elasticsearch with bin/elasticsearch --enrollment-token <token>, using the enrollment token that you generated.

步骤3、启动 Kibana

注意下面的提示信息,提示我们浏览器访问,并完成配置。

i Kibana has not been configured.
 
Go to http://localhost:5601/?code=368039 to get started.

4、步骤4:完成 Kibana 配置

二、8.X 的安装配置简化体现在哪里?

铭毅的观察:

  • 节点无需任何安全配置,即可实现 TLS 加密通信、Https 加密通信。
  • TLS 应用于 节点间的通信。
  • Https 应用于 Http访问,例如:浏览器访问 elasticsearch。

在第一次启动之后,elasticsearch 下的elasticsearch.yml 文件自动新增配置如下:

Enable security features
xpack.security.enabled: true
 
xpack.security.enrollment.enabled: true
 
Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
 
Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
Create a new cluster with the current node only
Additional nodes can still join the cluster later
cluster.initialmasternodes: ["DESKTOP-TKQF337"]
 
Allow HTTP API connections from localhost and local networks
Connections are encrypted and require user authentication
http.host: [local, site]
 
Allow other nodes to join the cluster from localhost and local networks
Connections are encrypted and mutually authenticated
#transport.host: [local, site]
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

而 Kibana 下的配置在浏览器配置完毕后,自动新增配置如下

# This section was automatically generated during setup.
elasticsearch.hosts: ['https://172.20.6.225:9200']
elasticsearch.serviceAccountToken: AAEAAWVsYXN0aWMva2liYW5hL2Vucm9sbC1wcm9jZXNzLXRva2VuLTE2NDUxMDI3NzQyOTg6VWszUEc1YUtTMkdXT1lxMkNaUVdXdw
elasticsearch.ssl.certificateAuthorities: ['D:\2.es_install\kibana-8.0.0-windows-x86_64\kibana-8.0.0\data\ca_1645102775117.crt']
xpack.fleet.outputs: [{id: fleet-default-output, name: default, is_default: true, is_default_monitoring: true, type: elasticsearch, hosts: ['https://172.20.6.225:9200'], ca_trusted_fingerprint: 264b58e0f92f1e7492cc4cd407aac886012b026af6a20d777a05cd0ddccb43b4}]

三、更新了哪些认知?

这和早期版本使用不太一样的。

我习惯配置成本地 ip 地址,然后再访问的,包括云服务的我也是先改配置再访问。

  • 优点:这种自动化的方式,单节点本机无需配置即可启动,非常方便。
  • 缺点:对于云服务器方式,这种方式是不凑效的,为啥?

关于云服务器的不生效,本质原因,看官方文档:

https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-stack-security.html

When Elasticsearch starts for the first time, the security auto-configuration process binds the HTTP layer to both _site_ and _local_, but only binds the transport layer to _local_. This intended behavior ensures that you can start a single-node cluster with security enabled by default without any additional configuration.

什么是_site_?

  • site

Any site-local addresses on the system, for example 192.168.0.1.

什么是_local_?

  • local

Any loopback addresses on the system, for example 127.0.0.1.

目前看 linux 云服务器在无图形化桌面浏览器的情况下无法通过浏览器实现。

那么云服务器的 Elasticsearch 怎么搞起来?且听下回分解。

下一篇:云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南


相关实践学习
以电商场景为例搭建AI语义搜索应用
本实验旨在通过阿里云Elasticsearch结合阿里云搜索开发工作台AI模型服务,构建一个高效、精准的语义搜索系统,模拟电商场景,深入理解AI搜索技术原理并掌握其实现过程。
ElasticSearch 最新快速入门教程
本课程由千锋教育提供。全文搜索的需求非常大。而开源的解决办法Elasricsearch(Elastic)就是一个非常好的工具。目前是全文搜索引擎的首选。本系列教程由浅入深讲解了在CentOS7系统下如何搭建ElasticSearch,如何使用Kibana实现各种方式的搜索并详细分析了搜索的原理,最后讲解了在Java应用中如何集成ElasticSearch并实现搜索。 &nbsp;
相关文章
|
存储 数据安全/隐私保护 Windows
Windows中部署网盘神器 Filebrowser
ZeroNews (零讯)内网穿透赋予 FileBrowser 任意位置互联网访问的能力,无需用户具备固定公网IP,提供专用的访问域名,将 FileBrowser 转变为公有云盘,实现多用户在线协同工作。
|
JSON 安全 数据可视化
Elasticsearch(es)在Windows系统上的安装与部署(含Kibana)
Kibana 是 Elastic Stack(原 ELK Stack)中的核心数据可视化工具,主要与 Elasticsearch 配合使用,提供强大的数据探索、分析和展示功能。elasticsearch安装在windows上一般是zip文件,解压到对应目录。文件,elasticsearch8.x以上版本是自动开启安全认证的。kibana安装在windows上一般是zip文件,解压到对应目录。elasticsearch的默认端口是9200,访问。默认用户是elastic,密码需要重置。
7082 0
|
Linux 虚拟化 Docker
Linux服务器部署docker windows
在当今软件开发中,Docker成为流行的虚拟化技术,支持在Linux服务器上运行Windows容器。流程包括:1) 安装Docker;2) 配置支持Windows容器;3) 获取Windows镜像;4) 运行Windows容器;5) 验证容器状态。通过这些步骤,你可以在Linux环境中顺利部署和管理Windows应用,提高开发和运维效率。
2950 1
|
Ubuntu 网络协议 Linux
快速部署WSL(Windows Subsystem for Linux)
WSL提供了一种轻量级的方法,使开发者能够在Windows上无缝运行Linux环境。通过本文介绍的步骤,可以快速安装、配置和使用WSL,以满足开发和测试的需求。
3667 8
|
Windows
企业部署Windows 8 Store 风格应用
原文:企业部署Windows 8 Store 风格应用 引言 之前我们都知道可以将应用程序发布到Windows 商店中供用户下载使用。如果我们是企业开发人员,则我们的应用可能属于以下两种类别之一: 1.应用内容是只与公司内个人切实相关的应用。
1216 0
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
3298 2
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
1351 0
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
|
运维 安全 网络安全
Windows Server 2019拨号“找不到设备”?Error 1058解决指南
Windows Server 2019拨号报错1058?别急!这不是硬件故障,而是关键服务被禁用。通过“服务依存关系”排查,依次启动“安全套接字隧道协议”“远程接入连接管理”和“路由与远程访问”服务,仅需4步即可恢复PPPoE或VPN拨号功能,轻松解决网络中断问题。
983 1