Oracle Database
To use an Oracle database, follow these procedures.
- Collecting Oracle Database Information
- Configuring the Oracle Server
- Installing the Oracle JDBC Connector
- Creating Databases for the Cloudera Manager Server, Activity Monitor, Reports Manager, Hive Metastore Server, Sentry Server, Cloudera Navigator Audit Server, and Cloudera Navigator Metadata Server
Collecting Oracle Database Information
To configure Cloudera Manager to work with an Oracle database, get the following information from your Oracle DBA:
- Hostname - The DNS name or the IP address of the host where the Oracle database is installed.
- SID - The name of the schema that will store Cloudera Manager information.
- Username - A username for each schema that is storing information. You could have four unique usernames for the four schema.
- Password - A password corresponding to each user name.
Configuring the Oracle Server
Adjusting Oracle Settings to Accommodate Larger Clusters
- Enable direct and asynchronous I/O by setting the FILESYSTEMIO_OPTIONS parameter to SETALL.
- Increase the RAM available to Oracle by changing the MEMORY_TARGET parameter. The amount of memory to assign depends on the size of the Hadoop cluster.
- Create more redo log groups and spread the redo log members across separate disks or logical unit numbers.
- Increase the size of redo log members to be at least 1 GB.
Reserving Ports for HiveServer 2
HiveServer2 uses port 10000 by default, but Oracle database changes the local port range. This can cause HiveServer2 to fail to start.
Manually reserve the default port for HiveServer2. For example, the following command reserves port 10000 and inserts a comment indicating the reason:
echo << EOF > /etc/sysctl.cnf # HS2 uses port 10000 net.ipv4.ip_local_reserved_ports = 10000 EOF sysctl -q -w net.ipv4.ip_local_reserved_ports=10000
Modifying the Maximum Number of Oracle Connections
Work with your Oracle database administrator to ensure appropriate values are applied for your Oracle database settings. You must determine the number of connections, transactions, and sessions to be allowed.
Allow 100 maximum connections for each service that requires a database and then add 50 extra connections. For example, for two services, set the maximum connections to 250. If you have five services that require a database on one host (the databases for Cloudera Manager Server, Activity Monitor, Reports Manager, Cloudera Navigator, and Hive metastore), set the maximum connections to 550.
From the maximum number of connections, you can determine the number of anticipated sessions using the following formula:
sessions = (1.1 * maximum_connections) + 5
For example, if a host has a database for two services, anticipate 250 maximum connections. If you anticipate a maximum of 250 connections, plan for 280 sessions.
Once you know the number of sessions, you can determine the number of anticipated transactions using the following formula:
transactions = 1.1 * sessions
Continuing with the previous example, if you anticipate 280 sessions, you can plan for 308 transactions.
Work with your Oracle database administrator to apply these derived values to your system.
Using the sample values above, Oracle attributes would be set as follows:
alter system set processes=250; alter system set transactions=308; alter system set sessions=280;
Ensuring Your Oracle Database Supports UTF8
The database you use must support UTF8 character set encoding. You can implement UTF8 character set encoding in Oracle databases by using the dbca utility. In this case, you can use the characterSet AL32UTF8 option to specify proper encoding. Consult your DBA to ensure UTF8 encoding is properly configured.
Installing the Oracle JDBC Connector
You must install the JDBC connector on the Cloudera Manager Server host and on hosts to which you assign the Activity Monitor, Reports Manager, Hive Metastore Server, Sentry Server, Cloudera Navigator Audit Server, and Cloudera Navigator Metadata Server server roles.
Cloudera recommends that you assign all roles that require a database on the same host and install the connector on that host. Locating all such roles on the same host is recommended but not required. If you install a role, such as Activity Monitor, on one host and other roles on a separate host, you would install the JDBC connector on each host running roles that access the database.
- Download and install the ojdbc6.jar file, which contains the JDBC driver. Download the version that is designed for:
- Java 6
- The Oracle database version used in your environment. The full version number of the Oracle JDBC driver supported by Cloudera Manager and CDH is: Oracle 11.2.0.3.0 JDBC 4.0 compiled with JDK6. The name of the JAR file for this driver is: ojdbc6.jar. Download the JAR file from http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html.
- Copy the appropriate JDBC JAR file to /usr/share/java/oracle-connector-java.jar for use with the Cloudera Manager databases (for example, for the
Activity Monitor, and so on), and for use with Hive.
$ mkdir /usr/share/java (if necessary) $ cp /tmp/ojdbc6.jar /usr/share/java/oracle-connector-java.jar
Creating Databases for the Cloudera Manager Server, Activity Monitor, Reports Manager, Hive Metastore Server, Sentry Server, Cloudera Navigator Audit Server, and Cloudera Navigator Metadata Server
- Cloudera Manager Server (not required if you are using the Cloudera Manager installer)
- Cloudera Management Service roles:
- Activity Monitor (if using the MapReduce service)
- Reports Manager
- Cloudera Navigator Audit Server
- Cloudera Navigator Metadata Server
- Hive Metastore
- Sentry Server
You can create the Oracle database, schema and users on the host where the Cloudera Manager Server will run, or on any other hosts in the cluster. For performance reasons, you should install each database on the host on which the service runs, as determined by the roles you assign during installation or upgrade. In larger deployments or in cases where database administrators are managing the databases the services use, you can separate databases from services, but use caution.
The database must be configured to support UTF-8 character set encoding.
Record the values you enter for database names, user names, and passwords. The Cloudera Manager installation wizard requires this information to correctly connect to these databases.
- Log into the Oracle client:
sqlplus system@localhost Enter password: ******
- Create a schema and user for the Cloudera Manager Server:
SQL> create user username identified by password; SQL> grant CREATE SESSION to username; SQL> grant CREATE ANY TABLE to username; SQL> grant CREATE ANY SEQUENCE to username; SQL> grant CREATE ANY INDEX to username; SQL> grant ALTER ANY TABLE to username; SQL> grant ALTER ANY INDEX to username;
where username and password are the credentials you specified in Preparing a Cloudera Manager Server External Database. - Grant a quota on the tablespace (the default tablespace is SYSTEM) where tables will be created:
SQL> ALTER USER username quota 100m on tablespace
or for unlimited space:SQL> ALTER USER username quota unlimited on tablespace
- Create schema and users for Activity Monitor, Reports Manager, Hive Metastore Server, Sentry Server, Cloudera Navigator Audit Server, and Cloudera Navigator Metadata
Server:schema, user, and password can be any value. The examples match the default
names provided in the Cloudera Manager configuration settings:
Role Schema User Password Activity Monitor amon amon amon_password Reports Manager rman rman rman_password Hive Metastore Server metastore hive hive_password Sentry Server sentry sentry sentry_password Cloudera Navigator Audit Server nav nav nav_password Cloudera Navigator Metadata Server navms navms navms_password - For each user in the table in the preceding step, create a user and add privileges for the each user:
SQL> create user username identified by password; SQL> grant CREATE SESSION to username; SQL> grant CREATE ANY TABLE to username; SQL> grant CREATE ANY SEQUENCE to username; SQL> grant CREATE ANY INDEX to username; SQL> grant ALTER ANY TABLE to username; SQL> grant ALTER ANY INDEX to username;
- Grant a quota on the tablespace (the default tablespace is SYSTEM) where tables will be created:
SQL> ALTER USER username quota 100m on tablespace
or for unlimited space:SQL> ALTER USER username quota unlimited on tablespace
For further information about Oracle privileges, see Authorization: Privileges, Roles, Profiles, and Resource Limitations. - After creating the Cloudera Navigator Audit Server database, set the following additional privileges:
GRANT EXECUTE ON sys.dbms_crypto TO nav; GRANT CREATE VIEW TO nav;
where nav is the Navigator Audit Server user you specified above when you created the database.
Return to Establish Your Cloudera Manager Repository Strategy.