Versions Compared

Key

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

...

  1.  Change your current directory to ambari-vagrant:

    Code Block
    cd ambari-vagrant
    

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

  2. 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 Quick Start uses CentOS 7.0 . (To install and use a different version or distribution of Linux, specify the other directory name in place of centos7.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 a vagrant 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 uses centos7.0 , issue the following command:

    Code Block
    cp ~/.vagrant.d/insecure_private_key .
    
  3. (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 allocated memory from 3072 to 4096 or more; for example:

    Code Block
    vb.customize ["modifyvm", :id, "--memory", 4096] # RAM allocated to each VM
    
  4. Every virtual machine will have a directory called /vagrant inside the VM. This corresponds to the ambari-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.

  5. 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>
    

    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

    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.

  6. 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)

    (The vagrant init command initializes the current directory as a Vagrant environment; the initialization process should already be handled by the preceding steps.)

  7. 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 to your Mac.

    Recommendation: Open a second terminal window for your Mac. This is useful when accessing the Ambari Web UI. To distinguish between the two, terminal windows typically list the computer name or VM hostname on each command-line prompt and at the top of the terminal window.

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

    Code Block
    sudo su -
    
  9. When you are finished using the VM, use the exit command to return to your host machine (Mac). Note that the VMs will still be running in the background. 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. Vagrant and snapshot commands are described later in this post.  (Note: http://help.skytap.com/VM_Sequencing.html?)

Install Ambari on the Virtual Machines

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

  • rpm

  • scp?

  • curl

  • wget

  • pdsh

  • ntpd?

To check, try run yum install rpm. If it runs, yum is installed and you can step through the rest of the list, installing the other utilities. If a utility is already installed, you will see a message that the software package is already installed, and that there is nothing further to do for that package.

To install Ambari, complete the following steps. This example installs Ambari version 2.4.1.0. To install a different version of Ambari, specify the appropriate repo URL.

  1. From the terminal window on the VM where you want to run the main ambari Ambari service to run, download the Ambari repository.
    The following commands download Ambari version 2.24.1.0 and install ambari-server; choose the appropriate command for the . To install a different version of Ambari, specify the appropriate repo URL. Choose the appropriate commands for the operating system on your VMs:

    OSCommands
    CentOS 6
    wget -O /etc/yum.repos.d/ambari.repo nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.24.1.0/ambari.repo
     -O /etc/yum.repos.d/ambari.repo 

    yum install ambari-server -y
    CentOS 7wget -O /etc/yum.repos.d/ambari.repo nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.24.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo

    yum install ambari-server -y
    Ubuntu 12
    wget -O /etc/apt/sources.list.d/ambari.listwget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.24.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 -y
     Ubuntu 14wget -O /etc/apt/sources.list.d/ambari.list nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.24.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 -y
  2. 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, see Ambari User Guides.

  3. (Optional) For frontend developers only: see "Frontend Development" (later on this page) for extra setup instructions.

  4. Once Ambari Server is started, access the Ambari Web UI at http://<hostname>.ambari.apache.org:8080. For example:

    Code Block
    http://c6401.ambari.apache.org:8080

    The URL depends on the OS and the node where you installed Ambari
    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.

  5. Login using default username admin, password admin.

  6. Choose "Launch Install Wizard."

  7. Name your cluster.

  8. On the Install Options page, list the FQDNs of the VMs. For example:

    Code Block
    c6401.ambari.apache.org
    c6402.ambari.apache.org
    c6403.ambari.apache.org
    

    Alternatively, you can use a range expression:

    Code Block
    c64[01-03].ambari.apache.org
    
  9. Upload the insecure_private_key file that you created earlier.

  10. Specify non-root SSH user vagrant.

  11. Follow the onscreen instructions to install your cluster.

...