Back Up Databases
Gather the following information:
- Type of database (PostgreSQL, Embedded PostgreSQL, MySQL, MariaDB, or Oracle)
- Hostnames of the databases
- Database names
- Port number used by the databases
- Credentials for the databases
- Sqoop, Oozie, and Hue – Go to .
- Hive Metastore – Go to the Hive service, select Configuration, and select the Hive Metastore Database category.
- Sentry – Go to the Sentry service, select Configuration, and select the Sentry Server Database category.
- Ranger – Go to the Ranger service, select Configuration, and search on "database."
- Queue Manager – Go to the Queue Manager service, select the Configuration tab. In the List of Filters on the left side, click the Category drop-down and select Database.
- Schema Registry and Streams Messaging Manager – Select the service, go to Configuration, and select the Database category.
To back up the databases
- If not already stopped, stop the service.
- On the
to the right of the service name and select Stop.
tab, click - Click Stop in the next screen to confirm. When you see a Finished status, the service has stopped.
- On the
- Back up the database. Substitute the database name, hostname,
port, user name, and backup directory path and run the following
command:
- MySQL
-
mysqldump --databases database_name --host=database_hostname --port=database_port -u database_username -p > backup_directory_path/database_name-backup-`date +%F`-CDH.sql
- Oracle
- Work with your database administrator to ensure databases are properly backed up.
For additional information about backing up databases, see these vendor-specific links:
- MariaDB 10.2: https://mariadb.com/kb/en/backup-and-restore-overview/
- MySQL 5.7: https://dev.mysql.com/doc/refman/5.7/en/backup-and-recovery.html
- PostgreSQL10: https://www.postgresql.org/docs/10/static/backup.html
- Oracle 12c: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/bradv/index.html
- Start the service.
- On the
to the right of the service name and select Start.
tab, click - Click Start in the next screen to confirm. When you see a Finished status, the service has started.
- On the