Loading

Windows 10 安装ElasticSearch(2)- MSI安装ElasticSearch和安装Kibana

翻阅上篇文章:Windows 10 安装 ElasticSearch
上次写的是下载Zip包安装的,在下载页面 发现有 MSI (BETA) 的下载可选项。了解之后发现MSI安装也值得尝试。

MSI安装ElasticSearch

参考文章:Install Elasticsearch with Windows MSI Installer
与zip包安装相比,MSI安装可以将ElasticSearch作为Windows 服务安装,这样可以方便设置开机自启动,就不用看到有一个cmd命令行在任务栏,ElasticSearch服务在后台运行。
当然,使用MSI安装的最大便利是,有GUI引导方便安装。
安装完成之后,手动启动ElasticSearch服务,如果按照默认配置安装,验证是否安装成功的地址仍然是http://127.0.0.1:9200/

命令行安装ElasticSearch

官方文档介绍了除GUI安装的方式,使用命令行安装ElasticSearch。

msiexec.exe / i elasticsearch-6.6.1.msi / qn

更多了解如何使用msiexec,出了可以使用msiexec.exe / help 查看,也可以查阅微软官方技术文档:https://docs.microsoft.com/zh-cn/windows/desktop/Msi/command-line-options

卸载ElasticSearch

不能使用MSI进行卸载,卸载的话,只能通过 “添加/删除程序” 进行卸载。

安装Kibana

参考:https://www.elastic.co/guide/cn/kibana/current/windows.html
下载: https://www.elastic.co/downloads/kibana

加载示例数据

参考 :https://www.elastic.co/guide/cn/kibana/current/tutorial-load-dataset.html

下载示例数据之后,有两个地方需要多说两句。
提醒1:

使用以下命令在终端(如 bash )建立一个莎士比亚数据集的映射:

可以打开kibana界面,在Dev Tools的Console下使用PUT创建索引。
或者使用Windows 10 自带Curl命令,进行操作。
如果没有自带curl,可以安装curl,下载页面:https://curl.haxx.se/download.html
curl的使用请自行搜索。

提醒2:官方文档中给出的命令需要做个修正

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

例如上述语句是无法在cmd下执行成功,需要修正,即修改单引号为双引号

curl -H "Content-Type: application/x-ndjson" -XPOST "localhost:9200/bank/account/_bulk?pretty" --data-binary @accounts.json

注意事项

Kibana的版本和Elasticsearch的版本要一致,如果升级了Elasticsearch,相应的也要升级Kibana。

如果不一致会怎样呢?试一下
启动Elasticsearch版本是7.2.0,Kibana版本是6.6.1,启动Kibana,将看到如下error提示
This version of Kibana requires Elasticsearch v6.6.1 on all nodes. I found the following incompatible nodes in your cluster: v7.2.0 @ 127.0.0.1:9200 (127.0.0.1)
访问http://localhost:5601/,页面显示Kibana server is not ready yet

posted @ 2019-03-04 18:35  repeatedly  阅读(1417)  评论(0编辑  收藏  举报