Step 2 Ambari

Now that you have a VM built, you can now install Ambari. It is a pretty easy task too.

1. Install Ambari

ssh root@hdb
wget -nv -O /etc/yum.repos.d/ambari.repo
yum install ambari-server -y

This first step will take a while as it needs to download the rpm files from the Hortonworks site.

2. Setup Ambari

ambari-server setup -s

This step will take some time too as it must download the Oracle JDK.

3. Reconfigure PostgreSQL
Ambari uses a PostgreSQL database to keep track of configurations and by default, it listens on port 5432. HAWQ also uses port 5432 so there will be a conflict. One solution is to install HAWQ on a different port but I prefer to change the Ambari PostgreSQL port number. Here are the steps.

/etc/init.d/postgresql stop
sed -i 's/PGPORT=5432/PGPORT=10432/g' /etc/init.d/postgresql
su -c "echo \"PGPORT=10432\" >> ~postgres/.bash_profile" postgres
su -c "echo \"export PGPORT\" >> ~postgres/.bash_profile" postgres
su -c "echo \"PGDATABASE=ambari\" >> ~postgres/.bash_profile" postgres
su -c "echo \"export PGDATABASE\" >> ~postgres/.bash_profile" postgres
/etc/init.d/postgresql start
ambari-server setup --database=postgres --databasehost=localhost --databaseport=10432 --databasename=ambari --databaseusername=ambari --databasepassword=bigdata -s
ln -s /etc/init.d/postgresql /etc/rc3.d/S36postgresql

4. Start Ambari

ambari-server start

Visit the site at hdb:8080