zoukankan      html  css  js  c++  java
  • ELK+Filebeat日志中心搭建(一)——ElasticSearch7.3.1安装

    1. 环境准备

    1.1. JDK安装

    JDK推荐安装OpenJDK最新版本12

    yum install -y java-latest-openjdk.x86_64 java-latest-openjdk-devel.x86_64

    vi /etc/profile #插入一下内容:
    export JAVA_HOME=/lib/jvm/java-12-openjdk-12.0.2.9-1.rolling.el7.x86_64
    #路径根绝当前版本/lib/jvm中实际路径做修改 不同子版本实际路径有一定差别
    #添加后保存退出

    source /etc/profile

    1.2. 添加新用户

    由于ElasticSearch安全策略限制,不能以root用户运行,需要为其创建新用户,本次命名位elagroupadd ela

    useradd -g ela ela
    passwd ela
    #按提示输入新密码

    visudo
    #在root    ALL=(ALL)       ALL下面添加如下行
    ela ALL=(ALL) ALL

    1.3. 修改系统参数 

    vim /etc/security/limits.conf #修改为以下内容
    *               soft    nofile          65536
    *               hard    nofile          65536
    *               soft    nproc           65536
    *               hard    nproc           65536

    vim /etc/security/limits.d/20-nproc.conf
    * soft nproc 1024
    #修改为
    * soft nproc 4096
    vim /etc/sysctl.conf
    #添加如下内容
    #ELK
    fs.file-max=65536
    vm.max_map_count = 262144
    net.core.somaxconn = 65535
    net.ipv4.ip_forward = 1
    sysctl -p  #查看是否添加成功

    2. 下载及配置

    2.1. 下载

    创建软件目录/usr/elk并进入该目录

     wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.1-linux-x86_64.tar.gz

    解压缩:

    tar -zxvf elasticsearch-7.3.1-linux-x86_64.tar.gz

    2.2. 配置

    cd /usr/elk/elasticsearch-7.3.1/config

    cluster.name: dudu #设置集群的名字,必须小写
    node.name: node-1 #设置节点的名字
    network.host: 0.0.0.0 #设置ip地址,使外界可以访问es
    http.port: 9200 #设置对外服务的端口,默认是9200
    #设置在集群中的所有节点名称
    cluster.initial_master_nodes: ["node-1"]
    bootstrap.memory_lock: false
    bootstrap.system_call_filter: false

    3. 启动

    3.1. 设置目录权限

    为ela用户设置ElasticSerach目录运行权限

    chown -R ela.ela /usr/elk/elasticsearch-7.3.1

    3.2. 运行ElasticSearch

    切换用户至ela

    su ela

    后台运行

    cd /usr/elk/elasticsearch-7.3.1/bin
    nohup ./elasticsearch &

    浏览器打开9200端口,看到如下界面则运行成功:

  • 相关阅读:
    Linux--shell三剑客<sed>--07
    Linux--shell交互输入与循环语句--06
    Linux--shel分支语句--05
    Linux--shell grep与正则表达式--04
    Linux--shell编程原理--03
    Linux--shell重定向与文件处理命令--02
    Linux--shell的基本特性--01
    Docker数据卷
    Docker容器
    Docker的安装
  • 原文地址:https://www.cnblogs.com/zklight/p/11491916.html
Copyright © 2011-2022 走看看