IBM Support

IBM Open Platform with Apache Hadoop (IOP) 4.1 Ambari is not able to start the MariaDB database properly in RHEL 7

Product Documentation


Abstract

On RHEL 7, MariaDB replaced MySQL as the default database. As a result, an installation of IOP 4.1 on RHEL 7 uses this MariaDB database. However, some versions of the MariaDB do not have the mariadb service configured correctly and will cause Ambari to fail to start MariaDB.

Content

In RHEL 7, by default, MariaDB 5.5 is installed, and the mariadb service file is configured to manage MariaDB. In IOP 4.1, Ambari is coded to use "service mariadb start/stop" to manage MariaDB. Unfortunately, in some later versions of MariadDB, such as MariaDB 10.0, the mariadb service file is not set up. As a result, Ambari is not able to manage the MariaDB service.

When this problem occurs, Ambari indicates that it failed to start the "MySQL Server" during service start. As a result, the Hive service will not work properly since the Hive Metastore service depends on the MySQL Server unless it was configured otherwise.

In versions of MariaDB, such as 10.0, that do not have the mariadb service file configured, the MariaDB database configures the mysql service file only.

To address this problem, create an alias for mariadb that points to the mysql service file, This enables Ambari to manage MariaDB.

There are two service files that the MariaDB database might configure for the mysql service:

/usr/lib/systemd/system/mysql.service

and

/etc/rc.d/init.d/mysql


In MariaDB v10.0, MariaDB configures only the /etc/rc.d/init.d/mysql file. As a result, Ambari issues the following error when Ambari displays the message "service mariadb start:
"Failed to issue method call: Unit mariadb.service not loaded."

To fix this problem, locate the mysql service file and create symbolic links from MariaDB to MySQL.

Creating symbolic link:

1. Log on as the root or sudo user.
2. Locate the "mysql.service" from /usr/lib/systemd/system or "mysql" file from /etc/rc.d/init.d.
3. Create a symblic link to the file you found:

cd /etc/rc.d/init.d
sudo ln -s mysql mariadb

or

cd /usr/lib/systemd/system
sudo ln -s mysql.service mariadb.service

You should be able to start the MySQL Service in the Ambari UI successfully.

Note that the latest version of MariaDB 10.1 seems to have fixed this issue. Therefore, you can upgrade to MaraiDB 10.1 to fix the issue.

Original Publication Date

16 November 2015

[{"Product":{"code":"SSCRJT","label":"IBM Db2 Big SQL"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Install","Platform":[{"code":"PF016","label":"Linux"}],"Version":"4.1.0","Edition":"Enterprise Edition;Basic Edition;Community Edition;Quick Start Edition","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
18 July 2020

UID

swg27047058