zoukankan      html  css  js  c++  java
  • CentOS6.5安装Elasticsearch5.3.0

    1、 首页到官方网站下载最新安装包 https://www.elastic.co/downloads/elasticsearch

    elasticsearch-5.3.0.tar.gz

    2、 将软件包上传到 /usr/local/mypackages/ 目录下。

    3、 将软件解压到 /usr/local 目录下。

    # tar -xzvf elasticsearch-5.3.0.tar.gz -C /usr/local

    4、 将文件夹 elasticsearch-5.3.0 重命名为 elasticsearch

    # mv elasticsearch-5.3.0 elasticsearch

    5、 配置elasticsearch

    # vim elasticsearch/config/elasticsearch.yml
    
    cluster.name=elasticsearch      #集群名称 只要集群名称相同,将自动构建集群。
    node.name=node1                 #服务器名称
    ttp.port: 9200                  #服务端口
    network.host: 192.168.33.50     #指定Host

    6、 因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户。

    注:最好直接使用非root帐户进行安装。

    useradd elastic
    passwd elastic 123456

    7、 给新建的用户elastic赋权限。

    chown -R elastic /usr/local/elasticsearch
    su elastic

    8、 切换用户并启动elasticsearch服务。

    ./elasticsearch -d  #启动服务

    然后在浏览器中查看,出现以下信息说明启动成功:

    附:启动报错

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

    原因:

    这是在因为Centos6不支持SecComp,而ES5.x默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

    解决:

    修改elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

    bootstrap.memory_lock: false
    bootstrap.system_call_filter: false

     

    报错2

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

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

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

    解决:

    # vim /etc/security/limits.conf
    
    * soft nofile 65536
    * hard nofile 65536

     

    # vim /etc/security/limits.d/90-nproc.conf
    
    soft nproc 1024
    修改为:
    soft nproc 2048

     

    # vi /etc/sysctl.conf
    
    添加配置:
    vm.max_map_count = 655360

     

    并执行命令:(理论上讲是实时生效,但是我重启后才生效的。)

    sysctl -p

     

    报错3memory locking requested for elasticsearch process but memory is not locked

    解决:

    修改elasticsearch.yml文件中的配置,开放discovery.zen.ping.unicast.hosts及discovery.zen.minimum_master_nodes 。

    discovery.zen.ping.unicast.hosts: ["192.168.33.50"]
    discovery.zen.minimum_master_nodes: 1

     

    附录1:如果发现多台机器组不成集群,请设置你的防火墙。

    -A INPUT -p tcp -m tcp --dport 9100 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT
  • 相关阅读:
    GitHub之初体验
    梦过去了
    转载:获取ISAPI_Rewrite重写后的URL
    看《分手合约》
    我们的家
    一盏灯的思考
    网站爱好者:开篇文
    致我们终将逝去的青春
    一起看看百度转码有多无耻!
    RPM
  • 原文地址:https://www.cnblogs.com/hunttown/p/6723250.html
Copyright © 2011-2022 走看看