centos7.4安装elk7.7.0最新版本(一)

一、准备安装包

1、环境概况
系统:CentOS 7

es主节点/es数据节点/kibana/head                 192.168.3.11

es主节点/es数据节点/filebeat                    192.168.3.12

es主节点/es数据节点/logstash                    192.168.3.13

2、下载资源包
mkdir -p /root/soft/elk && cd /root/soft/elk

wget -c https://mirrors.huaweicloud.com/nodejs/latest-v12.x/node-v12.14.1-linux-x64.tar.gz
wget -c https://github.com/mobz/elasticsearch-head/archive/master.zip
wget -c https://mirrors.huaweicloud.com/elasticsearch/7.7.0/elasticsearch-7.7.0-linux-x86_64.tar.gz
wget -c https://mirrors.huaweicloud.com/kibana/7.7.0/kibana-7.7.0-linux-x86_64.tar.gz
wget -c https://mirrors.huaweicloud.com/logstash/7.7.0/logstash-7.7.0.tar.gz
wget -c https://mirrors.huaweicloud.com/filebeat/7.7.0/filebeat-7.7.0-linux-x86_64.tar.gz


官网下载:https://www.elastic.co/cn/downloads/past-releases

备用地址:
wget -c http://yunwei.qzbaitan.com/elk/node-v12.14.1-linux-x64.tar.gz
wget -c http://yunwei.qzbaitan.com/elk/master.zip
wget -c http://yunwei.qzbaitan.com/elk/elasticsearch-7.7.0-linux-x86_64.tar.gz
wget -c http://yunwei.qzbaitan.com/elk/kibana-7.7.0-linux-x86_64.tar.gz
wget -c http://yunwei.qzbaitan.com/elk/logstash-7.7.0.tar.gz
wget -c http://yunwei.qzbaitan.com/elk/filebeat-7.7.0-linux-x86_64.tar.gz
wget -c http://yunwei.qzbaitan.com/elk/jdk-11.0.7_linux-x64_bin.tar.gz


二、配置基础环境(全部安装)

1、关闭防火墙和seliunx

# systemctl stop firewalld && systemctl disable firewalld

# sed -i 's/=enforcing/=disabled/g' /etc/selinux/config  && setenforce 0

2、设置打开文件数
vim /etc/security/limits.conf

* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

vim /etc/sysctl.conf

vm.max_map_count=655360 #单个vm进程最大线程数量为改值的一半左右

sysctl -p
3、环境配置

以下2个环境都是解压后配置一下path即可直接使用

下载安装jdk11并配置环境
ln -s /usr/local/jdk/bin/java /usr/local/bin/java

安装nodejs环境
ln -s /usr/local/node/bin/node /usr/bin/node

三、安装elasticsearch-head(192.168.3.11安装)

1、安装head
cd /root/soft/elk
unzip master.zip
mv elasticsearch-head-master /usr/local/elasticsearch-head
2、安装head插件
cd /usr/local/elasticsearch-head
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install -g grunt-cli
cnpm install -g grunt
cnpm install grunt-contrib-clean
cnpm install grunt-contrib-concat
cnpm install grunt-contrib-watch
cnpm install grunt-contrib-connect
cnpm install grunt-contrib-copy
cnpm install grunt-contrib-jasmine				#若报错就再执行一遍
3、配置文件
vim /usr/local/elasticsearch-head/Gruntfile.js

#找到下面connect属性,新增 hostname: '0.0.0.0', 
        
                connect: {
                        server: {
                                options: {
                                        hostname: '0.0.0.0',            #不要忘了后面的逗号
                                        port: 9100,
                                        base: '.',
                                        keepalive: true
                                }
                        }
                }

4、启动测试

cd /usr/local/elasticsearch-head && nohup grunt server &

5、启动脚本
vim /etc/init.d/elasticsearch-head
#!/bin/bash
#chkconfig: 2345 55 24
#description: elasticsearch-head service manager

data="cd /usr/local/elasticsearch-head/ ; nohup /usr/local/node/bin/npm run start&"
START() {
                source /etc/profile
                eval ${data}
}

STOP() {
                ps -ef | grep grunt | grep -v "grep" | awk '{print $2}' | xargs kill -s 9 >/dev/null
}


case "$1" in
  start)
        START
        ;;
  stop)
        STOP
        ;;
  restart)
    
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冰河长歌

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值