elasticsearch 5.1.1安装

原创
2017/04/17 10:11
阅读数 167
  1. 安装jdk1.8:https://my.oschina.net/u/3132676/blog/804599
  2. 下载elasticsearch:https://www.elastic.co/downloads/elasticsearch
  3. 创建es用户
    1. adduser  es 创建 es账户
    2. passwd es  设置密码
  4. 安装elasticsearch :
    1. 切换es  用户  su - es
    2. 解压elasticsearch 压缩包 tar - zxvf elasticsearch-5.1.1
    3. 配置 java_home  修改 elasticsearch 中的 java_home 指定jdk的位置
    4. 配置config 里面的 elasticsearch.yml
    5. ./elasticsearch 启动  ./elasticsearch - d 后台启动
    6. 编写shell 脚本来关闭、启动、重启 es
  5. 启动es中 错误解
    1. 警告、不用修改
      1. [2016-12-20T22:37:28,543][INFO ][o.e.b.BootstrapCheck     ] [elk-node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
        [2016-12-20T22:37:28,552][ERROR][o.e.b.Bootstrap          ] [elk-node1] node validation exception
        bootstrap checks failed
        max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
        [2016-12-20T22:37:28,560][INFO ][o.e.n.Node               ] [elk-node1] stopping ...
        [2016-12-20T22:37:28,628][INFO ][o.e.n.Node               ] [elk-node1] stopped
        [2016-12-20T22:37:28,629][INFO ][o.e.n.Node               ] [elk-node1] closing ...
        [2016-12-20T22:37:28,677][INFO ][o.e.n.Node               ] [elk-node1] closed
    2. 错误2
      1. ERROR: bootstrap checks failed
        max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
        max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
      2. 解决:切换到root用户,编辑limits.conf 添加类似如下内容
        vi /etc/security/limits.conf 
        
        添加如下内容:
        
        * soft nofile 65536
        * hard nofile 131072
        * soft nproc 2048
        * hard nproc 4096
    3. 错误3
      max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
      1. 切换到root用户,进入limits.d目录下修改配置文件。
        vi /etc/security/limits.d/90-nproc.conf 
        修改如下内容:
        
        * soft nproc 1024
        #修改为
        * soft nproc 2048
    4. 错误4
    5. max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]    
      1. 切换到root用户修改配置sysctl.conf
        
        vi /etc/sysctl.conf 
        添加下面配置:
        vm.max_map_count=655360
        并执行命令:
        sysctl -p
        然后,重新启动elasticsearch,即可启动成功。

                  

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部