Here's how to quickly install Ranger in your HDP cluster. Use this bash script to install Postgres-9.6 or follow these steps to install it manually.
- Install the Postgres JDBC driver and let Ambari server know about it:
yum install postgresql-jdbc -y && chmod 644 /usr/share/java/postgresql-jdbc.jar && ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql-jdbc.jar
- Create a user role, database, and set password to the user:
psql
CREATE DATABASE ranger;
CREATE USER ranger WITH PASSWORD 'bigdata';
GRANT ALL PRIVILEGES ON DATABASE ranger TO ranger;
- Let postgres know about the users who will access the database:
echo "local all postgres,ranger,rangerlogger trust
host all postgres,ranger,rangerlogger 0.0.0.0/0 trust
host all postgres,ranger,rangerlogger ::/0 trust" >> /var/lib/pgsql/data/pg_hba.conf
Note: when using Postgres-9.6, the file would be /var/lib/pgsql/9.6/data/pg_hba.conf
.
- Refresh postgres configs:
su postgres -c '/usr/bin/pg_ctl -D /var/lib/pgsql/data reload'
Note: for Postgres-9.6, restart the service:
systemctl restart postgresql-9.6
- Proceed with the new service installation wizard in Ambari.