• Elasticsearch 安装


    1、下载 最新版的 Elasticsearch (elasticsearch-6.2.0.tar.gz) 到 /usr/local/src 目录下

    2、解压缩到当前文件夹    【tar -zxvf elasticsearch-6.2.0.tar.gz】

    3、移动到 /usr/local 目录下   【mv elasticsearch-6.2.0 ../】

    4、将命令添加到环境变量     【vi /etc/profile】

    5、最后添加

    export JAVA_HOME=/usr/jdk1.8.0_60

    export JRE_HOME=$JAVA_HOME/jre

    export ELASTICSEARCH_HOME=/usr/local/elasticsearch-6.2.0

    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$ELASTICSEARCH_HOME/bin:$PATH

    6、修改 /usr/local/elasticsearch-6.2.0/config/elasticsearch.yml

    cluster.name: my-application

    node.name: node-1

    network.host: 0.0.0.0

    http.port: 9200

    node.max_local_storage_nodes: 2

    可能遇到异常

    1、failed to obtain node locks, tried [[/elasticsearch-5.4.0/data/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])

     /usr/local/elasticsearch-6.2.0/config/elasticsearch.yml  配置文件最后添加  node.max_local_storage_nodes: 2

    2、can not run elasticsearch as root

    useradd elasticsearch

    chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-6.2.0

    su elasticsearch

    sh /usr/local/elasticsearch-6.2.0/bin/elasticsearch -d

    3、main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console

    node.max_local_storage_nodes: 2

    请尽量保持冒号前面没空格,后面一个空格,不要用tab键

  • 相关阅读:
    学习笔记:字符串-Hash
    模板:高精度
    关于我自己
    学习笔记:数学-GCD与LCM-素数筛法
    学习笔记:数学-GCD与LCM-唯一分解定理(质因数分解)
    学习笔记:数学-GCD与LCM-整除的基础概念
    题解 洛谷P1990 覆盖墙壁
    学习笔记:平衡树-splay
    npm发布myself的插件
    javascript API文档
  • 原文地址:https://www.cnblogs.com/tq1226112215/p/8435127.html
Copyright © 2020-2023  润新知