elasticsearch5.2.1安装head步骤
1. 下载elasticsearch-head 下载地址:https://github.com/mobz/elasticsearch-head。
2. 解压 unzip elasticsearch-head-master.zip
3. 安装需要node 如没有需要下载安装 下载地址 https://nodejs.org/dist/v5.10.1/node-v5.10.1-linux-x64.tar.gz
解压node tar -xzvf node-v5.10.1-linux-x64.tar.gz
创建软连接
ln -s /home/node-v5.10.1-linux-x64/bin/node /usr/local/bin/node
ln -s /home/node-v5.10.1-linux-x64/bin/npm /usr/local/bin/npm
4. 到elasticsearch-head-master目录下,运行命令:
npm install
如果速度较慢或者安装失败,可以使用国内镜像:
npm install -g cnpm --registry=https://registry.npm.taobao.org
5. 修改Elasticsearch配置文件
编辑elasticsearch/config/elasticsearch.yml,加入以下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
6. 打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: ‘*’:
connect: {
server: {
options: {
hostname: '*',
port: 9100,
base: '.',
keepalive: true
}
}
}
7、启动
../elasticsearch-head/node_modules/grunt/bin/grunt server
后台启动:nohup ../elasticsearch-head/node_modules/grunt/bin/grunt server &exit
浏览器访问 http://192.168.1.12:9100/
8、后台启动grunt server命令;
nohup grunt server &exit
如果想关闭head插件,使用Linux查找进程命令:
ps aux|grep head
结束进程:
kill 进程号
文章来源:http://www.cnblogs.com/valor-xh/p/6293476.html
http://www.2cto.com/database/201703/606373.html