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 1A93518BEA for ; Wed, 6 May 2015 11:49:33 +0000 (UTC) Received: (qmail 49911 invoked by uid 500); 6 May 2015 11:49:33 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 49879 invoked by uid 500); 6 May 2015 11:49:33 -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 49859 invoked by uid 99); 6 May 2015 11:49:32 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 11:49:32 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 031141DBE77; Wed, 6 May 2015 11:49:34 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8003666783070360250==" MIME-Version: 1.0 Subject: Review Request 33885: Hive Server 2 Process Check Should Always Use Beeline Instead of TCP Sockets From: "Dmitro Lisnichenko" To: "Andrew Onischuk" Cc: "Dmitro Lisnichenko" , "Ambari" Date: Wed, 06 May 2015 11:49:34 -0000 Message-ID: <20150506114934.1563.38817@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Dmitro Lisnichenko" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/33885/ X-Sender: "Dmitro Lisnichenko" Reply-To: "Dmitro Lisnichenko" X-ReviewRequest-Repository: ambari --===============8003666783070360250== 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/33885/ ----------------------------------------------------------- Review request for Ambari and Andrew Onischuk. Bugs: AMBARI-10953 https://issues.apache.org/jira/browse/AMBARI-10953 Repository: ambari Description ------- ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py uses a combination of beeline and sockets to check the availability of the Hive server. Hive Server can be configured to run in either binary or http mode, as configured by the following property in hive-site: hive.server2.transport.mode binary The python, however, only runs the beeline command if KERBEROS is in use AND the mode is binary. This not correct in that beeline can connect via both TCP and HTTP: beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10000/;transportMode=binary' -e '' beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10001/;transportMode=http' -e '' Additionally, alert_hive_thrift_port.py needs to provide a better error message. Currently, the code try: hive_check.check_thrift_port_sasl(host_name, port, hive_server2_authentication, hive_server_principal, kinitcmd, smokeuser, transport_mode = transport_mode) is_thrift_port_ok = True except: is_thrift_port_ok = False if is_thrift_port_ok == True: result_code = 'OK' total_time = time.time() - start_time label = OK_MESSAGE % (total_time, port) else: result_code = 'CRITICAL' label = CRITICAL_MESSAGE.format(host_name,port) will not show the exact error message and instead just say that it couldn't connect to host:port, which is wrong since that implies the only failure could be TCP-based. I recommend putting the exception message in as well. Diffs ----- ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py f0036be ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 35217fc ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py 0d5d580 ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py 38bdced ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py 03af5b6 ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py c08332a ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py e43917d Diff: https://reviews.apache.org/r/33885/diff/ Testing ------- ---------------------------------------------------------------------- Ran 263 tests in 6.238s OK ---------------------------------------------------------------------- Total run:723 Total errors:0 Total failures:0 OK Process finished with exit code 0 Thanks, Dmitro Lisnichenko --===============8003666783070360250==--