Note: Some SLES systems encounter errors when using the zypper install command. For more information on resolving
this issue, see the Novell Knowledgebase topic, error running chkconfig.

Ubuntu

sudo apt-get install mariadb-server

If these commands do not work, you might need to add a repository or use a different yum install command, particularly on RHEL 6 compatible operating
systems. For more assistance, see the following topics on the MariaDB website:

Configuring and Starting the MariaDB Server

Note: If you are making changes to an existing database, make sure to stop any services that use the database before continuing.

Stop the MariaDB server if it is running:

RHEL 7 compatible:

sudo systemctl stop mariadb

RHEL 6 compatible, Ubuntu, SLES:

sudo service mariadb stop

If they exist, move old InnoDB log files /var/lib/mysql/ib_logfile0 and /var/lib/mysql/ib_logfile1 out of /var/lib/mysql/ to a backup location.

Determine the location of the option file, my.cnf (/etc/my.cnf by default).

Update my.cnf so that it conforms to the following requirements:

To prevent deadlocks, set the isolation level to READ-COMMITTED.

The default settings in the MariaDB installations in most distributions use conservative buffer sizes and memory usage. Cloudera Management Service roles need high write throughput
because they might insert many records in the database. Cloudera recommends that you set the innodb_flush_method property to O_DIRECT.

Set the max_connections property according to the size of your cluster:

Fewer than 50 hosts - You can store more than one database (for example, both the Activity Monitor and Service Monitor) on the same host. If you do this, you should:

Put each database on its own storage volume.

Allow 100 maximum connections for each database and then add 50 extra connections. For example, for two databases, set the maximum connections to 250. If you store
five databases on one host (the databases for Cloudera Manager Server, Activity Monitor, Reports Manager, Cloudera Navigator, and Hive metastore), set the maximum connections to 550.

More than 50 hosts - Do not store more than one database on the same host. Use a separate host for each database/host pair. The hosts do not need to be reserved exclusively for
databases, but each database should be on a separate host.

If the cluster has more than 1000 hosts, set the max_allowed_packet property to 16M. Without this setting, the cluster may fail to start due to the following exception: com.mysql.jdbc.PacketTooBigException.

Although binary logging is not a requirement for Cloudera Manager installations, it provides benefits such as MariaDB replication or point-in-time incremental recovery after a database
restore. The provided example configuration enables the binary log. For more information, see The Binary
Log.

If AppArmor is running on the host where MariaDB is installed, you might need to configure AppArmor to allow MariaDB to write to the binary.

Ensure the MariaDB server starts at boot:

OS

Command

RHEL 7 compatible

sudo systemctl enable mariadb

RHEL 6 compatible

sudo chkconfig mariadb on

SLES

sudo chkconfig --add mariadb

Ubuntu

sudo chkconfig mariadb on

Note:chkconfig may not be available on recent Ubuntu releases. You may need to use Upstart to configure MariaDB to
start automatically when the system boots. For more information, see the Ubuntu documentation or the Upstart
Cookbook.

Start the MariaDB server:

RHEL 7 compatible:

sudo systemctl start mariadb

RHEL 6 compatible, Ubuntu, SLES:

sudo service mariadb start

Run /usr/bin/mysql_secure_installation to set the MariaDB root password and other security-related settings. In a new installation, the root password is blank. Press the Enter key when you're prompted for the root password. For the rest of the prompts, enter the responses listed below
in bold:

Installing the MySQL JDBC Driver for MariaDB

The MariaDB JDBC driver is not supported. Follow the steps in this section to install and use the MySQL JDBC driver instead.

Install the JDBC driver on the Cloudera Manager Server host, as well as any other hosts running services that require database access. For more information on Cloudera software that uses
databases, see Required Databases.

Cloudera recommends that you consolidate all roles that require databases on a limited number of hosts, and install the driver on those hosts. Locating all such roles on the same hosts
is recommended but not required. Make sure to install the JDBC driver on each host running roles that access the database.
Note: Cloudera recommends using only version 5.1 of the JDBC driver.

OS

Command

RHEL

Important: Using the yum install command to install the MySQL driver package before installing a JDK installs
OpenJDK, and then uses the Linux alternatives command to set the system JDK to be OpenJDK. To avoid this, make sure that you have installed the JDK before installing the MySQL driver using yum install.

Alternatively, use the following procedure to manually install the driver.

Creating Databases for Cloudera Software

Create databases and service accounts for components that require databases:

Cloudera Manager Server

Cloudera Management Service roles:

Activity Monitor (if using the MapReduce service in a CDH 5 cluster)

Reports Manager

Hue

Each Hive metastore

Sentry Server

Cloudera Navigator Audit Server

Cloudera Navigator Metadata Server

Oozie

Record the values you enter for database names, usernames, and passwords. The Cloudera Manager installation wizard requires this information to correctly connect to these databases.

Log in as the root user, or another user with privileges to create database and grant privileges:

mysql -u root -p

Enter password:

Create databases for each service deployed in the cluster using the following commands. You can use any value you want for the
<database>, <user>, and <password> parameters. The Databases for Cloudera Software table, below lists the default names provided in the Cloudera Manager configuration settings, but you are not required to use them.

Configure all databases to use the utf8 character set.

Include the character set for each database when you run the CREATE DATABASE statements described below.

If this documentation includes code, including but not limited to, code examples, Cloudera makes this available to you under the terms of the Apache License, Version 2.0, including any required
notices. A copy of the Apache License Version 2.0 can be found here.