Newsletter

Holen Sie sich die neuesten Updates von Hortonworks per E-Mail

Einmal monatlich erhalten Sie die neuesten Erkenntnisse, Trends und Analysen sowie Fachwissen zu Big Data.

AVAILABLE NEWSLETTERS:

Sign up for the Developers Newsletter

Einmal monatlich erhalten Sie die neuesten Erkenntnisse, Trends und Analysen sowie Fachwissen zu Big Data.

cta

Erste Schritte

Cloud

Sind Sie bereit?

Sandbox herunterladen

Wie können wir Ihnen helfen?

* Ich habe verstanden, dass ich mich jederzeit abmelden kann. Außerdem akzeptiere ich die weiteren Angaben in der Datenschutzrichtlinie von Hortonworks.
SchließenSchaltfläche „Schließen“
HDP > Entwicklung mit Hadoop > Hallo Welt

Grundlagen der HDP-Sandbox

Cloud Sind Sie bereit?

SANDBOX HERUNTERLADEN

Einleitung

This tutorial is aimed for users who do not have much experience in using the Sandbox.

The Sandbox is a straightforward, pre-configured, learning environment that contains the latest developments from Apache Hadoop, specifically the Hortonworks Data Platform (HDP). The Sandbox comes packaged in a virtual environment that can run in the cloud or on your personal machine. The Sandbox allows you to learn and explore HDP on your own.

Let’s begin our Hadoop journey…

Voraussetzungen

Übersicht

Environment setup

This is the administrative section to get started with the Hortonworks Sandbox environment. Generally, this will only be done once.

Determine IP Address of Your Sandbox

Once the Sandbox VM or container is installed, it settles to the host of your environment, the IP address varies depending on your Virtual Machine (VMware, VirtualBox) or container (Docker). Once the sandbox is running, it will tell you the IP address. An example of typical IP addresses for each supported environment:

Docker: IP Address = 127.0.0.1

VirtualBox: IP Address = 127.0.0.1

VMWare: IP Address = 192.168.x.x

If you’re using VirtualBox or VMWare, you can confirm the IP address by waiting for the installation to complete and confirmation screen will tell you the IP address your sandbox resolves to. For example:

guest-vm-hdp-welcome-screen

Map Sandbox IP to Your Desired Hostname in the Hosts File

Mac, Linux and Windows all have a hosts file. This file once configured enables the IP address of the sandbox to be mapped to a hostname that is easier to remember than a number.

Mac users:

  • echo '{IP-Address} sandbox-hdp.hortonworks.com sandbox-hdf.hortonworks.com' | sudo tee -a /private/etc/hosts

Linux users:

  • echo '{IP-Address} sandbox-hdp.hortonworks.com sandbox-hdf.hortonworks.com' | sudo tee -a /etc/hosts

Windows users:

  • Run Notepad as administrator.
  • Open hosts file located in: c:\Windows\System32\drivers\etc\hosts
  • Add {IP-Address} localhost sandbox-hdp.hortonworks.com sandbox-hdf.hortonworks.com
  • Save the file

IMPORTANT: Replace {IP-Address} with Sandbox IP Address

Terminal Access

Refer to Login Credentials for list of users and passwords. You can also login using root, using password hadoop, which may require you to change the password – remember it!

If you login using credentials other than root, you will be required to use sudo before the command. For example: sudo ambari-server status.

Secure Shell Method:

Open your terminal (mac/linux) or Git Bash (Windows). Type the following command to access the Sandbox through ssh user@hostname -p port. For example: ssh root@sandbox-hdp.hortonworks.com -p 2222

secure-shell-sandbox

Shell Web Client Method:

The shell web client is also known as Shell-in-a-Box. It’s an easy way to issue shell commands without needing to install additional software. It uses port 4200, for example: sandbox-hdp.hortonworks.com:4200

Send Data Between Sandbox and Local Machine

