Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Edit your /etc/hosts on your computer so that you will be able to resolve hostnames for the VMs:

Code Block
sudo -s 'cat ambari-vagrant/append-to-etc-hosts.txt >> /etc/hosts'

Copy the private key to your home directory (or some place convenient for you) so that it’s easily accessible for uploading via Ambari Web:

...

You will see subdirectories for different OS’s. “cd” into the OS that you want to test. centos6.48 is recommended as this is quicker to launch than other OS's.
Now you can start VMs with the following command:

Code Block
cd centos6.48
cp ~/.vagrant.d/insecure_private_key .
./up.sh <# of VMs to launch>

For example, up.sh 3 starts 3 VMs. 3 seems to be a good number with 16GB of RAM without taxing the system too much.
With the default Vagrantfile, you can specify up to 10 (if your computer can handle it; you can even add more).
VMs will have the FQDN <os-code>[01-10].ambari.apache.org, where <os-code> is c59 (CentOS 5.9), c64 c68 (CentOS 6.48), etc.
E.g., c5901.ambari.apache.org, c6401c6801.ambari.apache.org, etc.
VMs will have the IP address 192.168.<os-subnet>.1[01-10], where <os-subnet> is 59 for CentOS 5.9, 64 68 for CentOS 6.48, etc.
E.g., 192.168.59.101, 192.168.64.101, etc.
Note that up.sh 3 command is equivalent to doing something like: vagrant up /c6401-3/c680{1..3}

Testing Ambari

If it is your first time running a vagrant command, run:

...

Log into the VM:

Code Block
vagrant ssh c6401c6801

Note that this logs you in as user vagrant. Once you are logged in, you can run:

Code Block
sudo su -

to make yourself root. Ambari offers many installation options (see Ambari User Guides), but to get up and running quickly with default settings, you can run the following:

To install Ambari, you can build it yourself from source (see Ambari Development), or you can use published binaries.

As this is a Quick Start Guide to get you going quickly, ready-made, publicly available binaries are referenced in the steps below.
Note that these binaries were built and made publicly available via Hortonworks, a commercial vendor for Hadoop.  This is for your convenience.  Note that using the binaries shown here would make HDP, Hortonworks' distribution, available to be installed via Apache Ambari.  The instructions here should still work (only the repo URLs need to be changed) if you have Ambari binaries from any other vendor/organization/individuals (the instructions here can be updated if anyone wanted to expand this to include such ready-made, publicly accessible binaries from any source - such contributions are welcome).  This would also work if you had built the binaries yourself.

Code Block
languagebash
# CentOS 6 (for CentOS 7, replace centos6 with centos7 in the repo URL)
# 
# to test public release 2.5.1
wget -O /etc/yum.repos.d/ambari.repo 
Code Block
wget http://public-repo-1.hortonworks.com/ambari/centos6/12.x/updates/12.65.1.0/ambari.repo
yum install ambari-server -y
 
# Ubuntu 14 (for Ubuntu 16, replace ubuntu14 with ubuntu16 in the repo URL)
# to test latest public release 12.65.1)
OR
wget http://s3.amazonaws.com/dev-O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/centos6ubuntu14/12.x/updates/2.5.1.7.0.trunk/ambari.repo (to test the latest trunk code for 1.7.0)
cp ambari.repo /etc/yum.repos.d
yumlist
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -y
 
# SUSE 11 (for SUSE 12, replace suse11 with suse12 in the repo URL)
# to test public release 2.5.1
wget -O /etc/zypp/repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/suse11/2.x/updates/2.5.1.0/ambari.repo
zypper install ambari-server -y

Ambari offers many installation options (see Ambari User Guides), but to get up and running quickly with default settings, you can run the following to set up and start ambari-server.

Code Block

ambari-server setup -s
ambari-server start

 

For frontend developers only: see Frontend Development section below for extra setup instructions.

Once Ambari Server is started, hit http://c6401c6801.ambari.apache.org:8080 (URL depends on the OS being tested) from your browser on your local computer.
Note that Ambari Server can take some time to fully come up and ready to accept connections. Keep hitting the URL until you get the login page.

Once you are at the login page, login with the default username admin and password admin.
On the Install Options page, use the FQDNs of the VMs. For example:

Code Block
c6401c6801.ambari.apache.org
c6402c6802.ambari.apache.org
c6403c6803.ambari.apache.org

Alternatively, you can use a range expression:

