zoukankan      html  css  js  c++  java
  • CentOS7安装elasticsearch

    第一步安装:

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.rpm
    
    rpm -ivh elasticsearch-6.2.4.rpm 
    
    systemctl daemon-reload

    第二步修改java环境变量:

    vi /usr/share/elasticsearch/bin/elasticsearch

    增加下面标红部分:

    #   ES_PATH_CONF -- Path to config directory
    #   ES_JAVA_OPTS -- External Java Opts on top of the defaults set
    #
    # Optionally, exact memory values can be set using the `ES_JAVA_OPTS`. Note that
    # the Xms and Xmx lines in the JVM options file must be commented out. Example
    # values are "512m", and "10g".
    #
    #   ES_JAVA_OPTS="-Xms8g -Xmx8g" ./bin/elasticsearch
    
    export JAVA_HOME=/usr/local/jdk/jdk1.8.0_161
    export PATH=$JAVA_HOME/bin:$PATH
    
    source "`dirname "$0"`"/elasticsearch-env
    
    ES_JVM_OPTIONS="$ES_PATH_CONF"/jvm.options
    JVM_OPTIONS=`"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.launchers.JvmOptionsParser "$ES_JVM_OPTIONS"`
    ES_JAVA_OPTS="${JVM_OPTIONS//${ES_TMPDIR}/$ES_TMPDIR} $ES_JAVA_OPTS"
    
    if [ -x "$JAVA_HOME/bin/java" ]; then
            JAVA="/usr/local/jdk/jdk1.8.0_161/bin/java"
    else
            JAVA=`which java`
    fi
    
    cd "$ES_HOME"
    # manual parsing to find out, if process should be detached
    if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' > /dev/null; then
      exec 
        "$JAVA" 
        $ES_JAVA_OPTS 
        -Des.path.home="$ES_HOME" 
        -Des.path.conf="$ES_PATH_CONF" 
        -cp "$ES_CLASSPATH" 
        org.elasticsearch.bootstrap.Elasticsearch 
        "$@"
    else
      exec 
        "$JAVA" 
        $ES_JAVA_OPTS 
        -Des.path.home="$ES_HOME" 
        -Des.path.conf="$ES_PATH_CONF" 
        -cp "$ES_CLASSPATH" 
        org.elasticsearch.bootstrap.Elasticsearch 
        "$@" 
        <&- &
      retval=$?
      pid=$!
      [ $retval -eq 0 ] || exit $retval
      if [ ! -z "$ES_STARTUP_SLEEP_TIME" ]; then
        sleep $ES_STARTUP_SLEEP_TIME
      fi
      if ! ps -p $pid > /dev/null ; then
        exit 1
      fi
      exit 0
    fi
    
    exit $?

    第三步,启动和查看状态

    
    
    systemctl enable elasticsearch
    systemctl start elasticsearch
    systemctl status elasticsearch

    第四步,查看版本信息

    curl -XGET "127.0.0.1:9200"

     第五步,修改ip和端口

    vi /etc/elasticsearch/elasticsearch.yml

    network.host: 192.168.31.202

    http.port: 9200

  • 相关阅读:
    数据库之01-数据库概述
    Bootstrap框架
    jQuery
    补充:html速查表
    BOM,DOM相关案例
    BOM,DOM
    函数,词法分析,内置对象和方法
    前端 之 JaveScript 基础语法: 数据类型; 运算符; 数据转换; 流程控制; 常用内置对象;
    favicon.ioc使用以及注意事项
    redux-undo
  • 原文地址:https://www.cnblogs.com/sunalong/p/8919060.html
Copyright © 2011-2022 走看看