Using the terminal of your choice, you can transfer files to/from sandbox and local machine.

  • Transfer file from local machine to sandbox:

    • scp -P 2222 <local_directory_file> root@sandbox-hdp.hortonworks.com:<sandbox_directory_file>
  • Transfer file from sandbox to local machine:

    • scp -P 2222 root@sandbox-hdp.hortonworks.com:<sandbox_directory_file> <local_directory_file>

Do you notice the difference between the two commands?

To send data from local machine to sandbox, the local machine directory path comes before sandbox directory. To transfer data from sandbox to local machine, the command arguments are reversed.

Welcome Page

The Sandbox Welcome Page is also known as the Splash Page. It runs on port number :1080. To open it, use your host address and append the port number. For example: http://sandbox-hdp.hortonworks.com:1080/

It looks like this:

new_splashscreen

Launch Dashboard opens two browser windows – Ambari interface and beginner tutorial. You should login to Ambari using the username and password based on the tutorial requirements. Most of the tutorials use raj_ops or maria_dev. Refer to Login Credentials for list of users and passwords.

Advanced HDP Quick Links provide quick access to Ambari Services such as Zeppelin, Atlas, Ranger, Shell-in-a-box and others.

Explore Ambari

manage-ambari

The following screen will be displayed:

Lab0_3

  1. Dashboard” will take you to the Ambari Dashboard which is the primary UI for Hadoop Operators
  2. Cluster Management” allows you to grant permission to Ambari users and groups
  3. Administration of Users” allows you to add & remove Ambari users and groups
  4. Ambari User Views” list the set of Ambari Users views that are part of the cluster
  • Click on Go to Dashboard and you should see a similar screen:

Lab0_4

Explorer by click on:

1. Metrics, Heatmaps and Config History

and then on:

2. Background Operations,Alerts, Admin and User Views, icon (represented by 3×3 matrix ) to become familiar with the Ambari resources available to you.

Weiterführende Ressourcen

Appendix A: Reference Sheet

Login Credentials:

User Passwort
admin refer to Admin Password Reset
maria_dev maria_dev
raj_ops raj_ops
holger_gov holger_gov
amy_ds amy_ds

1. admin – System Administrator

2. maria_dev – Responsible for preparing and getting insight from data. She loves to explore different HDP components like Hive, Pig, HBase.

3. raj_ops – Responsible for infrastructure build, research and development activities like design, install, configure and administration. He serves as a technical expert in the area of system administration for complex operating systems.

4. holger_gov – Primarily for the management of data elements, both the content and metadata. He has a specialist role that incorporates processes, policies, guidelines and responsibilities for administering organizations’ entire data in compliance with policy and/or regulatory obligations.

5. amy_ds – A data scientist who uses Hive, Spark and Zeppelin to do exploratory data analysis, data cleanup and transformation as preparation for analysis.

Some notable differences between these users in the Sandbox are mentioned below:

Name id(s) Role Dienstleistungen
Sam Admin Ambari Admin Ambari
Raj (raj_ops) Hadoop Warehouse Operator Hive/Tez, Ranger, Falcon, Knox, Sqoop, Oozie, Flume, Zookeeper
Maria (maria_dev) Spark and SQL Developer Hive, Zeppelin, MapReduce/Tez/Spark, Pig, Solr, HBase/Phoenix, Sqoop, NiFi, Storm, Kafka, Flume
Amy (amy_ds) Data Scientist Spark, Hive, R, Python, Scala
Holger (holger_gov) Datensteward Atlas

OS Level Authorization

Name id(s) HDFS Authorization Ambari Authorization Ranger Authorization
Sam Admin Max Ops Ambari Admin Admin access
Raj (raj_ops) Access to Hive, Hbase, Atlas, Falcon, Ranger, Knox, Sqoop, Oozie, Flume, Operations Cluster Administrator Admin Access
Maria (maria_dev) Access to Hive, Hbase, Falcon, Oozie and Spark Service Operator Normal User Access
Amy (amy_ds) Access to Hive, Spark and Zeppelin Service Operator Normal User Access
Holger (holger_gov) Access to Atlas Service Administrator Normal User Access

