...
- Install VirtualBox and Vagrant. (Installation needs to be done only once, unless you want to upgrade VirtualBox and/or Vagrant.)
- Install and start Start one or more Linux virtual machines. Each machine represents a node in a cluster.
- On one of the virtual machines, download, install, and deploy the version of Ambari you wish to use.
- Using Ambari, deploy the version of HDP you wish to use.
When you complete the example in this Quick Start, you should have a three-node cluster of virtual machines running Ambari 2.4.1.0 and HDP 2.5.0 (unless you change specify different repository versions along the way).
Once VirtualBox and Vagrant are installed, steps 2 through 4 can be done multiple times to change versions, create a larger cluster, and so on. There is no need to repeat step 1 unless you want to upgrade VirtualBox and/or Vagrant later.
Note: these steps have been were most recently tested on MacOS 10.11.6.
Table of Contents |
---|
...
In the following examples, one or more virtual machines run on a host machine running OS X. OS X is the primary operating system. The virtual machines (guests) are installed under OS X. The virtual machines run Linux in separate environments on OS X. Thus, your Mac is the "host" machine, and the virtual machines that run Ambari and Hadoop are called "guest" machines.that run Ambari and Hadoop are called "guest" machines.
Prerequisites
You will need the following resources for this Quick Start:
- A solid internet connection, preferably with at least 5 MB available download bandwidth.
- If you are installing the VMs on a Mac, at least 16 GB of memory (assuming 3 GB per VM)
Install VirtualBox and Vagrant
...
Change your current directory to
ambari-vagrant
:Code Block cd ambari-vagrant
If you run an
ls
command on theambari-vagrant
directory, you will see subdirectories for several different operating systems and operating system versions.cd
into the OS subdirectory for the OS you wish to use. CentOS is recommended, because it is quicker to launch than other operating systems.
The remainder of this example uses CentOS 7.0 . (To install and use a different version or distribution of Linux, specify the other directory name in place ofcentos7.0
.)Code Block cd centos7.0
Important: All VM
vagrant
commands operate within your current directory. Be sure to run them from the local (Mac) subdirectory associated with the VM operating system that you have chosen to use. If you attempt to run avagrant
command from another directory, it will not find the VM.Copy the private key into the directory associated with the chosen operating system.
For this example, which usescentos7.0
, issue the following command:Code Block cp ~/.vagrant.d/insecure_private_key .
(Optional) If you have at least 16 GB of memory on your Mac, consider increasing the amount of memory allocated to the VMs.
Edit the following line inVagrantfile
, increasing allocated memory from 3072 to 4096 or more; for example:Code Block vb.customize ["modifyvm", :id, "--memory", 4096] # RAM allocated to each VM
- Every virtual machine will have a directory called
/vagrant
inside the VM. This corresponds to theambari-vagrant/<os>
directory on your local computer, making it easy to transfer files back and forth between your host Mac and the virtual machine. If you have any files to access from within the VM, you can place them in this shared directory. Start one or more VMs, using the
./up.sh
command. Each VM will run one HDP node. Recommendation: if you have at least 16GB of RAM on your Mac and wish to run a small cluster, start with three nodes.Code Block ./up.sh <# of VMs to launch>
For example, the following command starts 3 VMs:
./up.sh 3
On an early 2013 MacBook Pro, 2.7 GHz core i7 and 16 GB RAM, this step takes five minutes. For CentOS 7.0, the hostnames arec7001
,c7002
, andc7003
.
Additional notes:
- If you ran the VMs before and usedvagrant destroy
to remove the VM's, this is the step at which you would recreate and start the VMs.
- The defaultVagrantfile
(in each OS subdirectory) can create up to 10 virtual machines.
- Theup.sh 3
command is equivalent tovagrant up c700{1..3}
.
- The fully-qualified domain name (FQDN) for each VM has the format<os-code>[01-10].ambari.apache.org
, where<os-code>
isc59
(CentOS 5.9),c64
(CentOS 6.4), etc. For example,c5901.ambari.apache.org
will be the FQDN for node 01 running CentOS 5.9.
- The IP address for each VM has the format192.168.<os-subnet>.1[01-10]
, where<os-subnet>
is64
for CentOS 6.4,70
for CentOS 7.0, and so on. For example,192.168.70.101
will be the IP address for CentOS 7.0 nodec7001
.Check the status of your VM(s), and review any errors. The following example shows the results of
./upsh 3
for three VMs running with CentOS 7.0:Code Block LMBP:centos6.4 lkg$ vagrant status Current machine states: c7001 running (virtualbox) c7002 running (virtualbox) c7003 running (virtualbox) c7004 not created (virtualbox) c7005 not created (virtualbox) c7006 not created (virtualbox) c7007 not created (virtualbox) c7008 not created (virtualbox) c7009 not created (virtualbox) c7010 not created (virtualbox)
In the preceding list, three virtual machines are installed and running.
- At this point, you can snapshot the VMs to have a fresh set of running machines to rerun if desiredreuse if desired. This is especially helpful when installing Apache Ambari and the HDP stack for the first time; it allows you to back out to fresh VMs and reinstall Ambari and HDP if you encounter errors. For more information , see about snapshots, see the
vagrant snapshot
command in "Basic Vagrant Commands," later in this Quick Start.
...
From the terminal window on the VM where you want to run the main Ambari service, download the Ambari repository. The following commands download Ambari version 2.4.1.0 and install
ambari-server
. To install a different version of Ambari, specify the appropriate repo URL. Choose the appropriate commands for the operating system on your VMs:OS Commands CentOS 6 wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
yum install ambari-server -yCentOS 7 wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
yum install ambari-server -yUbuntu 12 wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.4.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -yUbuntu 14 wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.4.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -yOn an early 2013 MacBook Pro, 2.7 GHz core i7 and 16 GB RAM, this step takes seven minutes. Timing also depends on internet download speeds.
To install Ambari with default settings, set up and start
ambari-server
:Code Block ambari-server setup -s ambari-server start
For more information about installation options and settings, see Apache Ambari Installation.
To check Ambari Server status, issue the following command:
ambari-server status
After Ambari Server has started, launch a browser on your host machine (Mac). Access the Ambari Web UI at
http://<hostname>.ambari.apache.org:8080
. The<hostname>
part of the URL specifies the VM where you installed Ambari; for example:Code Block http://c7001.ambari.apache.org:8080
Note: The Ambari Server can take some time to launch and be ready to accept connections. Keep trying the URL until you see the login page.
- At this point, you can snapshot the VMs to have a cluster with Ambari installed, to rerun later if desired. This is especially helpful when installing Apache Ambari and the HDP stack for the first time; it allows you to back out to fresh VMs running Ambari, and reinstall a fresh HDP stack if you encounter errors. For more information about snapshots, see the
vagrant snapshot
command in "Basic Vagrant Commands," later in this Quick Start.
...
On the Ambari screen, login using default username
admin
, passwordadmin
.On the welcome page, choose "Launch Install Wizard."
Specify a name for your cluster, and then click Next.
On the Select Version page, choose which version of HDP to install, and then click Next.
On the Install Options page, complete the following steps:
List the FQDNs of the virtual machines. For example:
Code Block c7001.ambari.apache.org c7002.ambari.apache.org c7003.ambari.apache.org
Alternatively, you can use a range expression:
Code Block c70[01-03].ambari.apache.org
Upload the
insecure_private_key
file that you created earlier: browse to theambari-vagrant
directory, navigate to the operating system folder for your VM's, and choose the key file.Change the SSH User Account to
vagrant
.Click "Register and Confirm."
On the Confirm Hosts page, Ambari displays installation status.
If you see a yellow banner with the following message, click on the link to review warnings:
See the Troubleshooting section (later on this page) for more information.- When all host checks pass, close the warning window:
- Click Next to continue:
- On the Choose Services page, uncheck any components that you do not expect to use. If any are required for selected components, Ambari will request to add them back in.
- On the Assign Masters screen, choose hosts or simply click Next to use default values.
- On the Assign Slaves and Clients screen, choose hosts or simply click Next to use default values.
- On the Customize Services screen
- Review services with warning notes, such as Hive and Ambari Metrics in the following image:
- Specify missing property values (such as admin passwords) as directed by the installation wizard. When all configurations have been addressed, click Next.
- Review services with warning notes, such as Hive and Ambari Metrics in the following image:
- On the Review screen, review the service definitions, and then click Next.
- The Install, Start and Test page shows deployment status. This step takes a while.
- When the cluster installs successfully, you can snapshot the VMs to have a fresh cluster with Ambari and HDP installed, to rerun later if desired. This allows you to experiment with the cluster and quickly restore back to a previous state if you wish. For more information about snapshots, see the
vagrant snapshot
command in "Basic Vagrant Commands," later in this Quick Start.
...