ElasticSearch-head安装配置教程

安装ElasticSearch图形管理界面ElasticSearch-head

《elasticsearch-head》Github地址

安装之前做一些准备工作,将itcats用户切换到root用户

su
echo "itcats ALL = (root) NOPASSWD:ALL" | tee /etc/sudoers.d/itcats

返回:  itcats ALL = (root) NOPASSWD:ALL

chmod 0440 /etc/sudoers.d/itcats

解决sudo: sorry, you must have a tty to run sudo问题,在/etc/sudoer注释掉 Default requiretty 一行

sudo sed -i 's/Defaults requiretty/Defaults:itcats !requiretty/' /etc/sudoers

更新依赖

sudo yum update -y

更新epel扩展源 

sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm

安装npm

sudo yum install npm

安装git 

sudo yum install -y git

安装bzip2

sudo yum install -y bzip2

下载es-head

git clone git://github.com/mobz/elasticsearch-head.git

将源码包下载后剪切到/usr/local/目录下,并改所属用户和组

sudo chown -R itcats:itcats /usr/local/elasticsearch-head

#进入到elasticsearch-head中

cd elasticsearch-head

编译安装

npm install

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: '0.0.0.0',也可以改为本机ip

connect: {
                        server: {
                                options: {
                                        hostname: '0.0.0.0',
                                        port: 9100,
                                        base: '.',
                                        keepalive: true
                                }
                        }
          }

编辑elasticsearch-5.4.3/config/elasticsearch.yml,加入以下内容:【告知插件可以连接到ES】

http.cors.enabled: true
http.cors.allow-origin: "*"

运行服务【先执行ES,后执行ES-head】  plus ES 执行命令: /usr/local/elasticsearch-5.4.3/bin/elasticsearch -d

npm run start

如果显示如下则成功:

> elasticsearch-head@0.0.0 start /usr/local/elasticsearch-head
> grunt server

Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

访问http://hdp-01:9100

 

发现健康值未连接,只需要修改localhost为hdp-01即可,读者修改为对应ip即可,点击连接

查看到只有node-1为星形,说明node-1为master。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值