Elasticsearch安装

环境

系统:CentOS 6.9
软件:elasticsearch-6.1.0.tar.gz
服务器:elk-elasticsearch-1,elk-elasticsearch-2

准备

  • 安装JDK
    参见:http://www.jianshu.com/p/9d1b3eefdea3

安装

  • 下载二进制包
    地址:https://www.elastic.co/downloads/elasticsearch

  • 创建用户

    # useradd elk
    
  • 安装

    # tar -xzvf elasticsearch-6.1.0.tar.gz
    # mv elasticsearch-6.1.0 /usr/local/elasticsearch
    # chown -R elk:elk /usr/local/elasticsearch
    

配置

  • 创建文件夹

    # mkdir -p /data/elasticsearch/data
    # mkdir -p /data/elasticsearch/logs
    # chown -R elk:elk /data/elasticsearch
    
  • 配置

    # vim /usr/local/elasticsearch/config/elasticsearch.yml
    cluster.name: my-elasticsearch-cluster
    node.name: elk-elasticsearch-1
    path.data: /data/elasticsearch/data
    path.logs: /data/elasticsearch/logs
    network.host: 0.0.0.0
    discovery.zen.ping.unicast.hosts: ["elk-elasticsearch-1", "elk-elasticsearch-2"]
    bootstrap.system_call_filter: false
    
  • 设置系统参数

    # vim /etc/sysctl.conf
    vm.max_map_count = 655300
    
    # sysctl -p
    

启动

  • 开机启动

    # vim /etc/rc.local
    source /etc/profile
    su elk -c '/usr/local/elasticsearch/bin/elasticsearch -d'
    
  • 启动

    # su - elk
    $ /usr/local/elasticsearch/bin/elasticsearch -d
    

服务器elk-elasticsearch-1、elk-elasticsearch-2分别按照以上步骤安装、配置、启动

你可能感兴趣的:(Elasticsearch安装)