安装版本:6.4.2

安装方式:磁盘安装

  1. 下载

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.tar.gz
    
  2. 解压

    tar -zxvf elasticsearch-6.4.2.tar.gz 
    mkdir /usr/local/es
    mv elasticsearch-6.4.2 elasticsearch
    cp elasticsearch /usr/local/es/
    
  3. 修改配置

    /usr/local/es/elasticsearch/config/elasticsearch.yml

    cluster.name: elasticsearch
    node.name: node-1
    path.data: /usr/local/es/elasticsearch/data
    path.logs: /usr/local/es/elasticsearch/logs
    network.host: 0.0.0.0
    http.port: 9200
    xpack.ml.enabled: false
    bootstrap.system_call_filter: false
    
  4. 调整系统参数

    vim /etc/security/limits.conf

    * soft nofile 65536
    * hard nofile 65536
    

    vim /etc/sysctl.conf

    vm.max_map_count=655360
    

    sysctl -p

  5. 增加elastic用户

    useradd elastic
    chown -R elastic:elastic /usr/local/es/elasticsearch/
    chmod -R 755 /usr/local/es
    
  6. 启动与验证

    sh /usr/local/es/elasticsearch/bin/elasticsearch
    
    [[email protected] config]# curl 175.5.12.56:9200
    {
      "name" : "node-1",
      "cluster_name" : "my-application",
      "cluster_uuid" : "9sBZLqjsTS-ltvtaaTBCIA",
      "version" : {
        "number" : "6.4.2",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "04711c2",
        "build_date" : "2018-09-26T13:34:09.098244Z",
        "build_snapshot" : false,
        "lucene_version" : "7.4.0",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    [[email protected] config]#