how to gracefully shutdown nsqd

614 views
Skip to first unread message

st xiao

unread,
Aug 17, 2014, 3:30:44 AM8/17/14
to nsq-...@googlegroups.com
I deployed nsqd with nsqlookupd.
when I try to upgrade the nsq binary, I would like to perform steps below:
1. disconnect nsqd from nsqlookupd;
2. await <lookupd_poll_interval> seconds;
3. shutdown nsqd & upgrade

how can I do ?


http://nsq.io/components/nsqlookupd.html#deletion_tombstones
the tombstones seens good for me, but it bring out with a lifetime wnd.
I think it is not designed for upgrade situation.

Matt Reiferson

unread,
Aug 17, 2014, 10:03:35 AM8/17/14
to st xiao, nsq-...@googlegroups.com
You can send nsqd a SIGTERM for a graceful shutdown.

Geert-Johan Riemer

unread,
Nov 27, 2014, 4:20:33 AM11/27/14
to nsq-...@googlegroups.com, xia...@gmail.com
What is the default behavior during graceful shutdown.

I can think of a few strategies, but can't find which one is applied.
- stop accepting new messages, wait until all channels are drained, then exit.
- move messages to a different nsqd in the cluster (although afaik, nsqd's don't know eachother)
- drop all messages
- persist messages to disk, assuming nsqd is started again later

I'm very curious how to handle this, because I'm planning to use nsq in a large project on CoreOS.. but I'm unsure how to handle shutdown/reboot situations here..

Matt Reiferson

unread,
Nov 27, 2014, 9:35:22 AM11/27/14
to Geert-Johan Riemer, nsq-...@googlegroups.com, xia...@gmail.com
nsqd will close its listeners, flush all pending messages to disk, then exit.
Reply all
Reply to author
Forward
0 new messages