Versions Compared

Key

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

...

  1. Install VirtualBox and Vagrant. (Installation only needs to be done once unless you want to upgrade VirtualBox and/or Vagrant.)
  2. Start one or more VMs, each representing Linux virtual machines. Each machine represents a node in a cluster.
  3. Download, install, and deploy the version of Ambari you wish to use.
  4. From Using Ambari, deploy the version of HDP you wish to use. 

...

In this Quick Start you will use VirtualBox to run Linux nodes within VirtualBox on OS X:   consider iterating/revising the image

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. Using Vagrant, you can install and run a preconfigured cluster environment with Ambari and the HDP stack.

...

  1.  Change your current directory to ambari-vagrant:

    Code Block
    cd ambari-vagrant
    

    You If you run an ls command on the ambari-vagrant directory, you will see subdirectories for different OS’sseveral different operating systems and operating system versions.

  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'soperating systems.

    The remainder of this Quick Start uses CentOS 6.4 (7.0). 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 (7.0)
    

    Important: All VM -focused vagrant commands operate within your current directory. Be sure to run them from the local (Mac) subdirectory associated with the VM operating system you're usingthat you have chosen to use. If you attempt to run a Vagrant vagrant command from another directory, it will not find the VM.

  3. Copy the private key into your OS directorythe directory associated with the chosen operating system. In this example, from within the centos6.4 directory, issue the following command:

    Code Block
    cp ~/.vagrant.d/insecure_private_key .
    
  4. (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 in Vagrantfile , increasing 3072 to 4096 or more:

    Code Block
    vb.customize ["modifyvm", :id, "--memory", 3072] # RAM allocated to each VM
    
  5. All VMs Every virtual machine will have a directory called /vagrant inside the VM. This corresponds to the ambari-vagrant/<os> directory on your local computer. If you have any files to access from within the , 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.

  6. Start one or more VMs, using the ./up.sh command. Each VM will run one HDP node.
    Three nodes can run well if you have 16GB of RAM on your Mac.

    Code Block
    ./up.sh <# of VMs to launch>
    

    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.)
    - The fully-qualified domain name (FQDN) for each VM will have 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 will be the FQDN for node 01 running CentOS 5.9.
    - The IP address for each VM will have the format 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 will be the IP address for CentOS 5.9 node c5901.

    For example, the following command starts 3 VMs:
         ./up.sh 3 starts 3 VMs. For CentOS 6.4, the associated hostnames will be c6401, c6402, and c6403.

    Note:  up.sh 3 is equivalent to vagrant up c640{1..3}.
    For CentOS 6.4, the associated hostnames will be c6401, c6402, and c6403.

  7. Check the Check the status of your VM(s). The following example shows the results of ./upsh 3 for three VMs running with CentOS 6.4:

    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)

    (You can use the vagrant init command to initialize your current directory as a Vagrant environment, but this step should already be handled by the preceding steps.)

  8. Next, log into one of your VMs. For example:

    Code Block
    vagrant ssh c6401 c7001
    LMBP:centos7.0 lkg$ vagrant ssh c7001
    Last login: Tue Jan 12 11:20:28 2016
    [vagrant@c7001 ~]$  

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

    Tip: Open It can be very helpful to open a second terminal window for submitting commands on your Mac. This will be is useful when accessing the Ambari Web UI. You can tell which window you're in by looking at the terminal prompt: your VM will list the OS name; your Mac will list your Mac's computer nameTerminal windows typically list the computer name or VM hostname on each command-line prompt and at the top of the window.

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

    Code Block
    sudo su -
    
  10. When you are finished using the VM, TBD (save, exit; snapshot)use the exit command to return to your host machine (Mac). If you plan to use the VMs again later you can suspend each VM for later use (vagrant suspend <VM>), or snapshot their current state, described later in this post.  

Install Ambari

Prerequisites: Before installing Ambari, the following software must be installed on your VM:

...