CentOS7安装elasticsearch-head

本文详细介绍了在CentOS 7.3环境下安装和配置Elasticsearch-Head的过程,包括通过源码编译安装和使用Docker容器启动的方法,并解决了安装中遇到的npm relocation error问题。

今天在安装elasticsearch-head的时候,需要用到npm环境,因此通过yum安装了一个npm,这里把遇到的问题和坑都记录一下。
elasticsearch-head的github地址:https://github.com/mobz/elasticsearch-head

1、操作系统版本

[root@elk01 ~]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)

2、安装启动elasticsearch-head

方法1:通过源码编译安装

#安装epel源
yum -y install epel-release

#安装npm、git客户端以及openssl
yum -y install npm git openssl

#克隆elasticsearch项目到本地
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head

#安装项目,这个过程需花费大量时间
npm install

#安装完成后,会生成一个node_modes的文件夹
[root@elk01 elasticsearch-head]# ls -ld node_modules/
drwxr-xr-x 374 root root 12288 Mar  5 23:38 node_modules/

#启动
npm run start &

方法2:通过docker容器启动

#安装docker服务
yum -y install docker

#启动容器
docker run -p 9100:9100 mobz/elasticsearch-head:5

3、elasticsearch配置

需要在elasticsearch配置文件里面添加支持http访问的参数

vim /etc/elasticsearch/elasticsearch.yml

#在文件末尾增加如下内容
http.cors.enabled: true http.cors.allow-origin: "*"

4、浏览器访问

两种方法任选一种,安装完成后即可通过浏览器进行访问

http://localhost:9100/

 

安装过程中遇到的问题:

执行命令`npm install`的时候遇到报错如下:

npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference

这是由于没有安装openssl导致的,因此需要事先安装好openssl!

转载于:https://www.cnblogs.com/liuguangjiji/p/10480719.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值