需要nodejs和git的支持
brew install node
查看是否安装成功 node -v
➜ ~ node -v
v6.9.2
➜ ~
看到版本,说明安装成功
➜ ~ git --version
git version 2.9.3 (Apple Git-75)
➜ ~
本机已经有git
- 下载head插件 打开 https://github.com/mobz/elasticsearch-head
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
配置elasticsearch,允许head插件访问
进入配置文件修改head权限
cd /usr/local/etc/elasticsearch/
vim elasticsearch.yml
添加,保存
http.cors.enabled: true # elasticsearch中启用CORS
http.cors.allow-origin: "*" # 允许访问的IP地址段,* 为所有IP都
需要重新启动elasticsearch,
进入elasticsearch-head目录,一定要进入这个目录才能执行npm run start命令,实际上是找目录下的package.json文件。
重新执行npm run start。否则会出现跨域问题。授权后要重启ES和head插件