zoukankan      html  css  js  c++  java
  • ElasticSearch5.2.2 安装(老版本)

    https://www.elastic.co/downloads/elasticsearch
    ElasticSearch是一个高可扩展的开源的全文搜索分析引擎。
    它允许你快速的存储、搜索和分析大量数据。ElasticSearch通常作为后端程序,为需要复杂查询的应用提供服务。

    检查 JDK版本
    java -version  #确保是 1.7版本以上

    下载解压并创建数据和log目录
    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.tar.gz
    tar -zxvf elasticsearch-5.2.2.tar.gz
    cp -R /root/elasticsearch-5.2.2 /usr/local/elasticsearch

    mkdir  -p /opt/elasticsearch/{data,logs}

    配置es参数文件
    vim /usr/local/elasticsearch/config/elasticsearch.yml
      http.port: 9200
      node.name: node-1
      cluster.name: es_cluster
      network.host: 172.31.107.59
      bootstrap.memory_lock: false
      bootstrap.system_call_filter: false
      path.data: /opt/elasticsearch/data
      path.logs: /opt/elasticsearch/logs


    配置参数的冒号前后切记要加空格,否则会报错。
    http://www.cnblogs.com/jiu0821/p/5624908.html

    配置内存
    vim /usr/local/elasticsearch/config/jvm.options
    -Xms1024M
    -Xmx1024M


    配置环境变量
    export ES_HOME=/usr/local/elasticsearch
    source /etc/profile

    添加独立用户---不要在root 用户下启动,不支持root  用户
    groupadd elsearch
    useradd elsearch -g elsearch
    chown -R elsearch:elsearch /usr/local/elasticsearch
    chown -R elsearch:elsearch /opt/elasticsearch

    设置OS环境
    vim /etc/security/limits.conf
     *  soft nofile 65536
     *  hard nofile 131072
     *  soft nproc 2048
     *  hard nproc4096

    vim /etc/security/limits.d/90-nproc.conf
     *  soft nproc 2048

    vim /etc/sysctl.conf
     vm.max_map_count=655360


    最后执行 
    sysctl -p

    设置防火墙
    iptables -I  INPUT -p tcp  --dport 9200 -j ACCEPT
    iptables -I  INPUT -p tcp  --dport 9300 -j ACCEPT
    service iptables save

    .启动

    复制代码
    cd ../bin
    
    //直接启动ElasticSearch
    ./elasticsearch 
    
    //或者使用后台方式进行启动
    ./elasticsearch -d
    复制代码

    查看端口占用

    netstat -anp|grep 9200 或lsof -i:9200 //看该进程是否正常运行

    启动elasticsearch服务
    sudo su elsearch
    cd /usr/local/elasticsearch/bin
    ./elasticsearch -d -p pid

    打开IE
    http://172.31.107.59:9200/

    {
      "name" : "node-1",
      "cluster_name" : "es_cluster",
      "cluster_uuid" : "_vUtFDlNQvS-QvEnADxk9A",
      "version" : {
        "number" : "5.2.2",
        "build_hash" : "f9d9b74",
        "build_date" : "2017-02-24T17:26:45.835Z",
        "build_snapshot" : false,
        "lucene_version" : "6.4.1"
      },
      "tagline" : "You Know, for Search"
    }

    参考:https://blog.csdn.net/zhaowenzhong/article/details/76041451
    https://blog.csdn.net/zhaowenzhong/article/details/76041451
  • 相关阅读:
    protobuf使用遇到的坑
    嵌入式开发入门心得记录
    vim编辑模式下黑色背景,下来过程中出现白条的问题
    linux中awk的应用
    ntp时间同步
    mysql5.5适配
    centos 安装 epel
    ubuntu jdk安装
    add_header Access-Control-Allow-Origin $http_Origin always;
    111
  • 原文地址:https://www.cnblogs.com/micro-chen/p/11671736.html
Copyright © 2011-2022 走看看