Versions Compared

Key

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

...

  1. Install VirtualBox and Vagrant.
    • VirtualBox allows you to run multiple operating systems (inside multiple virtual machines) at the same time. In this Quick Start you will be using VirtualBox to run Linux on OS X.

    • Vagrant is a tool that makes it easier to work with virtual machines. It helps automate the work of setting up, running, and removing virtual machine environments. For our purposes, Vagrant makes it easy to install and run a preconfigured environment for running Ambari.
  2. Start one or more VMs, each representing a node in a cluster.
  3. Download, install, and deploy the version of Ambari you wish to use.
  4. From Ambari, deploy the version of HDP you wish to use. 

...

  1. Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads. Note: as of 4/25/16 there are potential issues running the latest version of VirtualBox with the Ambari Vagrant setup. We recommend installing an older (4.x) version. This Quick Start has been tested on 4.3.34.
  2. Download and install Vagrant from http://downloads.vagrantup.com.
  3. Clone the ambari-vagrant GitHub repository into a convenient folder on your Mac. The repository contains scripts for setting up Ambari virtual machines on several Linux distributions.
    From the command-line:

    Code Block
    git clone https://github.com/u39kun/ambari-vagrant.git
    
  4. Edit the /etc/hosts file 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'
    
  5. Use the vagrant command to create a private key. You will need the key for Ambari.
    The vagrant command displays Vagrant command usage and common commands, and creates a private key as ~/.vagrant.d/insecure_private_key.

    Code Block
    vagrant
    


Start the Linux Virtual Machines

The ambari-vagrant directory (cloned from GitHub) contains several subdirectories, each for a specific Linux distribution. Each subdirectory has scripts and configuration files for running Ambari and HDP on that version of Linux.

...

  1.  Change your current directory to ambari-vagrant:

    Code Block
    cd ambari-vagrant
    

    You will see subdirectories for different OS’s.

  2. 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.4

    Code Block
    cd centos6.4
    
  3. Copy the private key into your OS directory:

    Code Block
    cp ~/.vagrant.d/insecure_private_key .
    
  4. (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
    
  5. 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 be c6401, c6402, and c6403.

    Additional notes:
    - With the default Vagrantfile (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> is c59 (CentOS 5.9), c64 (CentOS 6.4), etc. For example, c5901.ambari.apache.org, c6401.ambari.apache.org, etc.
    - VMs will have IP addresses 192.168.<os-subnet>.1[01-10], where <os-subnet> is 59 for CentOS 5.9, 64 for CentOS 6.4, etc. For example, 192.168.59.101 for CentOS 5.9 node c5901192.168.64.101, for CentOS 6.4 node c6401, etc.
    - Note that up.sh 3 is equivalent to doing something like vagrant up c640{1..3}

...

After running the vagrant up command:

  1. 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 You can use the vagrant init command initializes to initialize your current directory to be as a Vagrant environment, but this step should already be handled within by the repositorypreceding steps.)

  2. Next, log into the VMone of your VMs. For example:

    Code Block
    vagrant ssh c6401
    

    From this point onward, your terminal window will operate within the VM until you exit the VM, your terminal window will operate within . All commands will go to the VM , not your Mac.

  3. When you first access the VM you will be logged in as user vagrant. Change to root user:

    Code Block
    sudo su -
    

Install Ambari

Prerequisites: The following software must be installed on your VM:

  • yum

  • rpm

  • scp

  • curl

  • wget

  • pdsh

 

 

  1. On your VM (where the main ambari service should run?), download Download the Ambari repository file. The following commands download Ambari version 2.2.1.0 and install ambari-server:

    OSCommands
    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 wget -O /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos6centos7/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 -y
     Ubuntu 14wget -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
      
      

...


...

  1. apt-get

...

  1. update

...


  1. apt-get

...

  1. install

...

  1. ambari-server

...

  1. -y

    Note: to test a branch build or the trunk build, specify the repo URL for the branch or trunk version.

  2. Ambari offers many installation options (see Ambari User Guides), but to

...

  1. install Ambari with default settings,

...

  1. run the following commands to set up and start ambari-server

...

  1. :

    Code Block
    ambari-server setup -s
    ambari-server start

 

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

...