C++,python,热爱算法和机器学习
全部博文(1214)
分类: NOSQL
2016-07-05 14:21:13
lasticsearch service init script doesn't print any error information on console or log file when it fails to startup, instead it ridiculously shows [OK].
You have to run elaticsearch manually with the same user and same parameters as what the init script does to check what's going wrong. The error message will be printed on console.
On my Ubuntu 14.10 with elasticsearch-1.4.1.deb installed, without any path changed, the command to run elastisearch is:
sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d -p /var/run/elasticsearch.pid --default.config=/etc/elasticsearch/elasticsearch.yml --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.work=/tmp/elasticsearch --default.path.conf=/etc/elasticsearch
I just added a line into /etc/init.d/elasticsearch to print out the above command:
# Start Daemon log_daemon_msg "sudo -u $ES_USER $DAEMON $DAEMON_OPTS" # <-- Add this line start-stop-daemon --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS log_end_msg $?