Other Differences

Name id(s) Sandbox Role View Configurations Start/Stop/Restart Service Modify Configurations Add/delete services Install Components Manage Users/Groups Manage Ambari Views Atlas UI Access Sample Ranger Policy Access
Sam Admin Ambari Admin Ja Ja Ja Ja Ja Ja Ja Ja NA
Raj (raj_ops) Cluster Administrator Ja Ja Ja Ja Ja Nein Nein Nein Alle
Maria (maria_dev) Service Operator Ja Ja Nein Nein Nein Nein Nein Nein SELECT
Amy (amy_ds) Service Operator Ja Ja Nein Nein Nein Nein Nein Nein SELECT
Holger (holger_gov) Service Administrator Ja Ja Ja Nein Nein Nein Nein Ja SELECT, CREATE, DROP

Open a port for custom use

Refer to the Sandbox Guide for ports available for custom use.

In this example we will use the fictional port 1234, note that this port is not available for custom use.

SSH onto the Sandbox Host

If you are running the VirtualBox VM:

# SSH on to VirtualBox Virtual Machine
ssh root@sandbox-hdp.hortonworks.com -p 2200

Or if you are using VMWare:

# SSH on to VMWare Virtual Machine
ssh root@sandbox-hdp.hortonworks.com -p 22

Note: The default password is hadoop.

Change directories to /sandbox/deploy-scripts/assets/

cd /sandbox/deploy-scripts/assets/

NOTE: On the docker version of the Sandbox the script is found on deploy-scripts/assets/generate-proxy-deploy-script.sh

Under the assets directory you will find a file named generate-proxy-deploy-script.sh, edit it:

vi generate-proxy-deploy-script.sh

search for the tcpPortsHDP array and enter the port that you would like to forward:

new-port

to save and exit press esc and enter :x

to execute your changes re-run the script:

cd /sandbox/deploy-scripts
assets/generate-proxy-deploy-script.sh

and deploy the reverse proxy with your changes:

/sandbox/proxy/proxy-deploy.sh

Finally, add the port forward on your virtual environment

Settings -> Network -> Advanced -> Port Forwarding -> Add New

Now restart the virtual machine and enjoy your new port.

Sandbox Version

When you run into an issue, one of the first things someone will ask is “what sandbox version are you using“? To get this information:

Login using shell web client and execute: sandbox-version. The output should look something like:

sandbox-version

Note: refer to Login Credentials

Admin Password Reset

Due to possibility of passwords being vulnerable to being hacked, we recommend
you change your Ambari admin password to be unique.

  1. Open Shell Web Client (aka Shell-in-a-Box):

  2. The login using credentials: root / hadoop

  3. Type the following commands: ambari-admin-password-reset

IMPORTANT: The first time you login as root, you may be required to change the password – remember it!

Appendix B: Troubleshoot

  • Hortonworks Community Connection (HCC) is a good resource to find answers to problems you may encounter during your Hadoop journey.

  • hangs / Long running processes

At times you may encounter a job, query or request that just seems to run forever and does not complete. It may be because it’s in the ACCEPTED state. A good place to begin looking is in the ResourceManager. If you know a job has completed, but the Resource Manager still thinks it’s running – kill it!

rm-kill

Appendix C: Determine Network Adapter of Your VirtualBox Sandbox

Once the Sandbox VM is installed, it attaches to a virtual network. There are 8 different network modes, but the default network your sandbox will attach to is NAT. We will cover relevant networks for our tutorial use cases: NAT and Bridged Adapter.

Network Address Translation (NAT)

