美文网首页
Centos 8安装ELK7.X教程

Centos 8安装ELK7.X教程

作者: apple524 | 来源:发表于2021-03-10 16:57 被阅读0次

    Centos8 为最小安装模式

    一、关闭防火墙:

    systemctl stop firewalld.service      #停止firewalld服务
    systemctl disable firewalld.service    #设置开机默认不启动
    
    #生产环境单独在防火墙上开启端口和策略
    #firewall-cmd --permanent --zone=public --add-port=80/tcp
    # firewall-cmd --reload
    

    二、关闭selinux

    getenforce    #查看状态
    vi /etc/sysconfig/selinux    #开机不启动
         SELINUX=disabled
    

    安装JAVA

    yum install java-1.8.0-openjdk
    java -version
    

    导入Elasticsearch秘钥

    rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    

    配置源

    vi /etc/yum.repos.d/elasticsearch.repo
    
    [elasticsearch]
    name=Elasticsearch repository for 7.x packages
    baseurl=https://artifacts.elastic.co/packages/7.x/yum
    gpgcheck=1
    gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
    enabled=0
    autorefresh=1
    type=rpm-md
    

    安装Elasticsearch

    yum install --enablerepo=elasticsearch elasticsearch
    

    编辑配置文件

    vi /etc/elasticsearch/elasticsearch.yml
    

    启动Elasticsearch

    service elasticsearch start
    

    安装Elasticsearch -Head插件
    首先安装node

     wget https://npm.taobao.org/mirrors/node/latest-v10.x/node-v10.0.0-linux-x64.tar.gz
    tar -zxvf node-v10.0.0-lunux-x64.tar.gz
    mv node-v10.0.0-linux-x64 /usr/local/node-v10
    
    vi /etc/profile
    NODE_HOME=/usr/local/node-v10
    PATH=$NODE_HOME/bin:$PATH
    export NODE_HOME PATH
    
    source /etc/profile
    node -version
    

    2.phantomjs安装配置

    wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
    tar –jxvf  phantomjs-2.1.1-linux-x86_64.tar.bz2
    

    vim /etc/profile

    export PATH=$PATH:/usr/local/phantomjs-2.1.1-linux-x86_64/bin

    注意环境变量$Path移动在最前面

    source /etc/profile
    git clone git://github.com/mobz/elasticsearch-head.git
    npm install -g grunt-cli
    cd leasticsearch-head
    npm install

    vi Gruntfile.js 修改监听地址


    image.png

    .phantomjs安装配置

    Wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
    tar –jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2
    vim /etc/profile

    export PATH=$PATH:/usr/local/phantomjs-2.1.1-linux-x86_64/bin

    注意环境变量$Path移动在最前面

    source /etc/profile
    3.elasticsearch-head安装

    • git clone git://github.com/mobz/elasticsearch-head.git
    • cd elasticsearch-head
    • npm install -g cnpm --registry=https://registry.npm.taobao.org
    (直接安装 会存在phantomjs克隆不下来导致安装进行不下去,出现以下错误,所以需要先安装phantomjs)

    npm run start

    相关文章

      网友评论

          本文标题:Centos 8安装ELK7.X教程

          本文链接:https://www.haomeiwen.com/subject/xwvwqltx.html