Windows 部署 Elasticsearch + kibana 8.0 指南

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

一、Windows 单节点集群部署

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

9a3f892b430a21e38a961f07d754ba52.png

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 配置

b25714e1ad30f9dbd1fcff1eca735ab5.png

295691f8c4bf6c80fa21f3a90c25dc08.png

3c868005489cbb0c516bbb556a211d9c.png

e789e2d1efac78ac5700b70cf6db941d.png

49ef9de33e7c3b087aafb790a934e558.png

2bef659af8b9b2300527f38d1da8e8fb.png

二、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 云服务器在无图形化桌面浏览器的情况下无法通过浏览器实现。

724e71f3dc030d427797b6ced5b68cf2.png

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

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

发文时间:2022-02-17

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论
要安装和部署ElasticsearchKibana,你可以按照以下步骤进行操作: 1. 首先,你需要从Elasticsearch官网下载Elasticsearch的安装包。你可以使用以下命令来下载最新版本的Elasticsearch安装包: ``` wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz ``` 2. 下载完成后,解压缩安装包。你可以使用以下命令来解压缩文件: ``` tar -xzf elasticsearch-6.7.0.tar.gz ``` 3. 进入解压缩后的目录: ``` cd elasticsearch-6.7.0 ``` 4. 接下来,你需要修改Elasticsearch的配置文件。你可以使用任何文本编辑器打开`config/elasticsearch.yml`文件,并进行必要的配置更改。例如,你可以修改绑定的IP地址、端口号等。 5. 完成配置后,你可以启动Elasticsearch。使用以下命令启动Elasticsearch: ``` ./bin/elasticsearch ``` 6. 启动后,你可以访问`http://localhost:9200`来验证Elasticsearch是否成功启动。你应该能够看到Elasticsearch的信息。 7. 现在,你可以继续安装和部署Kibana。从Kibana官网下载Kibana的安装包。你可以使用以下命令来下载最新版本的Kibana安装包: ``` wget https://artifacts.elastic.co/downloads/kibana/kibana-6.7.0-linux-x86_64.tar.gz ``` 8. 下载完成后,解压缩Kibana的安装包。你可以使用以下命令来解压缩文件: ``` tar -xzf kibana-6.7.0-linux-x86_64.tar.gz ``` 9. 进入解压缩后的目录: ``` cd kibana-6.7.0-linux-x86_64 ``` 10. 接下来,你需要修改Kibana的配置文件。你可以使用任何文本编辑器打开`config/kibana.yml`文件,并进行必要的配置更改。例如,你可以修改Elasticsearch的连接地址、端口号等。 11. 完成配置后,你可以启动Kibana。使用以下命令启动Kibana: ``` ./bin/kibana ``` 12. 启动后,你可以访问`http://localhost:5601`来访问Kibana的Web界面。在Kibana中,你可以进行数据可视化和分析等操作。 通过按照以上步骤,你可以成功安装和部署ElasticsearchKibana。记得根据你的具体需求进行配置和调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铭毅天下

和你一起,死磕Elastic!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值