By default, the VM attaches to Network Address Translation (NAT) network mode. The guest’s IP address by default translates over to the host’s IP address. NAT allows for the guest system to connect to external devices on external networks, but external devices cannot access the guest system. Alternatively, VirtualBox can make selected services on the guest reachable to the outside world by port forwarding. VirtualBox listens to certain ports on the host, then re-sends packets that arrive at those ports to the guest on the same port or different port.

How we are forwarding all incoming traffic from a specific host interface to the guest in our sandbox is by specifying an IP of that host like the following:

VBoxManage modifyvm "Hortonworks Sandbox HDP 3.0.1" --natpf1 "Sandbox Splash Page,tcp,127.0.0.1,1080,,1080"
.
.
.
VBoxManage modifyvm "Hortonworks Sandbox HDP 3.0.1" --natpf1 "Sandbox Host SSH,tcp,127.0.0.1,2122,,22"

You can find the set network by opening the VM settings and then select the network tab.

Bridged Networking

In this mode, the guest receives direct access to the network, which the host has been connected. The router assigns an IP address to the guest. On that network, instead of there being just the host IP address visible, now the guest IP address is visible too. Thus, external devices, such as MiNiFi running on a Raspberry Pi, are able to connect to the guest via it’s IP address.

When would you need this mode? It is needed for Connected Data Architecture(CDA). To configure this mode, first power down your guest vm, click settings, switch to the network tab and change the attach to network to be Bridged Adapter.

Bridged Adapter

WARNING: First make sure your computer is connected to a router, else this feature will not work cause there is no router to assign an IP address to the guest vm.

If you’re using VirtualBox or VMWare, you can confirm the IP address by waiting for the installation to complete and confirmation screen will tell you the IP address your sandbox resolves to. For example:

Host Address of Sandbox Environment

Note: Guest VM Welcome Window for NAT Sandbox —>

Host Address of Sandbox Environment

Note: Guest VM Welcome Window for BRIDGED Sandbox —>

Rezensionen der Benutzer

Bewertung der Benutzer
2 4 out of 5 stars
5 Star 50%
4 Star 0%
3 Star 50%
2 Star 0%
1 Star 0%
Name des Tutorials
Grundlagen der HDP-Sandbox

Um neue Fragen zu stellen oder Antworten auf Fragen anderer Nutzer zu durchsuchen, besuchen Sie bitte die Hortonworks Community Connection.

2 Reviews
Rezension schreiben

Registrieren

Bitte registrieren Sie sich, um eine Rezension zu schreiben

Teilen Sie Ihre Erfahrungen

Beispiel: Bestes Tutorial der Welt

Sie müssen mindestens 50 Zeichen in dieses Feld eingeben.

Erfolgreich eingesendet

Vielen Dank für Ihre Rezension!

Well written, but dependencies should be explained.
by Mark Wagner on November 16, 2018 at 11:00 am

I could not get past setting up the container as the docker IP 127.0.0.1 goes nowhere and there are no instructions for setting the NAT with docker. It probably isn't that hard, but still any tutorial is assumedly made for novices and should be 100% thorough.

I could not get past setting up the container as the docker IP 127.0.0.1 goes nowhere and there are no instructions for setting the NAT with docker. It probably isn’t that hard, but still any tutorial is assumedly made for novices and should be 100% thorough.

Weniger anzeigen
Cancel

Review updated successfully.

Up to date
by Piotr Kaluski on September 18, 2018 at 1:26 pm

As of 18.09.2018 tutorial is up to date with the actual software. This is very important. It is frustrating for a greenhorn when a tutorial, which is different from the actual software. I would add one word of warning to this document. You have to make a correct shutdown. If you do a VM power off, you are very likely to corrupt the whole thing.

As of 18.09.2018 tutorial is up to date with the actual software. This is very important. It is frustrating for a greenhorn when a tutorial, which is different from the actual software. I would add one word of warning to this document. You have to make a correct shutdown. If you do a VM power off, you are very likely to corrupt the whole thing.

Weniger anzeigen
Cancel

Review updated successfully.