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

Review request for Ambari and Andrew Onischuk.


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


Repository: ambari


Description
-------

The MySQL service check 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. 

As a side-note: the initial fix tried to get the pid_file from the /etc/my.cnf 
file but I found that while this is one default location for the MySQL 
configuration, there are other places where the file can be referenced. Since 
the MySQL instance launched by Hive is not getting any parameters for config 
file or pid_file, MySQL must read it from one of the default locations and 
running "mysqladmin variables" must return the config values for the running 
instance used by Hive. The other instance running needs to explicitely set 
values for config file and pid because otherwise would collide with the default 
instance.


Diffs
-----

  
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_service.py
 c48c1ef 
  ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py 1155e9f 

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


Testing
-------

Updated UTs in test_mysql_server.py with new status command and ran them 
successfully. Also manually tested in an installed cluster environment.


Thanks,

Thomas Friedrich

Reply via email to