Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E804E200D21 for ; Mon, 16 Oct 2017 13:54:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E67A51609EF; Mon, 16 Oct 2017 11:54:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1C9DF1609EC for ; Mon, 16 Oct 2017 13:54:44 +0200 (CEST) Received: (qmail 63245 invoked by uid 500); 16 Oct 2017 11:54:43 -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 63235 invoked by uid 99); 16 Oct 2017 11:54:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 11:54:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3C480CB6CB for ; Mon, 16 Oct 2017 11:54:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.211 X-Spam-Level: X-Spam-Status: No, score=-0.211 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_DKIM_INVALID=0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=ericsson.onmicrosoft.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id mjYyQBdBqFzD for ; Mon, 16 Oct 2017 11:54:38 +0000 (UTC) Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 275425F3DE for ; Mon, 16 Oct 2017 11:54:38 +0000 (UTC) X-AuditID: c1b4fb2d-fc3a89c00000268d-a5-59e49df687a6 Received: from ESESSHC023.ericsson.se (Unknown_Domain [153.88.183.87]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 10.B5.09869.6FD94E95; Mon, 16 Oct 2017 13:54:30 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.87) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 16 Oct 2017 13:54:27 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.onmicrosoft.com; s=selector1-ericsson-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xw1uH+rcVvAPMgzFagdoAG3UM8Fpelnti0VnBxhqTsE=; b=QU1VHXCSbSgrF4d06dZrmwZoTixjklh7qqbX5t4eu0vEDG4cj5u899uvmgj0Hzb3BbFIVRQ2juFm6jiSt351Dmci48lnAAm1OUyJ8pR6ZoEAtLFiUPKNW6oD/YI6l5L6gflAuqdd0qvxde5R4RMjLb0t7Gzn/FJgwa/2D3TatPA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.fontana.oscarsson@ericsson.com; Received: from [136.225.27.212] (192.176.1.84) by AM3PR07MB433.eurprd07.prod.outlook.com (2a01:111:e400:8822::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.2; Mon, 16 Oct 2017 11:54:26 +0000 Subject: Re: Best approach to prepare to shutdown a cassandra node To: , Javier Canillas References: From: Simon Fontana Oscarsson Organization: Ericsson AB Message-ID: <89eb0124-2734-0c3e-dfb2-d31822af95b9@ericsson.com> Date: Mon, 16 Oct 2017 13:54:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------0872843F53008A055A2EF969" Content-Language: en-US X-Originating-IP: [192.176.1.84] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) To AM3PR07MB433.eurprd07.prod.outlook.com (2a01:111:e400:8822::15) X-MS-Office365-Filtering-Correlation-Id: 52d28222-ee3f-4fdd-7395-08d5148ca68f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:AM3PR07MB433; X-Microsoft-Exchange-Diagnostics: 1;AM3PR07MB433;3:JVuMXQN6zc9Qpb4l/Ufc+1woJUeAfUbqhQyvPo3yPHdAU7seT49Ob0f64UEW4knXlSrAbxFCdykz0VxkRN9cCJdtq0Qut8dRWT48LtTAHurGT5Yj3hFw27DHND7doe8Q+6vsOTSXpb8CytDmeaUWA0P24xg1WAt0VwVsstKIOIZy+sqi/10bW356mzJahZtOfBWMSj78VJvPb34g6jw0xOiGou3C1jWF/kfA77M+NIvxfrDBz1R666gu9MOnXcz7;25:3OPJTE71w2OsGKtUDZX85jnUFg8XG3/aHe/ME6zZkOAsaYPRXQRW8kVE+0Pu46RwEqgKIeduoJy1/2Xz38/NXo/5sIZX738jLVv4Yw9WU4aqGpIZepPkf/q5Gw2q712pU+5xzRaSreRmbgAQDbwjmGdfOPSP5BaFugPb1NGDJgVPL+2PjtCDyO2WZeolKt/+6AwtroByLZNGXZLYAUMSDOWB0Trs3djxnyvNiHTlZ9f4Q8muaI+YBmk9QAnAnWHKfTgPQ+ZIJ59LrUnnUauLhTnYs9CYrdbmO4nsSXzTDdTGiz5ZRnwHUhKmw5icpF1llMsT70LQhwBJv45mFJcwk9hlME9f0gjn7zQTDOeTiYQ=;31:LEAQ/ZUawjrRusB0N2YQpCbMI0PPQDIotFunSmXi1/Y/NgKcyIwPVwA1HkRzgvQ78wpka04RtTg59IBFrlc0/kzkocuUY8Fp+OWWHY8RE5BtgJm9rw/pXre6VCUopMSQ9lw/ovbviw1GjrpbTtmmQzRULyPIwn326AefNyl8cTbb7+p3G/cZpwvi3PMP4t/kPF9x7xEu/em9TDrOzZA3SsZhqobcc6oNsD/Fg9U35Io= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PR07MB433: X-Microsoft-Exchange-Diagnostics: 1;AM3PR07MB433;20:I4YOCLbkdwRqUVL1Caj4sqIQ8IzoafCGTeyYHdvIx2orwy0WhpO+Ti+GIp5SX6VeJxOC9S/h17N6FMUPJfqdh2sFiNMxeyLDDLCfjkk/l+eQ+nZTcfY2VZsrHWWfPbDyOcy2kTyoR0HI6WAm/M1JVE+5v6ux1fSpiUMegQy1ViHNUrcFbXFOknNgCY9EPYv/5hllFJAzY/2RqvP5s99SNfIGJyP7h/TC496Wl6wKS7GTINH3mHxviVsTxfhLs3Y99Hj8TCvAbUcjQoDShp6bm48xV6MzFom2JamLZvSC+bpRolpsZ83jDhUg+EeTycqZwAscBNHZg9RZsIBS0c8DxL/v9u/hyWTwKYyYp6LOolLwJixvLbLqEWgfGiSmdK2yltqfedd+YsJst+fPX3jpcgEPqnZ3eUErF1dhC9f3qP+Oy3JVBe6Na6zBNM7Ay3nNSU9+puaM4+KrvHHb5z/pL50DI3c+CSqmoqBQ5WOgexzMqvORtpYytXYKCPVO/D/R;4:HUgAAMhuCPsmJMdMpDcZ86IYaeh94JzV0jdtwt5Fr8D7rSe5jBjYVnMtJaoPRmunlw0m/sCNinnTsld+geYoXK4h0d7/Q/MGgg6xyxZyABR8rzfE8sLpssvLLyUIEetDWx7OIepYw2MGwKR62lAAss1j52uOoRMsDt+8z3uUsigcOskj8zVD7ALhKYF6PdYm6DN0ixgK43Du5jDrxkAKTpy94xs3v7KooCnAm7xJk3uYWFZOMmME/AjejIfqp1MCWm1C2VkNS0uBnl3W0GGFbjIF5aduoO8PVizxq4h5tFY= X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM3PR07MB433;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM3PR07MB433; X-Forefront-PRVS: 0462918D61 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(6019001)(39860400002)(346002)(376002)(269900001)(24454002)(189002)(377424004)(53754006)(199003)(377454003)(478600001)(6246003)(49976008)(6116002)(3846002)(25786009)(39060400002)(65806001)(65956001)(66066001)(101416001)(2906002)(105586002)(106356001)(33646002)(54356999)(50986999)(76176999)(31696002)(68736007)(31686004)(84326002)(53946003)(236005)(4001150100001)(53936002)(6306002)(54896002)(189998001)(6916009)(36756003)(97736004)(86362001)(81166006)(16526018)(81156014)(6486002)(316002)(5660300001)(2950100002)(16586007)(6666003)(16576012)(37036004)(7736002)(93886005)(8676002)(58126008)(65826007)(229853002)(8936002)(83506001)(53546010)(64126003)(606006)(78286006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR07MB433;H:[136.225.27.212];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM3PR07MB433;23:CWEpSCsaX0QI8g3EfL9rvL3k7Bju7SuN1Eyol5BUAr?= =?us-ascii?Q?A4jC2bJx4PQf9RMU3oATWrTbsiMRAITr4M+WDvHQtZ+1WZ8sbqi31TNHWlEX?= =?us-ascii?Q?F+IZ7wo09DQOjAOcH1cxNbdILyjmizz5H1Dqf/k9BheSoxaKKeu/tBgGJYSF?= =?us-ascii?Q?09DClvxjPUMTYjhYNVmUPCl6pqgmX8+PbOLTLObg9OgKkYNYxNdN4C+MFl/M?= =?us-ascii?Q?4to8mIfE4yEc8/xIOe/dmerSsb8Hy0Gg67+BHPqi0JtdciaFIqxY59/6W4gI?= =?us-ascii?Q?SthBsJY+Ck+NC6YmVC50dv2p15gmmJ1YR5+NYw/ACk8znWeNGt4ebd9uRYsh?= =?us-ascii?Q?vj9+taNNmt6be3C0dve+YdUaIkvOPDNvJag4YZGI3zF+/3soao/brdbUhNKG?= =?us-ascii?Q?/kOHmH4832d1uema6s1tzKHZRalwoEkL32Qam8DNg19CJTleRbCf6zImJccY?= =?us-ascii?Q?8Po88WPXpW0Skw3aY4qAF4qUVNJwf4bOU9S756qbg4gBzAUV9FavmS8KikcQ?= =?us-ascii?Q?4xakBH1dAQSBoIvHSqiX10xPIBt9VurgMFLnHLQ6/BQ3f+DKIy4yZdyzAccM?= =?us-ascii?Q?SmMyHC+QO8wJkjuUzV9WbDSwyyJpsq4napcEkpOPTbbpWDiJQzMnH54kgZiK?= =?us-ascii?Q?CiHRCq+nkAU3+KJJt0V/ScTKPpRCgt5hH/UjdrUqgQwni1nzsvkC9jGzwDvq?= =?us-ascii?Q?9NpIXdz415A9Eu6IhlXvoYTz7rZ3ATS7+vJNpMur10Jp6oOLJctnuarrNKOi?= =?us-ascii?Q?bGFsT/66h+JCyggwTgWyZrHWvAjNISRoBT4pDHlFSlfzWR6cJJQaWy2dMmum?= =?us-ascii?Q?oC3ybw5RN3rBx6D1X7PSmTAuSCRpenaD7kNPfnnHjFPOipZlaFd00a/6YZAW?= =?us-ascii?Q?8p3m/okjYpU8J60qBcG8mttjWnlsVeE0kzcB+FKBVKz6tBQKiykjH0MyQDsO?= =?us-ascii?Q?W+qjY52I8t3LEzFJSord1VAMInSKrl4KnrQWMezWHal0E+ai8qIWhJ/I2TTn?= =?us-ascii?Q?90MluDvgimMdQs4HjhvvgiQjXVwupSNyf5fjF7neH0entWX9Pq8wopmIFI9y?= =?us-ascii?Q?jwwYX03IrM7yA0vZNioRRZVLT35ecow2R+FbgHvJeVCJRVloKYkHAa83pJBX?= =?us-ascii?Q?STLyW/JjQRMqNhgumu8+jiEjsusJeyw0QE8C4e1/SVCrB8hgfJovcLNrUMPO?= =?us-ascii?Q?N1ONU2E8atkeLSt4EaP/lHJU5tCJEAh71ge8cNsItwLCGs12Y22LrUVBhmYs?= =?us-ascii?Q?F/dQrGOM+XALzv8tCw2DKTK/0tFDCT5xdfcOIp6FFOhk5vMyQvmi6QcH5E4r?= =?us-ascii?Q?f89t9UrUJ0ZTeqx7TR/F6YqGEEgJZanW+ddwxu9Nvc04zSJMgWCUHwqsq3L4?= =?us-ascii?Q?dORCERpwInieZgeycM6seU5RrVkup9txk4idH0AWkbg6JzSB5FpvZ6u8Qik5?= =?us-ascii?Q?QUiN4dqN51DqFJIWJu6rurmvL9Wqb89Ve7CBi6zK85OmooXlt3ldOFgglb6d?= =?us-ascii?Q?/Oc8RF5VvAIzZ/d+mbBXVu7zrQ4/sfcH6okIvkaY55qWuvMgQ2XHsYuCa3Qu?= =?us-ascii?Q?Lf62Sq3kpN5h64njyth4q/WBkCZZbhmke4aA0=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM3PR07MB433;6:LZGV4Yb8n/0g0eAJPXJmJLRLL+WIXk7Ry+5jZtzXJE8uwJukuMd36P1fRqRZNPiN/TS778TTzveD5XzxggGDlKFswZb/dhM/0qie+YP9k7Ky1Y/564NLwDqqPOaKbKPsU1XDnsYL9yQK+BNHBG/5GQOwkaOHYR7em6bGYpyKfFjwh623sKT7oACcmpH3c0TE4H5Ioi0jaFd33KG/yFSIXMxNQLw2kT8c8sZyOlHvTBskwd9cLXKDd6AHGMmnNGNylIZSftS55S3mX/xFuN9+eSXXNGl7Qps35Zn2idoV3T72Y9wKntW1yCVaZ4kvHFWXewcLoeI4+Q4IKpm3u1171Q==;5:Tb8j5EtbvVT+CD9kEDYmFK1LA1Va+eLh57UTxh2LsU+cTGdOSUktvwknRfuW37us1uH55O4x0Bn25otrFbR0dre8+Y2p7O6rNXed2fOnvjuJekZ2g/i807dKfGAkLZYi67dEV1tZk3xa30b/TPJyjw==;24:PDDW3l561SmRshsmZPlryCdM+h1y/vSpz9HCb3MXsUgCKZoUgNWkEkh/YUF63sdl3ZXpb9ttC0rMZsJ4/+0MsgagQc4NTEBa94fLZAE8EZc=;7:4JK//b96pm7maHPSpI+dbchsy1/j4caUoJGK1xQNU2/udW8lFqBBmwRc5X7QrBFwf+GfGnMFCdyf9D8uAj9mIzXYVyhPdZQtmQYjEnd2BDBVJP6F2UL3a6uoxKJUNMcdAgk6mxFdXjUq8GjZXeHrLq0Ppau+xBupLBwHsNUfDhyg/Qqq0HDFUlcE0Zt8NFlC/6MKPINv/awCl4bvU7uxrqUgZxT8wfCJ3ztsygqym2A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2017 11:54:26.3001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52d28222-ee3f-4fdd-7395-08d5148ca68f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB433 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNKsWRmVeSWpSXmKPExsUyM2J7uO63uU8iDa606lv0rUm2OPfuH7MD k8e3a9/YPXbOussewBTFZZOSmpNZllqkb5fAlbH25z/WgjV9TBXfW5cwNTBOKOpi5OSQEDCR mP9+C2MXIxeHkMARRombJw6zQzgnGCUevlwLlmER6GWWWDr1CitIC6NAukTnpGMsEFUdTBI3 5txlB0kICzhJzPmzkxnEFhHwkdh3oBvMFhJ4wyRxYEpqFyMHB5uAi8TRI4wgYX4BSYkNDbvB SngF7CVm3FkGNoZFQFWi+z/IfE4OUYEIiefN71khagQlTs58AhbnFAiUuHNiK9gcZoEwiZlz +9khbHGJW0/mM0G8piBxbM4MsDslBCYzSqx/MpUJ4h5DifaOS6wQRb4Sa7tXskMUzWWUWL33 NBtUB7tE9+M2RogqWYmjZ+ewQNiaEre67kAVPWaTWPhrEzNEwlri5s2DUEWZEl27u1ghik6y SvzZfhmqSEZiTXszG4R9nE3i6AmNCYzas5D8NwvJT7OQ/ARhW0jMnH+eEcLWlli28DUzhK0h 0TpnLjuy+AJG9lWMosWpxcW56UbGeqlFmcnFxfl5enmpJZsYgUno4JbfujsYV792PMQowMGo xMO7uetJpBBrYllxZe4hRgkOZiUR3kfTgUK8KYmVValF+fFFpTmpxYcYpTlYlMR5HfZdiBAS SE8sSc1OTS1ILYLJMnFwSjUwshux2KXffvbJ1L7n6rZfoutfSDzvejy52JB/7vdvDnZmfTJB DPlRa0xdRZsVre4GWV5wnWof6i327LTrIy7tqNLtTHtmb+Vv4jPanHhqb26p2sSGfIcVU2Lf R/15V8jfqr4lumBNzqxlHqIhLI0rPZufX7lzaqbY7oQJUQpaCX6JZ+dauJkpsRRnJBpqMRcV JwIAJx0ICz4DAAA= archived-at: Mon, 16 Oct 2017 11:54:47 -0000 --------------0872843F53008A055A2EF969 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Looking at the code in trunk, the stopdemon command invokes the=20 CassandraDaemon.stop() function which does a graceful shutdown by=20 stopping jmxServer and drains the node by the shutdown hook. /Simon On 2017-10-13 20:42, Javier Canillas wrote: > As far as I know, the nodetool stopdaemon is doing a "kill -9". > > Or did it change? > > 2017-10-12 23:49 GMT-03:00 Anshu Vajpayee >: > > Why are you killing when we have nodetool stopdaemon ? > > On Fri, Oct 13, 2017 at 1:49 AM, Javier Canillas > > wrot= e: > > That's what I thought. > > Thanks! > > 2017-10-12 14:26 GMT-03:00 Hannu Kr=C3=B6ger >: > > Hi, > > Drain should be enough.=C2=A0 It stops accepting writes and= > after that cassandra can be safely shut down. > > Hannu > > On 12 October 2017 at 20:24:41, Javier Canillas > (javier.canillas@gmail.com > ) wrote: > >> Hello everyone, >> >> I have some time working with Cassandra, but every time I >> need to shutdown a node (for any reason like upgrading >> version or moving instance to another host) I see several >> errors on the client applications (yes, I'm using the >> official java driver). >> >> By the way, I'm starting C* as a stand-alone process >> , >> and C* version is 3.11.0. >> >> The way I have implemented the shutdown process is >> something like the following: >> >> /# Drain all information from commitlog into sstables/ >> /bin/nodetool drain >> / >> / >> / >> /cassandra_pid=3D`ps -ef|grep "java.*apache-cassandra"|gre= p >> -v "grep"|awk '{print $2}'` >> / >> /if [ ! -z "$cassandra_pid" ] && [ "$cassandra_pid" -ne >> "1" ]; then/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "Asking Cassandra to shu= tdown (nodetool >> drain doesn't stop cassandra)"/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 kill $cassandra_pid/ >> / >> / >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo -n "+ Checking it is dow= n. "/ >> /counter=3D10/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 while [ "$counter" -ne 0 -a != kill -0 >> $cassandra_pid > /dev/null 2>&1 ]/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 do/ >> /echo -n ". "/ >> /((counter--))/ >> /sleep 1s/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 done/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo ""/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ! kill -0 $cassandra_pid >= /dev/null 2>&1; then/ >> /echo "+ Its down."/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 else/ >> /echo "- Killing Cassandra."/ >> /kill -9 $cassandra_pid/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi/ >> /else/ >> /=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "Care there was a proble= m finding Cassandra >> PID"/ >> /fi/ >> / >> / >> Should I add at the beginning the following lines? >> >> echo "shutdowing cassandra gracefully with: nodetool >> disable gossip" >> $CASSANDRA_HOME/$CASSANDRA_APP/bin/nodetool disablegossip >> echo "shutdowing cassandra gracefully with: nodetool >> disable binary protocol" >> $CASSANDRA_HOME/$CASSANDRA_APP/bin/nodetool disablebinary >> echo "shutdowing cassandra gracefully with: nodetool thrif= t" >> $CASSANDRA_HOME/$CASSANDRA_APP/bin/nodetool disablethrift >> >> The shutdown log is the following: >> >> /WARN=C2=A0 [RMI TCP Connection(10)-127.0.0.1] 2017-10-12 >> 14:20:52,343 StorageService.java:321 - Stopping gossip by >> operator request/ >> /INFO=C2=A0 [RMI TCP Connection(10)-127.0.0.1] 2017-10-12 >> 14:20:52,344 Gossiper.java:1532 - Announcing shutdown/ >> /INFO=C2=A0 [RMI TCP Connection(10)-127.0.0.1] 2017-10-12 >> 14:20:52,355 StorageService.java:2268 - Node >> /10.254.169.36 state jump to shutdo= wn/ >> /INFO=C2=A0 [RMI TCP Connection(12)-127.0.0.1] 2017-10-12 >> 14:20:56,141 Server.java:176 - Stop listening for CQL >> clients/ >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:20:59,472 StorageService.java:1442 - DRAINING: >> starting drain process/ >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:20:59,474 HintsService.java:220 - Paused hints dispatch= / >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:20:59,477 Gossiper.java:1532 - Announcing shutdown/ >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:20:59,480 StorageService.java:2268 - Node /127.0.0.1 >> state jump to shutdown/ >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:21:01,483 MessagingService.java:984 - Waiting for >> messaging service to quiesce/ >> /INFO [ACCEPT-/192.168.6.174 ] >> 2017-10-12 14:21:01,485 MessagingService.java:1338 - >> MessagingService has terminated the accept() thread/ >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:21:02,095 HintsService.java:220 - Paused hints dispatch= / >> /INFO=C2=A0 [RMI TCP Connection(16)-127.0.0.1] 2017-10-12 >> 14:21:02,111 StorageService.java:1442 - DRAINED/ >> >> Disabling Gossip seemed a good idea, but watching the >> logs, it may use it to gracefully telling the other nodes >> he is going down, so I don't know if it's good or bad idea= =2E >> >> Disabling Thrift and Binary protocol should only avoid >> new connections, but the one stablished and running >> should be attempted to finish. >> >> Any thoughts or comments? >> >> Thanks >> >> Javier. >> >> > > > > > --=20 > *Regards,* > *Anshu * > * > * > > --------------0872843F53008A055A2EF969 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Looking at the code in trunk, the stopdemon command invokes the CassandraDaemon.stop() function which does a graceful shutdown by stopping jmxServer and drains the node by the shutdown hook.

/Simon

On 2017-10-13 20:42, Javier Canillas wrote:
As far as I know, the nodetool stopdaemon is doing= a "kill -9".

Or did it change?

2017-10-12 23:49 GMT-03:00 Anshu Vajpayee <anshu.vajpayee@gmail.com>:
Why are you killing when we have nodetool stopdaemon ?=C2=A0

On Fri, Oct 13, 2017 at 1:49= AM, Javier Canillas <javier= =2Ecanillas@gmail.com> wrote:
That's what I thought.

Thanks!

2017-10-12 14:26 GMT-03:00 Hannu Kr=C3=B6ger <hkroger@gmail.com>:
Hi,

Drain should be enough.=C2=A0 It stops accepting writes and after that cassandra can be safely shut down.

Hannu

On 12 October 2017 at 20:24:41, Javier Canillas (javier= =2Ecanillas@gmail.com) wrote:

Hello everyone,

I have some time working with Cassandra, but every time I need to shutdown a node (for any reason like upgrading version or moving instance to another host) I see several errors on the client applications (yes, I'm using the official java driver).

By the way, I'm starting C* as a stand-alone process, and C* version is 3.11.0.

The way I have implemented the shutdown process is something like the following:

# Drain all information from commitlog into sstables
bin/nodetool drain

cassandra_pid=3D`= ps -ef|grep "java.*apache-cassand= ra"|grep -v "grep"|awk '{print $2}'`
if [ ! -z "$cassandra_pid" ] && [ "$cassandra_pid" -ne "1" ]; then=
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 echo "Asking Cassandra to shutdown (nodetool drain doesn't stop cassandra)"
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 kill $cassandra_pid<= /div>

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 echo -n "+ Checking it is down. "
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 counter=3D10
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 while [ "$counter" -ne 0 -a ! kill -0 $cassandra_pid > /dev/null 2>&1 ]
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 do
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo -n ". "
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((counter--))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep 1s
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 done
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 echo ""
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 if ! kill -0 $cassandra_pid > /dev/null 2>&1; then
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "+ Its down."<= /i>
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 else
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "- Killing Cassandra."
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kill -9 $cassandra_pid<= /div>
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 fi
else
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 echo "Care there was a problem finding Cassandra PID"
fi

Should I add at the beginning the following lines?

echo "shutdowing cassandra gracefully with: nodetool disable gossip"
$CASSANDRA_HOME/$C= ASSANDRA_APP/bin/nodetool disablegossip
echo "shutdowing cassandra gracefully with: nodetool disable binary protocol"
$CASSANDRA_HOME/$C= ASSANDRA_APP/bin/nodetool disablebinary
echo "shutdowing cassandra gracefully with: nodetool thrift"
$CASSANDRA_HOME/$C= ASSANDRA_APP/bin/nodetool disablethrift

The shutdown log is the following:

WARN=C2=A0 [RMI= TCP Connection(10)-127.0.0.1] 2017-10-12 14:20:52,343 StorageService.java= :321 - Stopping gossip by operator request
INFO=C2=A0 [RMI= TCP Connection(10)-127.0.0.1] 2017-10-12 14:20:52,344 Gossiper.java:1532 - Announcing shutdown
INFO=C2=A0 [RMI= TCP Connection(10)-127.0.0.1] 2017-10-12 14:20:52,355 StorageService.java= :2268 - Node /10.254.169.36 state jump to shutdown
INFO=C2=A0 [RMI= TCP Connection(12)-127.0.0.1] 2017-10-12 14:20:56,141 Server.java:176 - Stop listening for CQL clients
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:20:59,472 StorageService.java= :1442 - DRAINING: starting drain process
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:20:59,474 HintsService.java:2= 20 - Paused hints dispatch
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:20:59,477 Gossiper.java:1532 - Announcing shutdown
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:21:01,483 MessagingService.ja= va:984 - Waiting for messaging service to quiesce<= /i>
INFO=C2=A0 [ACCEPT-/192.168.6.174] 2017-10-12 14:21:01,485 MessagingService.java:1338 - MessagingService has terminated the accept() thread=
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:21:02,095 HintsService.java:2= 20 - Paused hints dispatch
INFO=C2=A0 [RMI= TCP Connection(16)-127.0.0.1] 2017-10-12 14:21:02,111 StorageService.java= :1442 - DRAINED
=

Disabling Gossip seemed a good idea, but watching the logs, it may use it to gracefully telling the other nodes he is going down, so I don't know if it's good or bad idea.<= /div>

Disabling Thrift and Binary protocol should only avoid new connections, but the one stablished and running should be attempted to finish.

Any thoughts or comments?

Thanks

Javier.






--
Regards,=
Anshu=C2=A0




--------------0872843F53008A055A2EF969--