Configuring an External Database for Oozie
See the following sections for the procedures for setting one of the supported database types for Oozie and configuring database purge settings.
Configuring PostgreSQL for Oozie
Create the Oozie User and Oozie Database
For example, using the PostgreSQL psql command-line tool:
$ psql -U postgres Password for user postgres: ***** postgres=# CREATE ROLE oozie LOGIN ENCRYPTED PASSWORD 'oozie' NOSUPERUSER INHERIT CREATEDB NOCREATEROLE; CREATE ROLE postgres=# CREATE DATABASE "oozie" WITH OWNER = oozie ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' CONNECTION LIMIT = -1; CREATE DATABASE postgres=# \q
Configure PostgreSQL to Accept Network Connections for the Oozie User
- Edit the postgresql.conf file and set the listen_addresses property to *, to make sure that the PostgreSQL server starts listening on all your network interfaces. Also make sure that the standard_conforming_strings property is set to off.
- Edit the PostgreSQL data/pg_hba.conf file as follows:
host oozie oozie 0.0.0.0/0 md5
Configuring MariaDB for Oozie
Create the Oozie Database and Oozie MariaDB User
For example, using the MariaDB mysql command-line tool:
$ mysql -u root -p Enter password: MariaDB [(none)]> create database oozie default character set utf8; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye
Configuring MySQL for Oozie
Create the Oozie Database and Oozie MySQL User
For example, using the MySQL mysql command-line tool:
$ mysql -u root -p Enter password: mysql> create database oozie default character set utf8; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie'; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye
Configuring Oracle for Oozie
Create the Oozie Oracle User and Grant Privileges
The following example uses the Oracle sqlplus command-line tool, and shows the privileges Cloudera recommends. Oozie needs CREATE SESSION to start and manage workflows. The additional roles are needed for creating and upgrading the Oozie database.
$ sqlplus system@localhost Enter password: ****** SQL> create user oozie identified by oozie default tablespace users temporary tablespace temp; User created. SQL> grant alter index to oozie; grant alter table to oozie; grant create index to oozie; grant create sequence to oozie; grant create session to oozie; grant create table to oozie; grant drop sequence to oozie; grant select dictionary to oozie; grant drop table to oozie; alter user oozie quota unlimited on users; alter user oozie quota unlimited on system; SQL> exit $
Configuring Oozie Data Purge Settings
You can change your Oozie configuration to control when data is purged to improve performance, cut down on database disk usage, or to keep the history for a longer period of time. Limiting the size of the Oozie database can also improve performance during upgrades. See Configuring Oozie Data Purge Settings Using Cloudera Manager.