Elasticsearch can't write to log files

后端 未结 11 1652
既然无缘
既然无缘 2021-02-01 02:00

I would like to activate logs of elasticsearch .

When I run elasticsearch binaries, I realize that I have problems with logging : the configuration cannot be loaded !

11条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 02:35

    I got into the same issue and was wondering how they could miss it in the installation script of elastic search. So, after some digging here is what I found:

    1. It looks like you installed elastic search using yum or apt-get or else you would have had the 'config' directory under ES_HOME.

    2. Checking the init.d/elasticsearch shows the following:

      DAEMON_OPTS="-d -p $PID_FILE --default.path.home=$ES_HOME --default.path.logs=$LOG_DIR --default.path.data=$DATA_DIR --default.path.conf=$CONF_DIR"

      :

      # Start Daemon

      start-stop-daemon -d $ES_HOME --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS

    3. So, all the variables are properly initialized and then passed as command line parameters.

    4. So, the best way for you to start is using the service:

      >sudo service elasticsearch start

    5. It will make sure that all the config and log parameters are passed to the main command.

    6. Check logs under /var/log/$NAME that would be '/var/log/elasticsearch`

提交回复
热议问题