ELK搭建<二>:安装ES插件head

1.去github下载head,针对ES版本不同,安装方式也不一样,

=》在2.x以前版本可以通过插件安装

for Elasticsearch 2.x: sudo elasticsearch/bin/plugin install mobz/elasticsearch-head
for Elasticsearch 1.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/1.x
for Elasticsearch 0.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/0.9
#访问地址
http://localhost:9200/_plugin/head/

---2.x以前的版本到此结束了---

=》在5.x版本以后需要另行安装,用node启动,node下载

可以通过命令安装:

#下载head
git clone git://github.com/mobz/elasticsearch-head.git
#进入head文件夹
cd elasticsearch-head
#下载依赖
npm install
#启动
npm run start
#访问地址
http://localhost:9100/

如果启动报错,则需要安装grunt

#进入head文件夹
cd elasticsearch-head
#选用淘宝镜像速度更快 npm install -g grunt --registry=https://registry.npm.taobao.org
#下载依赖
npm install
#在elasticsearch-head目录下node_modules下如果没有grunt文件夹,则需要运行:
npm install grunt --save 

2.修改head根目录下的配置文件Gruntfile.js,示例:

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

根据自己需要修改hostname和port就行了

3.启动head

进入 elasticsearch-head/node_modules/grunt/bin 目录

运行 ./grunt server 就启动完毕了

 

进入 http://localhost:9100/ 就可以访问了

猜你喜欢

转载自www.cnblogs.com/henglan/p/10790103.html