Backing Up PostgreSQL Databases
To back up a PostgreSQL database, use the same procedure whether the database is
embedded or external:
- Log in to the host where the Cloudera Manager Server is installed.
- Get the name, user, and password properties for
the Cloudera Manager database from
/etc/cloudera-scm-server/db.properties
:com.cloudera.cmf.db.name=scm com.cloudera.cmf.db.user=scm com.cloudera.cmf.db.password=NnYfWIjlbk
- Run the following command as root using the parameters from the
preceding
step:
# pg_dump -h hostname -p 7432 -U scm > /tmp/scm_server_db_backup.$(date +%Y%m%d)
- Enter the password from the
com.cloudera.cmf.db.password
property in step 2. - To back up a database created for one of the roles on the local
host as the roleuser
user:
# pg_dump -h hostname -p 7432 -U roleuser > /tmp/roledb
- Enter the password specified when the database was created.