Elasticsearch-head linux安装与配置

1.安装node.js


1.1 下载

cd /usr/local/elasticsearch/
wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz


1.2 解压缩


 

tar -xJf node-v10.16.3-linux-x64.tar.xz 


 

1.3、配置环境变量

vi /etc/profile
export NODE_HOME=/usr/local/elasticsearch/node-v10.16.3-linux-x64
export PATH=$NODE_HOME/bin:$PATH


1.4、加载配置文件并验证是否安装成功

source /etc/profile
node -v
npm -v

2.head插件的安装与配置


2.1、安装git插件

yum install -y git


2.2、验证git插件是否安装成功

git --version


2.3、安装bzip2


 

git --version


否则一会运行时会出现一下问题:
Phantom installation failed { Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2:无法 exec: 没有那个文件或目录
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

2.4、下载并安装head插件

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
npm install


2.5、配置elasticsearch,允许head插件远程访问


 

cd elasticsearch-7.10.2/config/
vi elasticearch.yml

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


2.6、启动elasticsearch-head服务

cd elasticsearch-head/
npm run start

 

Elasticsearch-head是一个基于Web的Elasticsearch客户端,可以用来查询、管理、监控Elasticsearch集群。下面是在Linux系统上安装elasticsearch-head的步骤: 1. 安装Node.js和NPM Elasticsearch-head需要Node.js和NPM才能运行。如果你的系统中没有安装Node.js和NPM,可以使用以下命令安装: ``` sudo apt-get install nodejs sudo apt-get install npm ``` 2. 下载elasticsearch-head 你可以从elasticsearch-head的github仓库中下载最新的代码。使用以下命令将代码下载到你的Linux系统中: ``` git clone git://github.com/mobz/elasticsearch-head.git ``` 3. 安装依赖 进入elasticsearch-head的目录,使用以下命令安装依赖: ``` cd elasticsearch-head npm install ``` 4. 修改配置文件 在elasticsearch-head目录下,找到Gruntfile.js文件,并打开它。找到以下代码: ``` connect: { server: { options: { hostname: 'localhost', port: 9100, base: '.', keepalive: true } } }, ``` 将其中的hostname改为你的Elasticsearch服务器的IP地址或域名,port改为9200。修改后的代码如下: ``` connect: { server: { options: { hostname: 'your-elasticsearch-server-ip', port: 9200, base: '.', keepalive: true } } }, ``` 5. 启动elasticsearch-headelasticsearch-head目录下,使用以下命令启动elasticsearch-head: ``` npm run start ``` 6. 访问elasticsearch-head 在浏览器中输入以下地址,访问elasticsearch-head: ``` http://your-elasticsearch-server-ip:9100 ``` 如果一切正常,你应该能够看到elasticsearch-head的界面,并能够管理你的Elasticsearch集群了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值