Can anyone tell me if in the daemon script of elasticsearch in the deb
package do the "stop" option works like it's done when I perform a kill?
I worried about this, because almost everytime I use kill to terminate
elasticsearch, I come back with a missing shard. =/
I am talking about a hard install of elastic search (without deb package)
To everything work as expected when I bring the clusters back, I have to
perform an API shutdown in all nodes (I do a flush before it, but just to
make sure, I don't think it's necessary)
And then everything works fine when I start the nodes again.
But if kill any (or all) of the nodes, I usually get a missing shard when I
bring the cluster back.
I investigated a little bit in the /etc/init.d/elasticsearch script and
stop doesn't seem to do that:
log_daemon_msg "Stopping $DESC"
set +e if [ -f "$PID_FILE" ]; then start-stop-daemon --stop --pidfile "$PID_FILE" \ --user "$ES_USER" \ --retry=TERM/20/KILL/5 >/dev/null if [ $? -eq 1 ]; then log_progress_msg "$DESC is not running but pid file
exists, cleaning up"
elif [ $? -eq 3 ]; then
log_failure_msg "Failed to stop $DESC (pid $PID)"
rm -f "$PID_FILE"
log_progress_msg "(not running)"