Backup Ranger Admin Database
You must execute the below commands on the Ranger database host.
MySQL
- First create directory
(mkdir -p /root/backups/ranger/db/admin)
$ mysqldump -u [username] -p db_name > dump_fileName.sql
or specify destination as/some_dir/dump_fileName.sql
- Select the Enter key.
- Type the database password at the password prompt.
Example
mysqldump -u rangeradmin -p ranger > /root/backups/ranger/db/admin/ranger.sql
POSTGRES
- Dump the contents of a database to a file by running the following command. Replace
database name
with the name of the database to be backed up:pg_dump -U username dbname > dbname.bak
Example
pg_dump -U rangeradmin ranger > /root/backups/ranger/db/admin/db/ranger.sql
- Type the database password at the password prompt.