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
?
|