From user-return-11565-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Jul 17 11:42:22 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D73D7180600 for ; Tue, 17 Jul 2018 11:42:21 +0200 (CEST) Received: (qmail 75042 invoked by uid 500); 17 Jul 2018 09:42:20 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 75030 invoked by uid 99); 17 Jul 2018 09:42:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2018 09:42:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 79122C0102 for ; Tue, 17 Jul 2018 09:42:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.899 X-Spam-Level: * X-Spam-Status: No, score=1.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CLUXA_DVs0QL for ; Tue, 17 Jul 2018 09:42:18 +0000 (UTC) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AE4CE5F1E4 for ; Tue, 17 Jul 2018 09:42:17 +0000 (UTC) Received: by mail-pf0-f180.google.com with SMTP id c21-v6so246340pfn.8 for ; Tue, 17 Jul 2018 02:42:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=0hNoPzLS4+vveZifB3IgbvmfOSj1NeQgfcumDWT6cMw=; b=eDYLxMEPzN2N7pos2cuzEClKKrJDUt31Zhdg3qo7EFNtie10MRBUYCXeLXaH0ffDrW B3mv4RyZDTdVg6deg1b3IfRD6zBSyD2ATnQp0qMBykTGcY8m97DiRKn23nCo4VUbDf4b YtjdgcJ+qofIekFLZoWEuxpUQxBznSkAnYlVyfaIxISIzjsRCWSQeMkdSs9hqupi9RWm aNMMkTAAQcjJYs6HbgxSjvHVdR4BLjx4UpCoIRZhepPzZXRRUqF6i8NULzTRBfvyOsbL OS3Fv+u7k935wgIS5HJmIWvU7cKCZBdw/DkqkMPgN8Hvbi10vFz1Ryn6gg28vMih7wqO 8Z1A== X-Gm-Message-State: AOUpUlEAuDOkQH6iVHl+W6Nf68m0IswfWZzOK9LiFafB1JDSiOBrz6Si Qpnlda9KDFfyViOeou76zi2Srk7BS7VHK5/yNl18fOu9 X-Google-Smtp-Source: AAOMgpfU0WEUXbrM/mg9a8osz7IMz2+tJ7cJ5e5z7kYzi3lvzoaqq65fIDiC4Pd+QMd5HNN91eb/SmMTFK4ziW1fFvA= X-Received: by 2002:a63:5350:: with SMTP id t16-v6mr883158pgl.196.1531820535607; Tue, 17 Jul 2018 02:42:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Norbert Kalmar Date: Tue, 17 Jul 2018 11:42:04 +0200 Message-ID: Subject: Re: ZooKeeper Cluster Health Checking To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="000000000000e2931905712ec283" --000000000000e2931905712ec283 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Adrien, Take a look at monitoring in src/contrib/monitoring - it does what you would like to achieve, in python. Read the README for more information: https://github.com/apache/zookeeper/tree/master/src/contrib/monitoring If this one is not good for you, you can use JMX to query MBeans. A heads-up: At some point, 4letter words will be deprecated and possibly removed due to security issues. Regards, Norbert On Tue, Jul 17, 2018 at 8:00 AM adrien ruffie wrote: > Hi Harish, > > > thank you very much for this advise and explanation ! > > Do you think with just a simple script shell for checking all this metric= s > is enough ? Or would better to do it in a Java with a simple monitoring > application? > > > Thank again, > > > Best regards, > > > Adrien > > ________________________________ > De : harish lohar > Envoy=C3=A9 : mardi 17 juillet 2018 04:13:51 > =C3=80 : user@zookeeper.apache.org > Objet : Re: ZooKeeper Cluster Health Checking > > Hi Adrian, > Below zookeeper commands are generally used to get health of zookeeper > cluster > stat > > Lists brief details for the server and connected clients. > > usage echo stat | nc server port > > This gives whether cluster is up /down. If down this will give that > > Zookeeper instance is currently not serving any request - which means > either the leader election is failing or <=3D 50% of zookeeper node in > cluster are down. > > > mntr > > *New in 3.4.0:* Outputs a list of variables that could be used for > monitoring the health of the cluster. > > $ echo mntr | nc localhost 2185 > > zk_version 3.4.0 > zk_avg_latency 0 > zk_max_latency 0 > zk_min_latency 0 > zk_packets_received 70 > zk_packets_sent 69 > zk_outstanding_requests 0 > zk_server_state leader > zk_znode_count 4 > zk_watch_count 0 > zk_ephemerals_count 0 > zk_approximate_data_size 27 > zk_followers 4 - only exposed by the Leader > zk_synced_followers 4 - only exposed by the Leader > zk_pending_syncs 0 - only exposed by the Leader > zk_open_file_descriptor_count 23 - only available on Unix platforms > zk_max_file_descriptor_count 1024 - only available on Unix platforms > > The output is compatible with java properties format and the content may > change over time (new keys added). Your scripts should expect changes. > > ATTENTION: Some of the keys are platform specific and some of the keys ar= e > only exported by the Leader. > > The output contains multiple lines with the following format: > > > On Mon, Jul 16, 2018 at 10:13 AM adrien ruffie > wrote: > > > Hello all, > > > > > > In my company we have a Zookeeper production cluster. > > > > > > But we don't really know how can we check the health of our cluster... > > > > > > Can we advise us about this topic ? > > > > > > I know this topic may has been cropping up for a while, but I don't > really > > found any concrete solution. > > > > > > Do you use a monitoring tools ? Which can launch alert ? > > > > What metrics/properties/any thing which can indicate that our cluster > > isn't in good health. > > > > > > Thank you very much and best regards > > > > > > Adrien > > > --000000000000e2931905712ec283--