Configuring database for Cloudera Manager

You need to configure the database for Cloudera Manager to use.

The examples you view in this section are for PostgreSQL. Cloudera Manager supports other databases as well. For more details about the syntax details of other databases, see Syntax for scm_prepare_database.sh.

  1. Configure the Reports Manager database:
    [root@ccycloud-1 yum.repos.d]# sudo -u postgres psql
    psql (9.2.24, server 10.12)
    WARNING: psql version 9.2, server version 10.0.
             Some psql features might not work.
    Type "help" for help.
     
    postgres=# CREATE ROLE scm  LOGIN PASSWORD 'scm';
    CREATE ROLE
    postgres=# CREATE ROLE rman  LOGIN PASSWORD 'rman';
    CREATE ROLE
    postgres=# CREATE DATABASE rman OWNER rman ENCODING 'UTF8';
    CREATE DATABASE
    postgres=# CREATE DATABASE scm OWNER scm ENCODING 'UTF8';
    CREATE DATABASE
    postgres=#
  2. Configure the Cloudera Manager database on the Cloudera Manager server host:
    [root@ccycloud-1 yum.repos.d]# /opt/cloudera/cm/schema/scm_prepare_database.sh postgresql scm scm scm
    JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64
    Verifying that we can write to /etc/cloudera-scm-server
    Creating SCM configuration file in /etc/cloudera-scm-server
    Executing:  /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    [2020-11-05 11:17:18,802] INFO     0[main] - com.cloudera.enterprise.dbutil.DbCommandExecutor.testDbConnection(DbCommandExecutor.java) - Successfully connected to database.
    All done, your SCM database is configured correctly!
    [root@ccycloud-1 yum.repos.d]#
  3. Check the db.properties file and ensure that the settings match with the settings mentioned in the following script:
    [root@ccycloud-1 yum.repos.d]# cat /etc/cloudera-scm-server/db.properties
    # Auto-generated by scm_prepare_database.sh on Thu Nov  5 11:17:18 PST 2020
    #
    # For information describing how to configure the Cloudera Manager Server
    # to connect to databases, see the "Cloudera Manager Installation Guide."
    #
    com.cloudera.cmf.db.type=postgresql
    com.cloudera.cmf.db.host=localhost
    com.cloudera.cmf.db.name=scm
    com.cloudera.cmf.db.user=scm
    com.cloudera.cmf.db.setupType=EXTERNAL
    com.cloudera.cmf.db.password=scm
    [root@ccycloud-1 yum.repos.d]#