安装elasticSearch-rtf(Elasticsearch-RTF是针对中文的一个发行版,一般不对应最新版本的elasticsearch):
- 先安装Java环境(JDK8+),网上教程很多
- rtf的github下载地址:https://github.com/medcl/elasticsearch-rtf
- 进入bin目录,dos运行elasticsearch
- 进入http://127.0.0.1:9200/ 查看是否安装成功
安装head插件:
- github下载地址:https://github.com/mobz/elasticsearch-head
- 安装node.js,安装npm,教程:https://blog.youkuaiyun.com/traguezw/article/details/54577560#reply 原博有纰漏,评论有指正:第二个步骤中最后两个文件(npx)也需要放到node_global里面,否则npm 配置失败
- 安装cnpm(淘宝npm镜像),
npm install -g cnpm --registry=https://registry.npm.taobao.org
原址:http://npm.taobao.org/
之后npm的命令可改成cnpm进行加速
或直接设置taobao源:
npm config set registry "http://registry.npm.taobao.org/"
- 启动elasticsearch-head
在elasticsearch-head目录中dos运行
cnpm install
cnpm run start - 进入http://127.0.0.1:9100/查看(显示集群健康值: 未连接,因为elasticsearch默认不使用第三方服务)
- 配置elasticSearch-rtf\config\elasticsearch.yml文件
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"
- 重启elasticsearch,刷新http://127.0.0.1:9100/,显示集群健康值: green (0 of 0)
安装kibana插件:
- 下载地址:http://www.elastic.co/downloads/past-releases 需下载与rtf对应版本
- 解压后进入bin目录,dos运行kibana.bat
- 进入http://127.0.0.1:5601查看是否安装成功
注:服务退出时尽量使用ctrl+c,不要强制关掉cmd窗口,以免下次使用时有bug