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 example 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>
    

    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 associated hostnames will be are c7001, c7002, and c7003. Note that the up.sh 3 command is equivalent to vagrant up c700{1..3}.

    Additional notes:
    - If you ran the VMs before and used vagrant destroy to remove the VM's, this is the step at which you would recreate and start the VMs.
    - The default Vagrantfile (in each OS subdirectory) can create up to 10 virtual machines.
    - The up.sh 3 command is equivalent to vagrant 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> 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 has the format 192.168.<os-subnet>.1[01-10], where <os-subnet> is 64 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 node c7001.

  6. Check the status of your VM(s)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.

...

  1. To log on to a virtual machine, use the vagrant ssh command and specify the hostname; for example:

    Code Block
    vagrant ssh 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 is connected to the virtual machine until you exit the virtual machine. All commands 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.

  2. When you first access the VM you will be logged in as user vagrant. Switch to the root user; be sure to include the space between "su" and "-":

    Code Block
    [vagrant@c7001 ~]$ sudo su -
    
    Last login: Sun Sep 25 01:34:28 AEST 2016 on pts/0
    root@c7001:~#  

...

  1. 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:

    OSCommands
    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 -y
    CentOS 7wget -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 -y
    Ubuntu 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 -y
     Ubuntu 14wget -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 -y

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

     

  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 and settings, see Apache Ambari Installation.

  3. To check Ambari Server status, issue the following command:
    ambari-server status

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

...

  1. On the Ambari screen, login using default username admin, password admin.

  2. On the welcome page, choose "Launch Install Wizard."

  3. Specify a name for your cluster, and then click Next.

  4. On the Select Version page, choose which version of HDP to install, and then click Next.

  5. On the Install Options page, complete the following steps:

    1. 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
      
    2. Upload the insecure_private_key file that you created earlier: browse to the ambari-vagrant directory, navigate to the operating system folder for your VM's, and choose the key file.

    3. Change the SSH User Account to vagrant.

    4. Click "Register and Confirm."

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

  7. When all host checks pass, close the warning window:


  8. Click Next to continue:
  9. 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.
  10. On the Assign Masters screen, choose hosts or simply click Next to use default values.
  11. On the Assign Slaves and Clients screen, choose hosts or simply click Next to use default values.
  12. On the Customize Services screen
    1. Review services with warning notes, such as Hive and Ambari Metrics in the following image:
    2. Specify property values as directed by the installation wizard. When all configurations have been addressed, click Next.

  13. On the Review screen, review the service definitions, and then click Next.

  14. The Install, Start and Test page shows deployment status. This step takes a while.

...