Code Block
c64c68[01-03].ambari.apache.org

...

vagrant up <vm name>
Starts a specific VM. up.sh is a wrapper for this call.
Note: if you don’t specify the <vm name> parameter, it will try to start 10 VMs
You can run this if you want to start more VMs after you already called up.sh
For example: vagrant up c6406c6806

vagrant destroy -f
Destroys all VMs launched from the current directory (deletes them from disk as well)
You can optionally specify a specific VM to destroy

...

vagrant ssh host
Starts a SSH session to the host. For example: vagrant ssh c6401c6801

vagrant status
Shows which VMs are running, suspended, etc.

...

This enables the “vagrant snapshot” command. Note that the above installs vesion 0.0.2. if you install the latest plugin version 0.0.3 does not allow taking snapshots of the whole cluster at the same time (you have to specify a VM name).
Run vagrant snapshot to see the syntax.
Note that the plugin tries to take a snapshot of all VMs configured in Vagrantfile. If you are always using 3 VMs, for example, you can comment out c64c68[04-10] in Vagrantfile so that the snapshot commands only operate on c64c68[01-03].
Note: Upon resuming a snapshot, you may find that time-sensitive services may be down (e.g, HBase RegionServer is down, etc.)

...

If you want to test OS’s other than what’s currently in the ambari-vagrant repo, please see http://www.vagrantbox.es/ for all the readily available OS images you can test. Note that Ambari currently works on RHEL 5/6, CentOS 5/6, Oracle Linux 5/6, SUSE 11, and SLES 11. Ubuntu support is work in progress.

Kerberos Support

Ambari supports adding Kerberos security to an existing Ambari-installed cluster. First setup any one host as the KDC as follows:

Install the Kerberos server on the chosen host. e.g. for Centos/RedHat

Code Block
languagebash
yum install krb5-server krb5-libs krb5-auth-dialog rng-tools -y

Create the Kerberos database.

Code Block
languagebash
rngd -r /dev/urandom -o /dev/random
/usr/sbin/kdb5_util create -s

Update /etc/krb5.conf on the KDC host. e.g. if your realm is EXAMPLE.COM and kdc host is c6801.ambari.apache.org

Code Block
[realms]
  EXAMPLE.COM = {
    admin_server = c6801.ambari.apache.org
    kdc = c6801.ambari.apache.org
  }

Restart Kerberos services. e.g. for Centos/RedHat

Code Block
/etc/rc.d/init.d/krb5kdc restart
/etc/rc.d/init.d/kadmin restart

Create a KDC admin principal admin/admin@EXAMPLE.COM using a password.

Code Block
languagebash
$ sudo kadmin.local
kadmin.local:  add_principal admin/admin@EXAMPLE.COM
WARNING: no policy specified for admin/admin@EXAMPLE.COM; defaulting to no policy
Enter password for principal "admin/admin@EXAMPLE.COM":
Re-enter password for principal "admin/admin@EXAMPLE.COM":
Principal "admin/admin@EXAMPLE.COM" created.

Remember the password for this principal. The Ambari Kerberos Wizard will request it later. Distribute the updated /etc/krb5.conf file to remaining hosts in the cluster.

 Navigate to Ambari Dashboard —> Admin —> Kerberos to launch the Kerberos Wizard and follow the wizard steps. If you run into errors, the Ambari server logs can be found at /var/log/ambari-server/ambari-server.log.

 

Pre-Configured Development Environment

...

Code Block
cd ambari-vagrant/centos6.48
vi Vagrantfile  <- uncomment the line with "dev-bootstrap.sh"
vagrant up c6401c6801

To build from source, follow the instructions in Ambari Development.

...

You can use this set up to develop and test out Ambari Web frontend code against a real Ambari Server on a multi-node environment.

You need to first fork the apache/ambari repository if you haven't already. Read the How to Contribute guide for instructions on how to fork.

On the host machine:

Code Block
languagebash
cd ambari-vagrant/centos6.48
# Replace the [forked-repository-url] with your fork's clone url
git clone https://git-wip-us.apache.org/repos/asf/ambari.git[forked-repository-url] ambari
cd ambari/ambari-web
npm install
brunch w

On c6401 c6801 (where Ambari Server is installed):

Code Block
languagebash
cd /usr/lib/ambari-server
mv web web-orig
ln -s /vagrant/ambari/ambari-web/public web
ambari-server restart

...