-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48766/
-----------------------------------------------------------

(Updated June 16, 2016, 9:20 p.m.)


Review request for Ambari, Alejandro Fernandez, Andrew Onischuk, and Dmitro 
Lisnichenko.


Changes
-------

Added changes using  shell.checked_call() and raise exception in case 
mysqladmin variables cant be run

Command mysqladmin variables verified in several OS (REHL 6 and 7, CentOS 6.7, 
SLES 12 and Ubuntu 14.04)

REHL 6.6:
[root@fond1 ~]# lsb_release -a
LSB Version:    
:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release:        6.6
Codename:       Santiago

    service mysqld status
    mysqladmin variables

REHL 6.8:
[root@epps1 ~]# lsb_release -a
LSB Version:    
:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.8 (Santiago)
Release:        6.8
Codename:       Santiago

    service mysqld status
    mysqladmin variables
 
REHL 7:
[root@fall1 ~]# cat /etc/*-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/";
BUG_REPORT_URL="https://bugzilla.redhat.com/";

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"
Red Hat Enterprise Linux Server release 7.2 (Maipo)
Red Hat Enterprise Linux Server release 7.2 (Maipo)

    systemctl status mariadb
    mysqladmin variables
 
CentOS 6.7:
[root@farm1 ~]# cat /etc/*-release
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)

    service mysqld status
    mysqladmin variables

SLES 12:
chest1:~ # cat /etc/*-release
SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 0
# This file is deprecated and will be removed in a future service pack or 
release.
# Please check /etc/os-release for details about this release.
NAME="SLES"
VERSION="12"
VERSION_ID="12"
PRETTY_NAME="SUSE Linux Enterprise Server 12"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12"

    service mysql status
    mysqladmin variables

Ubuntu 14.04:
root@houck1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:        14.04
Codename:       trusty

    service mysql status
    mysqladmin variables


Bugs: AMBARI-13238
    https://issues.apache.org/jira/browse/AMBARI-13238


Repository: ambari


Description
-------

The MySQL service status in mysql_service.py simply checks for a process with 
name mysqld. In our environment, a different service ran another MySQL instance 
on that node and as a result, the status of the MySQL service in Hive showed 
green (because it could find a mysqld process) even though the instance used by 
Hive wasn't started. That also made the "Start Service" action for Hive fail, 
because the metastore service couldn't connect to the MySQL database.

The proposed fix makes the service check more robust by retrieving the pid_file 
of the MySQL instance first by running "mysqladmin variables" and parsing out 
the pid_file. Then it checks if the process exists. 

A new pacth is proposed based on the reviews added to the original one 
(https://reviews.apache.org/r/39146/)

The patch relies now on the pid (similar to other status check). mysql pid_file 
is not known a priori (it is not a service property similar to other ambari 
components) and it depends on the OS. 
The pid file location is obatined with  "mysqladmin variables" command (which 
seems recognized by all the Ambari supported OS). 
The Hive MySQL server instance is started without passing in any parameters so 
It uses the default configuration. Any other MySQL instance that could be 
running on the machine would need to be started with explicit config.
Hence just running mysqladmin will return the values for the Hive MySQL 
instance.
The pid dile name is parsed by a new method which has been created to obatin it 
from the mysqladmin variables return.
The status relies now on check_process_status() wich is already an ambari 
function.
Unit Test have been modified accordingly to avoid the pgrep verification that 
could create conflicts with others mysql instances working on the same node.


Diffs (updated)
-----

  
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
 7862774 
  ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py 827f6f7 

Diff: https://reviews.apache.org/r/48766/diff/


Testing
-------

+1 overall. Here are the results of testing the latest attachment 
http://issues.apache.org/jira/secure/attachment/12810584/AMBARI-13238.patch
against trunk revision .
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 1 new or modified test files.
+1 javac. The applied patch does not increase the total number of javac 
compiler warnings.
+1 release audit. The applied patch does not increase the total number of 
release audit warnings.
+1 core tests. The patch passed unit tests in ambari-server.
Test results: 
https://builds.apache.org/job/Ambari-trunk-test-patch/7367//testReport/
Console output: 
https://builds.apache.org/job/Ambari-trunk-test-patch/7367//console
This message is automatically generated.


Thanks,

Juanjo  Marron

Reply via email to