Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C13910A43 for ; Fri, 28 Aug 2015 07:03:56 +0000 (UTC) Received: (qmail 61014 invoked by uid 500); 28 Aug 2015 07:03:56 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 60978 invoked by uid 500); 28 Aug 2015 07:03:56 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 60963 invoked by uid 99); 28 Aug 2015 07:03:55 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 07:03:55 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 09A1D1C1601; Fri, 28 Aug 2015 07:03:55 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6902697433150158381==" MIME-Version: 1.0 Subject: Review Request 37875: Ambari Views Framework - need support for accessing RM running under HA From: "DIPAYAN BHOWMICK" To: "Yusaku Sako" , "Sid Wagle" , "Srimanth Gunturi" Cc: "DIPAYAN BHOWMICK" , "Ambari" Date: Fri, 28 Aug 2015 07:03:55 -0000 Message-ID: <20150828070355.13584.58206@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "DIPAYAN BHOWMICK" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/37875/ X-Sender: "DIPAYAN BHOWMICK" Reply-To: "DIPAYAN BHOWMICK" X-ReviewRequest-Repository: ambari --===============6902697433150158381== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/37875/ ----------------------------------------------------------- Review request for Ambari, Srimanth Gunturi, Sid Wagle, and Yusaku Sako. Bugs: AMBARI-12910 https://issues.apache.org/jira/browse/AMBARI-12910 Repository: ambari Description ------- The logic for getting the Active RM Url is modified. It is decribed below: ``` * If the view is attached to a cluster ** If RM HA is enabled(Check *"yarn.resourcemanager.ha.enabled"*) *** get the RM-IDs(Using *"yarn.resourcemanager.ha.rm-ids"*) *** get all the RM Hosts using the RM ids *** For each RM host **** hit *"/ws/v1/cluster/info"* **** If "haState" is "*ACTIVE*", this is the active URL and return the corresponding RM Url **** If "haState" is "*STANDBY*" this is the standby URL and continue loop with rest RM Url **** If the URL is not reachable, this cannot be a ACTIVE RM and hence ignore considering as STANDBY *** Throw Exception if none of the URL is reachable. ** if RM HA is disabled *** get the RM Url from "*yarn.resourcemanager.webapp.address*" or "*yarn.resourcemanager.webapp.https.address*" * if view is not attached to a cluster ** get the "*yarn.resourcemanager.url*" from the view property. This has been modified to take comma separated RM urls(all in HA) ** if no of Urls configured is 1 *** return that URL as active URL ** else *** get the Active RM Url using the same method as described above by hitting "*/ws/v1/cluster/info*" endpoint for each of the configured URL ``` This common util code is used in capacity schedular and hive, so these two components are fixed using these changes. For tez view we will have to fix separately in a different bug. Diffs ----- contrib/views/hive/src/main/resources/view.xml ed97213 contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java 0b49076 contrib/views/utils/src/test/java/org/apache/ambari/view/utils/ambari/ServicesTest.java PRE-CREATION Diff: https://reviews.apache.org/r/37875/diff/ Testing ------- Unit Test cases added to check the business logic. Locally ran unit tests and also manually tested in local VM. Thanks, DIPAYAN BHOWMICK --===============6902697433150158381==--