• elasticsearch linux下安装


    1.下载elasticsearch    https://www.elastic.co/cn/downloads/elasticsearch

    2.解压,重命名

    tar -xzvf elasticsearch-7.5.0-linux-x86_64.tar.gz
    mv  elasticsearch-7.5.0   elasticsearch

    3.修改jvm内存

    cd  elasticsearch/config
    vim  jvm.options  # 修改为内存的一半  
      -Xms16g
      -Xmx16g

    4.配置 yml

    cluster.name: dy_comment
    node.name: node_3  
    node.master: true    
    node.data: true  
    path.data: /data/download/elasticsearch/data
    path.logs: /data/download/elasticsearch/logs
    network.host: 0.0.0.0 
    http.port: 9190 
    discovery.seed_hosts: ["192.168.0.120","192.168.0.121","192.168.0.122"]
    cluster.initial_master_nodes: ["192.168.0.120","192.168.0.121","192.168.0.122"] 
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    indices.fielddata.cache.size: 8g
    bootstrap.memory_lock: true

    5.配置data,logs 都在elasticsearch目录下,配置用户权限,es不能root启动

    useradd  elasticsearch 
    passwd   elasticsearch
    
    # 添加权限
    chown -R elasticsearch:elasticsearch  /data/download/elasticsearch  

    6.系统优化   vim /etc/security/limits.conf

    * soft nofile 65536
    * hard nofile 65536
    * soft nproc 32000
    * hard nproc 32000
    * hard memlock unlimited
    * soft memlock unlimited

    7.vim  /etc/systemd/system.conf   

    DefaultLimitNOFILE=65536
    DefaultLimitNPROC=32000
    DefaultLimitMEMLOCK=infinity

    /bin/systemctl daemon-reload    # 使其生效

    8.vim  /etc/sysctl.conf

    vm.max_map_count=655360

    sysctl -p 生效

    使用supervisor 启动 es

    command=su -c "/data/download/elasticsearch/bin/elasticsearch" elasticsearch

  • 相关阅读:
    [整理]Win下好用的Markdown工具
    tcpip http socket
    [整理].net中的延迟初始化器
    [整理]ASP.NET WEB API 2学习
    [整理]ASP.NET MVC 5
    [转载]AngularJS 指令 用法
    [整理]HTML5 WebSocket
    [整理]CSS3 滤镜
    [整理]WebAPP开发的框架
    [整理]AngularJS移动端开发遇到的问题
  • 原文地址:https://www.cnblogs.com/elsons/p/14914793.html
Copyright © 2020-2023  润新知