安装 :brew install elasticsearch
安装成功后,查看版本信息 : elasticsearch --version
启动 :elasticsearch
默认启动端口9200 本地 http://localhost:9200/
安装node:brew install node
安装es可视化插件
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
cd elasticsearch-head
npm install grunt --save
修改elasticsearch-head下Gruntfile.js文件,默认监听在127.0.0.1下9200端口
修改连接地址
cd elasticsearch-head/_site
vim app.js
this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://localhost:9200”;
启动服务:elasticsearch-head/node_modules/grunt/bin/grunt server
访问:http://localhost:9100/
集群健康值:显示“未连接”
解决方案:
vim /config/elasticsearch.yml
增加如下字段
http.cors.enabled: true
http.cors.allow-origin: “*”
重启es,并刷新head页面,发现已经可以连接上