Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2240AF314 for ; Wed, 5 Nov 2014 07:02:06 +0000 (UTC) Received: (qmail 88335 invoked by uid 500); 5 Nov 2014 07:02:04 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 88269 invoked by uid 500); 5 Nov 2014 07:02:04 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 88259 invoked by uid 99); 5 Nov 2014 07:02:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 07:02:04 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nitinpawar432@gmail.com designates 209.85.160.176 as permitted sender) Received: from [209.85.160.176] (HELO mail-yk0-f176.google.com) (209.85.160.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 07:01:59 +0000 Received: by mail-yk0-f176.google.com with SMTP id 10so54540ykt.35 for ; Tue, 04 Nov 2014 23:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TBPf+3+tDGKBKDgjEPyFNhFNaLTjFG4t3YZNxkEKry0=; b=AJGNq3KfgYbRr9BrX8/SZu0reS44g5gckfFqX0v/L5ot79EppDHdz40k+a6zRcGMnt o5WNE+s56WqdKQueyO0u7W12hZKYLFUSsFOleNMDaf5g95NV+m+TYtLdTc0wvl/GkRBm 7k976xos4cA0Hw94+ssPFE3nD63yh9oZVDf6VOBn+/4eLdEaKV7NSCv+kan2qLkZvY/9 ZXgOYr7TuXby9ZOo1UkoNMJ2Scd1Tv/8afVrajrtjehjp3T50qtWS9CK5733T91prN00 hYbfcNVZjNA8qvshqhpA0nRAraRezLc7unJVJ/mTQ0blcJ2gOaRbh5tkPcy8Izu1IXZy C92w== MIME-Version: 1.0 X-Received: by 10.236.63.70 with SMTP id z46mr1841495yhc.187.1415170898615; Tue, 04 Nov 2014 23:01:38 -0800 (PST) Received: by 10.170.61.22 with HTTP; Tue, 4 Nov 2014 23:01:38 -0800 (PST) In-Reply-To: References: Date: Wed, 5 Nov 2014 12:31:38 +0530 Message-ID: Subject: Re: Unix script for identifying current active namenode in a HA cluster From: Nitin Pawar To: "user@hive.apache.org" Content-Type: multipart/alternative; boundary=089e013a2636b5649805071726ee X-Virus-Checked: Checked by ClamAV on apache.org --089e013a2636b5649805071726ee Content-Type: text/plain; charset=UTF-8 +1 If you can optionally add hadoop home directory in the script and use that in path, it can be used out of the box. Also can you share this on github On Wed, Nov 5, 2014 at 10:02 AM, Devopam Mittra wrote: > hi All, > Please find attached a simple shell script to dynamically determine the > active namenode in the HA Cluster and subsequently run the Hive job / query > via Talend OS generated workflows. > > It was tried successfully on a HDP2.1 cluster with 2 nn, 7 dn running on > CentOS 6.5. > Each ETL job invokes this script first in our framework to derive the NN > FQDN and then run the hive jobs subsequently to avoid failures. > Takes a max. of 2 secs to execute (small cost in our case, as compared to > dealing with a failure and then recalculating the NN to resubmit the job). > > Sharing it with you in case you can leverage the same without spending > effort to code it. > > Do share your feedback/ fixes if you spot any. > > -- > Devopam Mittra > Life and Relations are not binary > -- Nitin Pawar --089e013a2636b5649805071726ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
+1=C2=A0
If you can optionally add hadoop home directo= ry in the script and use that in path, it can be used out of the box.=C2=A0=

Also can you share this on github=C2=A0

On Wed, Nov 5, = 2014 at 10:02 AM, Devopam Mittra <devopam@gmail.com> wrote:<= br>
hi All,
Please find = attached a simple shell script to dynamically determine the active namenode= in the HA Cluster and subsequently run the Hive job / query via Talend OS = generated workflows.

It was tried succ= essfully on a HDP2.1 cluster with 2 nn, 7 dn running on CentOS 6.5.
Each ETL job invokes this script first in our framework to derive the NN= FQDN and then run the hive jobs subsequently to avoid failures.=C2=A0
Takes a max. of 2 secs to execute (small cost in our case, as compare= d to dealing with a failure and then recalculating the NN to resubmit the j= ob).

Sharing it with you in case you can leverage = the same without spending effort to code it.

Do sh= are your feedback/ fixes if you spot any.

--
Devopam Mittra
Life and Re= lations are not binary



--
Nitin Pawar
--089e013a2636b5649805071726ee--