ElasticSearch安装及运行的坑

一、确认centos系统是为64位的,x86的不可以安装

1. 下载elasticsearch包

2. 用 tar -zxvf 解压包

3. 增加一个elk用户,elasticsearch7不可用root用户运行

4. 新建用户必须要用 chown -R 用户名 文件夹:进行权限分配

二、配置实现外网访问

clipboard

三、处理三个系统配置

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

  每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量

ulimit -Hn ulimit -Sn

  修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效

* soft nofile 65536 * hard nofile 65536

48-776330364

2、max number of threads [3818] for user [es] is too low, increase to at least [4096]

  问题同上,最大线程个数太低。修改配置文件/etc/security/limits.conf,增加配置

soft    nproc           4096
hard    nproc           4096

  可通过命令查看

ulimit -Hu ulimit -Su

6-1676615485

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

  修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144

vi /etc/sysctl.conf

sysctl -p

  执行命令sysctl -p生效

26-366544473

正确的limits.conf

clipboard

四、处理bootstrap checks failed问题

[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

这时候继续编辑elasticsearch.yml文件,将 #cluster.initial_master_nodes: ["node-1", "node-2"] 修改为 cluster.initial_master_nodes: ["node-1"],

clipboard

另一种解决办法:

报错:ERROR: bootstrap checks failed

      解决:在elasticsearch.yml中配置bootstrap.system_call_filter为false,要在Memory下面:

                 bootstrap.memory_lock: false

                 bootstrap.system_call_filter: false

posted @ 2019-07-21 17:15  小龙女先生  阅读(424)  评论(0编辑  收藏  举报