Managing the Embedded PostgreSQL Database

Stopping the Embedded PostgreSQL Database

  1. Stop the services that have a dependency on the Hive metastore (Hue, Impala, and Hive) in the following order:
    • Stop the Hue and Impala services.
    • Stop the Hive service.
  2. Stop the Cloudera Management Service.
  3. Stop the Cloudera Manager Server.
  4. Stop the Cloudera Manager Server database:
    sudo service cloudera-scm-server-db stop

Starting the Embedded PostgreSQL Database

  1. Start the Cloudera Manager Server database:
    sudo service cloudera-scm-server-db start
  2. Start the Cloudera Manager Server.
  3. Start the Cloudera Management Service.
  4. Start the services that have a dependency on the Hive metastore (Hue, Impala, and Hive) in the following order:
    • Start the Hive service.
    • Start the Hue and Impala services.

Changing Embedded PostgreSQL Database Passwords

The embedded PostgreSQL database has generated user accounts and passwords. You can see the generated accounts and passwords during the installation process and you should record them at that time. For example:


To find information about the PostgreSQL database account that the Cloudera Manager Server uses, read the /etc/cloudera-scm-server/db.properties file:
# cat /etc/cloudera-scm-server/db.properties

Auto-generated by scm_prepare_database.sh
#
Sat Oct 1 12:19:15 PDT 201
#
com.cloudera.cmf.db.type=postgresql
com.cloudera.cmf.db.host=localhost:7432
com.cloudera.cmf.db.name=scm
com.cloudera.cmf.db.user=scm
com.cloudera.cmf.db.password=TXqEESuhj5
To change a password associated with an embedded PostgreSQL database account:
  1. Obtain the root password from the /var/lib/cloudera-scm-server-db/data/generated_password.txt file:
    # cat /var/lib/cloudera-scm-server-db/data/generated_password.txt
    
    MnPwGeWaip
    
    The password above was generated by /usr/share/cmf/bin/initialize_embedded_db.sh (part of the cloudera-scm-server-db package)
    and is the password for the user 'cloudera-scm' for the database in the current directory.
    
    Generated at Fri Jun 29 16:25:43 PDT 2012.
  2. On the host on which the Cloudera Manager Server is running, log into PostgreSQL as the root user:
    psql -U cloudera-scm -p 7432 -h localhost -d postgres
    Password for user cloudera-scm: MnPwGeWaip
    psql (8.4.18)
    Type "help" for help.
    
    postgres=#
  3. Determine the database and owner names:
    postgres=# \l
                                             List of databases
       Name    |    Owner     | Encoding | Collation  |   Ctype    |         Access privileges         
    -----------+--------------+----------+------------+------------+-----------------------------------
     amon      | amon         | UTF8     | en_US.UTF8 | en_US.UTF8 | 
     hive      | hive         | 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 | 
     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 | 
     template0 | cloudera-scm | UTF8     | en_US.UTF8 | en_US.UTF8 | =c/"cloudera-scm"
                                                                   : "cloudera-scm"=CTc/"cloudera-scm"
     template1 | cloudera-scm | UTF8     | en_US.UTF8 | en_US.UTF8 | =c/"cloudera-scm"
                                                                   : "cloudera-scm"=CTc/"cloudera-scm"
    (9 rows)
    
    
  4. Set the password for an owner using the \password command. For example, to set the password for the amon owner, do the following:
    postgres=# \password amon
    Enter new password: 
    Enter it again: 
  5. Configure the role with the new password:
    1. In the Cloudera Manager Admin Console, select Clusters > Cloudera Management Service.
    2. Click the Configuration tab.
    3. In the Scope section, select the role where you are configuring the database.
    4. Select Category > Database category.
    5. Set the Role Name Database Password property.
    6. Click Save Changes to commit the changes.