Step 1: Identify Roles that Use the Embedded Database Server

Before you can migrate to another database server, you must first identify the databases using the embedded database server. When the Cloudera Manager Embedded Database server is initialized, it creates the Cloudera Manager database and databases for roles in the Management Services. The Installation Wizard (which runs automatically the first time you log in to Cloudera Manager) or Add Service action for a cluster creates additional databases for roles when run. It is in this context that you identify which roles are used in the embedded database server.

  1. Obtain and save the cloudera-scm superuser password from the embedded database server. You will need this password in subsequent steps:
    head -1  /var/lib/cloudera-scm-server-db/data/generated_password.txt
  2. Make a list of all services that are using the embedded database server. Then, after determining which services are not using the embedded database server, remove those services from the list. The scm database must remain in your list. Use the following table as a guide:
    Table 1. Cloudera Manager Embedded Database Server Databases
    Service Role Default Database Name Default Username
    Cloudera Manager Server

    scm

    scm
    Cloudera Management Service Activity Monitor

    amon

    amon

    Hive

    Hive Metastore Server

    hive

    hive
    Hue

    Hue Server

    hue

    7uu7uu7uhue

    Cloudera Management Service Navigator Audit Server nav nav
    Cloudera Management Service Navigator Metadata Server navms navms
    Oozie Oozie Server oozie_oozie_server oozie_oozie_server
    Cloudera Management Service Reports Manager rman rman
    Sentry Sentry Server sentry sentry
  3. Verify which roles are using the embedded database. Roles using the embedded database server always use port 7432 (the default port for the embedded database) on the Cloudera Manager Server host.
    For Cloudera Management Services:
    1. Select Cloudera Management Service > Configuration, and type "7432" in the Search field.
    2. Confirm that the hostname for the services being used is the same hostname used by the Cloudera Manager Server.
    For the Oozie Service:
    1. Select Oozie service > Configuration, and type "7432" in the Search field.
    2. Confirm that the hostname is the Cloudera Manager Server.
    For Hive, Hue, and Sentry Services:
    1. Select the specific service > Configuration, and type "database host" in the Search field.
    2. Confirm that the hostname is the Cloudera Manager Server.
    3. In the Search field, type “database port” and confirm that the port is 7432.
    4. Repeat these steps for each of the services (Hive, Hue and Sentry).
  4. Verify the database names in the embedded database server match the database names on your list (Step 2). Databases that exist on the database server and not used by their roles do not need to be migrated. This step is to confirm that your list is correct.
    psql -h localhost -p 7432 -U cloudera-scm -l
    Password for user cloudera-scm: <password>
    
                                                   List of databases
           Name        |       Owner        | Encoding |  Collate   |   Ctype    |         Access
    --------------------+--------------------+----------+------------+------------+----------------
    amon               | amon               | UTF8     | en_US.UTF8 | en_US.UTF8 |
    hive               | hive               | UTF8     | en_US.UTF8 | en_US.UTF8 |
    hue                | hue                | UTF8     | en_US.UTF8 | en_US.UTF8 |
    nav                | nav                | UTF8     | en_US.UTF8 | en_US.UTF8 |
    navms              | navms              | UTF8     | en_US.UTF8 | en_US.UTF8 |
    oozie_oozie_server | oozie_oozie_server | UTF8     | en_US.UTF8 | en_US.UTF8 |
    postgres           | cloudera-scm       | UTF8     | en_US.UTF8 | en_US.UTF8 |
    rman               | rman               | UTF8     | en_US.UTF8 | en_US.UTF8 |
    scm                | scm                | UTF8     | en_US.UTF8 | en_US.UTF8 |
    sentry             | sentry             | UTF8     | en_US.UTF8 | en_US.UTF8 |
    template0          | cloudera-scm       | UTF8     | en_US.UTF8 | en_US.UTF8 | =c/"cloudera-scm"
    template1          | cloudera-scm       | UTF8     | en_US.UTF8 | en_US.UTF8 | =c/"cloudera-scm"
    (12 rows)
You should now have a list of all roles and database names that use the embedded database server, and are ready to proceed with the migration of databases from the embedded database server to the external PostgreSQL database server.
Proceed to Step 2: Migrate Databases from the Embedded Database Server to the External PostgreSQL Database Server.