1、下载elasticsearch-head

https://gitcode.com/
需要账号密码才能下载

2、解压

yum install -y unzip zip
unzip elasticsearch-head-master.zip

3、执行安装命令

mv elasticsearch-head-master /usr/local/elasticsearch-head-master
cd /usr/local/elasticsearch-head-master
npm install
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install --registry=https://registry.npm.taobao.org
npm install --force --registry=https://registry.npm.taobao.org

4、启动服务

前台启动: npm run start
后台启动:nohup npm run-script start > /dev/null 2> /dev/null &

5、开启防火墙

firewall-cmd --zone=public --add-port=9100/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports

6、访问

http://ip:9100

7、关闭服务

查找进程:ps aux|grep grun
kill -9 pid
先找端口:lsof -i:9100
kill -9 pid

8、设置开机启动

vi /etc/init.d/eshead
#!/bin/sh
#chkconfig: 2345 80 05
#description elasticsearch-head-master
# nodejs
export PATH=/usr/local/node/bin:$PATH
# elasticsearch-head-master
cd /usr/local/elasticsearch-head-master
nohup npm run-script start > /data/elasticsearch-head-master/nohup.out 2>&1 &

9、授权

mkdir -p /data/elasticsearch-head-master/
chmod +x /etc/init.d/eshead
chkconfig --add eshead
chkconfig --list

centos7.9 elasticsearch-head环境安装结束

08-27 05:41