windows系统下elasticsearch的安装配置

  • 安装elasticsearch-rtf(多插件版)

  • head插件和kibana的安装

一、安装elasticsearch-rtf

1、安装Java8,java8以下的版本不适配当前最新版(5.x)的elasticsearch

官网-windows x64

选择Accept License Agreement后可下载

下载完成后一键下一步安装

打开命令行 ,确认是否安装正确

    java -version

设置环境变量JAVA_HOME,elastic依赖此变量

系统变量:

变量名:JAVA_HOME

变量值:JAVA的安装路径C:\Program Files\Java\jdk1.8.0_191

2、安装elasticsearch-rtf

github- elasticsearch-rtf

config\elasticsearch.yml 是配置文件

打开命令行,用命令行的方式运行

cd到当前elasticsearch\bin的路径

elasticsearch.bat

即可运行elastic

网址输入

http://127.0.0.1:9200/

有了输出即代表elasticsearch安装完成

二、head插件和kibana的安装

1、安装head插件

首先安装git for windows

github- elasticsearch-head

访问9100端口,9200未连接

默认情况下elastic不允许通过第三方插件链接端口

修改配置elasticsearch

打开elasticsearch.yml ,输入

http.cors.enabled: true

http.cors.allow-origin: "*"

http.cors.allow-methods: OPTIONS, HEAD, GET, PUT, DELETE

http.cors.allow-headers: "X-Requested-Width, Content-Type, Content-Length, X-User"

其中cors为其安全策略

运行head插件:

cd ..(相关路径)\elasticsearch-head

cnpm run start

open http://127.0.0.1:9100

此时,集群健康值为0,代表我们连接成功

2、安装kibana

下载和elastic-rtf一致的版本

安装完成后用命令行运行bin文件内的

kibana.bat

打开 http://localhost:5601确认是否安装正确

猜你喜欢

转载自blog.csdn.net/weixin_43933037/article/details/85924764