zoukankan      html  css  js  c++  java
  • ELK-学习-1:elasticsearch6.3安装和配置

    安装elacticsearch:

    1,安装jdk  要求1.8以上

    2,安装elacticsearch

    rpm –ivh https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.rpm

    修改配置文件

    [root@study08 elasticsearch]# grep "^[a-z]" elasticsearch.yml
    cluster.name: coship-xdx-test      #集群名称,集群内所有节点配置一样
    node.name: coship-node-1           #节点名称,唯一
    path.data: /elastic/data                 #数据存储路径
    path.logs: /elastic/log                   #日志存储路径
    bootstrap.memory_lock: true        #内存锁住,不会触发交换,centos7配置
    network.host: 0.0.0.0                   #监听地址
    http.port: 9200                            #监听端口

    创建数据和日志路径

    mkdir /elastic/data –p

    mkdir /elastic/log –p

    修改目录权限:elasticsearch 会自动创建一个用户和用户组。数据和日志路径要对此用户有写权限。

    chown –R elasticsearch:elasticsearch /elastic

    常见报错处理方法如下:

    问题一:

    [WARN ][o.e.b.JNANatives ] unable to install syscall filter:

    原因:报了一大串错误,大家不必惊慌,其实只是一个警告,主要是因为你Linux版本过低造成的。
    解决方案:
    1、重新安装新版本的Linux系统
    2、警告不影响使用,可以忽略

    问题二:

    max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

    [原因:无法创建本地文件问题,用户最大可创建文件数太小
    解决方案:
    切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:
    vi /etc/security/limits.conf
    添加如下内容:

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

    备注:* 代表Linux所有用户名称(比如 hadoop)
    保存、退出、重新登录才可生效

    max number of threads [1024] for user [es] is too low, increase to at least [2048]

    原因:无法创建本地线程问题,用户最大可创建线程数太小
    解决方案:切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。
    vi /etc/security/limits.d/90-nproc.conf
    修改为:

    * soft nproc 4096

    max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

    原因:最大虚拟内存太小
    解决方案:切换到root用户下,修改配置文件sysctl.conf
    vi /etc/sysctl.conf
    添加下面配置:

    vm.max_map_count=655360

    并执行命令:
    sysctl -p
    然后重新启动elasticsearch,即可启动成功。

    system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

    原因:因为Centos6不支持SecComp,而ES5.2.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。详见 :elastic/elasticsearch#22899
    解决方案:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

    bootstrap.memory_lock: false
    bootstrap.system_call_filter: false

    其它问题可以参考:

    转载:https://github.com/DimonHo/DH_Note/issues/3

    启动elasticsearch

    service elasticsearch start,如果遇到java找不到的报错,导致启动失败,可以修改/etc/init.d/elasticsearch 脚本,增加JAVA_HOME变量;

    有如下打印,表示启动成功:

    image

    查看监听端口:

    [root@study08 ~]# netstat -nltp |grep 9200
    tcp        0      0 :::9200                     :::*                        LISTEN      3523/java

    浏览器输入:http://10.80.0.168:9200,出现如下信息,表示安装成功

    image

  • 相关阅读:
    【hdu 2569】ACM程序设计期末考试081230
    【信息安全111班暑期学习工作任务】
    【hdu 1698 Just a Hook(被搞死)】
    Win8下安装 .net framework 3.5.1 无需连网安装方法,证实有效
    【UVA 488 Triangle Wave】
    【As Easy As A+B 专题训练排序】
    【hdu 1787 GCD Again (数论、欧拉函数)】
    【hdu 2602 Bone Collector(动态规划、01背包)】
    【poj 1953 World Cup Noise】
    【poj 2478 Farey Sequence (欧拉函数、数论)】
  • 原文地址:https://www.cnblogs.com/snailshadow/p/9190413.html
Copyright © 2011-2022 走看看