前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Windows 部署 Elasticsearch + kibana 8.0 指南

Windows 部署 Elasticsearch + kibana 8.0 指南

作者头像
铭毅天下
发布2022-04-06 17:52:45
3.1K0
发布2022-04-06 17:52:45
举报
文章被收录于专栏:铭毅天下

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

一、Windows 单节点集群部署

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

2、步骤2:启动 elasticsearch。

注意!!!!!

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

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

代码语言:javascript
复制
-> 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

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

代码语言:javascript
复制
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 文件自动新增配置如下:

代码语言:javascript
复制
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 下的配置在浏览器配置完毕后,自动新增配置如下

代码语言:javascript
复制
# 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

代码语言:javascript
复制
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 指南

发文时间:2022-02-17

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-03-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 铭毅天下Elasticsearch 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、Windows 单节点集群部署
    • 1、步骤1:下载并解压 elasticsearch、kibana 安装包。
      • 2、步骤2:启动 elasticsearch。
        • 步骤3、启动 Kibana
          • 4、步骤4:完成 Kibana 配置
            • 二、8.X 的安装配置简化体现在哪里?
            • 三、更新了哪些认知?
              • 什么是_site_?
                • 什么是_local_?
                相关产品与服务
                云服务器
                云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档