CentOS 7.7 x64
elasticSearch-7.6.1-linux-x64
nodejs v13.10.1
npm 6.13.7
phantomjs-2.1.16-linux-x86_64
由于 elasticsearch-head 使用 node 构建,所以需要安装。
请参考:node.js 安装配置
这个步骤整段转自:web前端学习笔记之安装和使用 phantomjs
访问:https://phantomjs.org/download.html,选择版本,右键,复制链接地址
登录到Linux,进入需要安装的目录,使用 wget 下载:
cd /usr/local/server/phantomjs
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
等待下载完成
yum install fontconfig
yum install bzip2
解压 bz2 包:
bzip2 -d phantomjs-2.1.1-linux-x86_64.tar.bz2
解压 tar 包:
tar -xvf phantomjs-2.1.1-linux-x86_64.tar
这里不修改 path ,只将 phantomjs 文件软链接到环境变量目录:
ln -s /usr/local/server/phantomjs/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/
输入 “phantomjs”,能够进入命令行:
可以看到,安装成功了。ctrl + c 退出命令行
目前 elasticsearch-head 源码托管在 github 上,需要使用 git 下载到本地,然后执行安装
yum install git
cd /usr/local/server/
git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install grunt --save,结果:
文件:elasticsearch-head/Gruntfile.js
默认监听在 127.0.0.1 的 9200 端口,咱们增加 hostname 为 *,表示监听所有 host,即本地、内网、外网都可以访问;以及修改监听的端口。
文件:elasticsearch/_site/app.js,搜索 “localhost:9200”,找到这一行:
将 localhost 改成 elasticSearch 的服务地址,如:
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://x.x.x.x:7712";
npm install
如果出现如下错误,则先执行 npm install phantomjs-prebuilt@2.1.16 --ignore-scripts ,再执行 npm install 就好了:
安装成功的结果:
npm run start,结果:
我确实只有一个 node-1 节点。至此,elasticsearch-head 安装完成
Linux 下 elasticSearch 安装及 head 安装
ELK学习笔记之CentOS 7下ELK(6.2.4)++LogStash+Filebeat+Log4j日志集成环境搭建
原文:https://www.cnblogs.com/coding-one/p/12444897.html