Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 92545 invoked from network); 7 Oct 2010 01:53:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Oct 2010 01:53:54 -0000 Received: (qmail 709 invoked by uid 500); 7 Oct 2010 01:53:52 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 624 invoked by uid 500); 7 Oct 2010 01:53:52 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 616 invoked by uid 99); 7 Oct 2010 01:53:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 01:53:52 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.215.44] (HELO mail-ew0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 01:53:45 +0000 Received: by ewy26 with SMTP id 26so111767ewy.31 for ; Wed, 06 Oct 2010 18:53:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.97.129 with SMTP id l1mr1154215ebn.56.1286416404134; Wed, 06 Oct 2010 18:53:24 -0700 (PDT) Received: by 10.14.29.66 with HTTP; Wed, 6 Oct 2010 18:53:23 -0700 (PDT) X-Originating-IP: [184.218.164.124] In-Reply-To: <4CACE78C.2060807@digg.com> References: <4CACE78C.2060807@digg.com> Date: Wed, 6 Oct 2010 20:53:23 -0500 Message-ID: Subject: Re: Newbie Question about restarting Cassandra From: Matthew Dennis To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0014852f790dcd40630491fd28ea X-Virus-Checked: Checked by ClamAV on apache.org --0014852f790dcd40630491fd28ea Content-Type: text/plain; charset=ISO-8859-1 Rob is correct. drain is really on there for when you need the commit log to be empty (some upgrades or a complete backup of a shutdown cluster). There really is no point to using to shutdown C* normally, just kill it... On Wed, Oct 6, 2010 at 4:18 PM, Rob Coli wrote: > On 10/6/10 1:13 PM, Aaron Morton wrote: > >> To shutdown cleanly, say in a production system, use nodetool drain >> first. This will flush the memtables and put the node into a read only >> mode, AFAIK this also gives the other nodes a faster way of detecting >> the node is down via the drained node gossiping it's new status. Then >> kill. >> > > FWIW, the gossiper related code for "drain" (trunk) looks like it just > stops the gossip service, which is almost certainly the same thing that > happens if you kill Cassandra. > > ./src/java/org/apache/cassandra/service/StorageService.java > " > public synchronized void drain() throws IOException, > InterruptedException, ExecutionException > ... > setMode("Starting drain process", true); > Gossiper.instance.stop(); > " > > ./src/java/org/apache/cassandra/gms/Gossiper.java > " > public void stop() > { > scheduledGossipTask.cancel(false); > } > " > > =Rob > -- Riptano Software and Support for Apache Cassandra http://www.riptano.com/ mdennis@riptano.com m: 512.587.0900 f: 866.583.2068 --0014852f790dcd40630491fd28ea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Rob is correct.

drain is really on there for when you need the commi= t log to be empty (some upgrades or a complete backup of a shutdown cluster= ).

There really is no point to using to shutdown C* normally, just k= ill it...

On Wed, Oct 6, 2010 at 4:18 PM, Rob Coli <rcoli@digg.com>= wrote:
On 10/6/10 1:13 PM, Aaron Morton wrote:
To shutdown cleanly, say in a production system, use nodetool drain
first. This will flush the memtables and put the node into a read only
mode, AFAIK this also gives the other nodes a faster way of detecting
the node is down via the drained node gossiping it's new status. Then k= ill.

FWIW, the gossiper related code for "drain" (trunk) looks like it= just stops the gossip service, which is almost certainly the same thing th= at happens if you kill Cassandra.

./src/java/org/apache/cassandra/service/StorageService.java
"
=A0 =A0public synchronized void drain() throws IOException, InterruptedExc= eption, ExecutionException
...
=A0setMode("Starting drain process", true);
=A0 =A0 =A0 =A0Gossiper.instance.stop();
"

./src/java/org/apache/cassandra/gms/Gossiper.java
"
=A0public void stop()
=A0 =A0{
=A0 =A0 =A0 =A0scheduledGossipTask.cancel(false);
=A0 =A0}
"

=3DRob



--
Riptano
Softw= are and Support for Apache Cassandra
http://www.riptano.com/
mdennis@riptano.com
m: 512.587.0900 f: 866.583.2068
--0014852f790dcd40630491fd28ea--