Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFBAF11BAD for ; Wed, 25 Jun 2014 22:34:24 +0000 (UTC) Received: (qmail 55500 invoked by uid 500); 25 Jun 2014 22:34:24 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 55453 invoked by uid 500); 25 Jun 2014 22:34:24 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 55440 invoked by uid 99); 25 Jun 2014 22:34:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 22:34:24 +0000 Date: Wed, 25 Jun 2014 22:34:24 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-9531) a command line (hbase shell) interface to retreive the replication metrics and show replication lag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-9531?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1404= 4138#comment-14044138 ]=20 Andrew Purtell commented on HBASE-9531: --------------------------------------- bq. The code in admin.rb will only check 2nd argument if the first arg is '= replication', otherwise, the code flow will go to the existing 'summary'/de= fault logic, and won't contain the replication information. I will double c= heck it. Ok. Might be good to have a summary option for replication by default but n= ot necessary > a command line (hbase shell) interface to retreive the replication metric= s and show replication lag > -------------------------------------------------------------------------= -------------------------- > > Key: HBASE-9531 > URL: https://issues.apache.org/jira/browse/HBASE-9531 > Project: HBase > Issue Type: New Feature > Components: Replication > Affects Versions: 0.99.0 > Reporter: Demai Ni > Assignee: Demai Ni > Fix For: 0.99.0, 0.98.5 > > Attachments: HBASE-9531-trunk-v0.patch, HBASE-9531-trunk-v0.patch > > > This jira is to provide a command line (hbase shell) interface to retreiv= e the replication metrics info such as:ageOfLastShippedOp, timeStampsOfLast= ShippedOp, sizeOfLogQueue ageOfLastAppliedOp, and timeStampsOfLastAppliedOp= . And also to provide a point of time info of the lag of replication(source= only) > Understand that hbase is using Hadoop metrics(http://hbase.apache.org/met= rics.html), which is a common way to monitor metric info. This Jira is to s= erve as a light-weight client interface, comparing to a completed(certainly= better, but heavier)GUI monitoring package. I made the code works on 0.94.= 9 now, and like to use this jira to get opinions about whether the feature = is valuable to other users/workshop. If so, I will build a trunk patch.=20 > All inputs are greatly appreciated. Thank you! > The overall design is to reuse the existing logic which supports hbase sh= ell command 'status', and invent a new module, called ReplicationLoad. In = HRegionServer.buildServerLoad() , use the local replication service objects= to get their loads which could be wrapped in a ReplicationLoad object and= then simply pass it to the ServerLoad. In ReplicationSourceMetrics and Rep= licationSinkMetrics, a few getters and setters will be created, and ask Rep= lication to build a "ReplicationLoad". (many thanks to Jean-Daniel for his= kindly suggestions through dev email list) > the replication lag will be calculated for source only, and use this form= ula:=20 > {code:title=3DReplication lag|borderStyle=3Dsolid} > =09if sizeOfLogQueue !=3D 0 then max(ageOfLastShippedOp, (current time - = timeStampsOfLastShippedOp)) //err on the large side > =09else if (current time - timeStampsOfLastShippedOp) < 2* ageOfLastShipp= edOp then lag =3D ageOfLastShippedOp // last shipped happen recently=20 > else lag =3D 0 // last shipped may happens last night, so NO real= lag although ageOfLastShippedOp is non-zero > {code} > External will look something like: > {code:title=3Dstatus 'replication'|borderStyle=3Dsolid} > hbase(main):001:0> status 'replication' > version 0.94.9 > 3 live servers > =C2=A0=C2=A0=C2=A0 hdtest017.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D14, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14= :49:48 PDT 2013 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D0, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:48:48 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest018.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D0, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14:= 48:48 PDT 2013 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D14, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:50:59 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest015.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D0, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14:= 48:48 PDT 2013 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D0, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:48:48 PDT 2013 > hbase(main):002:0> status 'replication','source' > version 0.94.9 > 3 live servers > =C2=A0=C2=A0=C2=A0 hdtest017.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D14, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14= :49:48 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest018.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D0, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14:= 48:48 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest015.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SOURCE:PeerID=3D1, ageOfLastSh= ippedOp=3D0, sizeOfLogQueue=3D0, timeStampsOfLastShippedOp=3DWed Sep 04 14:= 48:48 PDT 2013 > hbase(main):003:0> status 'replication','sink' > version 0.94.9 > 3 live servers > =C2=A0=C2=A0=C2=A0 hdtest017.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D0, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:48:48 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest018.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D14, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:50:59 PDT 2013 > =C2=A0=C2=A0=C2=A0 hdtest015.svl.ibm.com: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SINK=C2=A0 :AgeOfLastAppliedOp= =3D0, TimeStampsOfLastAppliedOp=3DWed Sep 04 14:48:48 PDT 2013 > hbase(main):003:0> status 'replication','lag'=20 > version 0.94.9 > 3 live servers > =C2=A0=C2=A0=C2=A0 hdtest017.svl.ibm.com: lag =3D 0 > =C2=A0=C2=A0=C2=A0 hdtest018.svl.ibm.com: lag =3D 14 > =C2=A0=C2=A0=C2=A0 hdtest015.svl.ibm.com: lag =3D 0 > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)