zoukankan      html  css  js  c++  java
  • elasticSearch安装部署

    1.1 从官网下载安装包,并通过Xftp5上传到机器集群上

    下载elasticsearch-6.2.4.tar.gz版本,并通过Xftp5上传到hadoop机器集群的第一个节点node1上的/opt/uploads/目录:

    1.2 解压elasticsearch-6.2.4.tar.gz,并把解压的安装包移动到/opt/app/目录上

    tar zxvf  elasticsearch-6.2.4.tar.gz

     mv elasticsearch-6.2.4 /opt/app/  &&  cd /opt/app/

    1.3 修改环境变量,编辑/etc/profile,并生效环境变量,输入如下命令:

    sudo vi /etc/profile

    添加如下内容:

    export ELASTICSEARCH_HOME=/opt/app/elasticsearch-6.2.4
    export PATH=:PATH:PATH:ELASTICSEARCH_HOME/bin

    使环境变量生效:source /etc/profile

    1.4 修改配置文件elasticSearch.yml

     进入elasticSearch配置文件的目录,cd  /opt/app/elasticsearch-6.2.4/conf/

    修改elasticsearch.yml文件 vi  elasticsearch.yml,将以下内容写入到elasticsearch.yml文件中

    #集群名称,通过组播的方式通信,通过名称判断属于哪个集群
    cluster.name: bigdata
    #节点名称,要唯一
    node.name: es-1
    #数据存放位置
    path.data: /opt/app/elasticsearch-6.2.4/data
    #日志存放位置
    path.logs: /opt/app/elasticsearch-6.2.4/logs
    #es绑定的ip地址
    network.host: hadoop1
    #初始化时可进行选举的节点
    discovery.zen.ping.unicast.hosts: ["hadoop1", "hadoop2", "hadoop3"]

    注:配置文件elasticsearch.yml中的属性与属性值之间要有空格,否则会报错,如:

    启动es时,报错信息如下:

    1.5 把elasticSearch的安装包发送到其他节点机器hadoop2和hadoop3

    scp  -r  /opt/app/elasticsearch-6.2.4/  hadoop@hadoop2:/opt/app/
    scp  -r  /opt/app/elasticsearch-6.2.4/  hadoop@hadoop3:/opt/app/

    然后hadoop2、hadoop3分别重复第3步骤,修改环境变量

    1.6 分别在hadoop2、hadoop3机器节点上修改node.name和network.host

    hadoop2机器节点上修改elasticSearch的elasticsearch.yml配置文件

    hadoop3机器节点上修改elasticSearch的elasticsearch.yml配置文件

    1.7 启动elasticSearch(每台机器上都执行)

     elasticsearch -d 

     

    可能存在的启动异常:

    ERROR: bootstrap checks failed

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

    max number of threads [1802] for user [hadoop] is too low, increase to at least [4096]

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

    解决max file descriptors和max number of threads这两个问题:

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

    max number of threads [1802] for user [hadoop] is too low, increase to at least [4096]

    修改limits.conf文件sudo vi /etc/security/limits.conf,添加如下内容:

    * soft nofile 65536
    * hard nofile 65536
    * soft nproc 4096
    * hard nproc 8192

     

    说明:* soft nofile 65536、* hard nofile 65536对应解决max file descriptors [4096];* soft nproc 4096、* hard nproc 8192对应解决max number of threads [1802]。

    修改完需要重启系统,limits.conf文件才能生效,可以通过ulimit -n来查看max file descriptors是否有改变

    解决max number of threads问题

    修改20-nproc.conf文件sudo vi /etc/security/limits.d/20-nproc.conf,添加如下内容:

    * soft nproc 4096
    root soft nproc unlimited

    解决 max virtual memory问题:

    修改sysctl.conf文件sudo vi /etc/sysctl.conf,添加如下内容:

    vm.max_map_count=262144

    修改完需要执行命令sudo sysctl -p,sysctl.conf文件才能生效

    参考解决方法:https://blog.csdn.net/weini1111/article/details/60468068

    参考修改/etc/security/limits.conf文件无效的解决方法:

    https://blog.csdn.net/marco_90/article/details/45147319

    https://blog.csdn.net/daxiang12092205/article/details/52100180

    1.8 用浏览器访问es所在机器的9200端口

    http://hadoop1:9200/

  • 相关阅读:
    Android开发:android.support.v7.widget.AppCompatButton cannot be cast to android.widget.EditText;使用Fragment时不同引入包的问题解决
    Android开发:java.net.SocketException: Permission denied问题解决
    毕业设计进度:3月26日
    Android开发:在非Activity类中,如何实现跳转到另一个Activity
    Android开发:Textview控件显示的字符串中部分文字格式修改
    Android开发:URLDecoder: Illegal hex characters in escape (%) pattern : %编码问题
    Android开发:输入框点击后弹出的小键盘把页面向上挤压问题解决
    Android开发:Can't create handler inside thread that has not线程问题解决
    CCF认证历年试题
    北大ACM
  • 原文地址:https://www.cnblogs.com/momoyan/p/11616477.html
Copyright © 2011-2022 走看看