...
Start Linux Virtual Machines
The ambari-vagrant
directory (cloned from GitHub) contains several subdirectories, each for several a specific Linux distributionsdistribution. Each subdirectory contains a set of has scripts and configuration files for running Ambari and HDP on that version of Linux.
...
Change your current directory to
ambari-vagrant
:Code Block cd ambari-vagrant
You will see subdirectories for different OS’s.
cd
into the OS subdirectory for the OS you wish to use. CentOS 6.4 is recommended, because it is quicker to launch than other OS's.
The remainder of this Quick Start uses CentOS 6.4. To install and use another version or distribution of Linux, specify the other directory name in place of centos6.4Code Block cd centos6.4
Copy the private key into your OS directory:
Code Block cp ~/.vagrant.d/insecure_private_key .
(Optional) If you have at least 16 GM of memory on your Mac, consider increasing the amount of memory allocated to the VMs. Edit the following line in
Vagrantfile
, increasing 3072 to 4096 or more:Code Block vb.customize ["modifyvm", :id, "--memory", 3072] # RAM allocated to each VM
Start one or more VMs, using the
./up.sh
command. Three seems to be a good number if you have 16GB of RAM, without taxing the system too much.Code Block ./up.sh <# of VMs to launch>
For example,
up.sh 3
on CentOS 6.4 starts 3 VMs. Associated hostnames will bec6401
,c6402
, andc6403
.Additional notes:
- With the defaultVagrantfile
(in each OS subdirectory) you can specify up to 10 VMs. (If your computer can handle it; you can even add more.)
- VMs will have fully-qualified domain names (FQDN) with 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
,c6401.ambari.apache.org
, etc.
- VMs will have IP addresses192.168.<os-subnet>.1[01-10]
, where<os-subnet>
is59
for CentOS 5.9,64
for CentOS 6.4, etc. For example,192.168.59.101
for CentOS 5.9 nodec5901
,192.168.64.101
, for CentOS 6.4 nodec6401
, etc.
- Note thatup.sh 3
is equivalent to doing something likevagrant up c640{1..3}
...
Install Ambari
If it is your first time running a vagrant command, run:
Code Block |
---|
vagrant init |
Log into the VM:
Code Block |
---|
vagrant ssh c6401
|
Note that this logs you in as user vagrant. Once you are logged in, you can run:
Code Block |
---|
sudo su -
|
...
After running the vagrant up
command:
Check the status of your VMs:
Code Block hw100:centos6.4 lkg$ vagrant status Current machine states: c6401 running (virtualbox) c6402 running (virtualbox) c6403 running (virtualbox) c6404 not created (virtualbox) c6405 not created (virtualbox) c6406 not created (virtualbox) c6407 not created (virtualbox) c6408 not created (virtualbox) c6409 not created (virtualbox) c6410 not created (virtualbox)
(The
vagrant init
command initializes your current directory to be a Vagrant environment, but this should already be handled within the repository.)Next, log into the VM:
Code Block vagrant ssh c6401
From this point onward, until you exit the VM, your terminal window will operate within the VM – not your Mac.
When you first access the VM you will be logged in as user
vagrant
. Change toroot
user:Code Block sudo su -
Download the Ambari repository file. The following commands download Ambari version 2.2.1.0:
OS Commands CentOS 6 wget -O /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari.repo yum install ambari-server -y
CentOS 7 wget -O /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari.repo yum install ambari-server -y
Ubuntu 12 wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.2.1.0/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD apt-get update apt-get install ambari-server -yUbuntu 14 wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.1.0/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD apt-get update apt-get install ambari-server -y
Code Block |
---|
# CentOS 6 (for CentOS 7, replace centos6 with centos7 in the repo URL)
#
# to test public release 2.2.1
wget -O /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari.repo
yum install ambari-server -y
#
OR
# to test the branch-2.2 build - updated on every commit to branch-2.2
wget -O /etc/yum.repos.d/ambari.repo http://s3.amazonaws.com/dev.hortonworks.com/ambari/centos6/2.x/latest/2.2.2.0/ambaribn.repo
yum install ambari-server -y
OR
# to test the trunk build - updated on every commit to trunk
wget -O /etc/yum.repos.d/ambari.repo http://s3.amazonaws.com/dev.hortonworks.com/ambari/centos6/2.x/latest/trunk/ambaribn.repo
yum install ambari-server -y
# Ubuntu 12 (for Ubuntu 14, replace ubuntu12 with ubuntu14 in the repo URL)
# to test public release 2.2.1
wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.2.1.0/ambari.list
OR
# to test the branch-2.2 build - updated on every commit to branch-2.2
wget -O /etc/apt/sources.list.d/ambari.list http://dev.hortonworks.com.s3.amazonaws.com/ambari/ubuntu12/2.x/latest/2.2.2.0/ambaribn.list
OR
# to test the trunk build - updated on every commit to trunk
wget -O /etc/apt/sources.list.d/ambari.list http://s3.amazonaws.com/dev.hortonworks.com/ambari/ubuntu12/2.x/latest/trunk/ambaribn.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -y |
...