Ambari

Ambari is a UI for making the management of Hadoop easier. In the previous section, you learned how to implement ssh into the container. From there you could manage Hadoop, run Hive queries, download data, and add it to the HDFS file system. Ambari makes all of this much simpler, especially if you are not familiar with the command line. To open Ambari, browse to the URL as: http://sandbox.hortonworks.com:8080/.

The Ambari URL depends on your installation. If you have followed the instructions in this chapter, then this will be your URL. You must also have started the server from the Docker image.

You will be directed to the Ambari login page. Enter the user/password combination of raj_ops/raj_ops, as shown in the following screenshot:

After logging in, you will see the Ambari Dashboard. It will look like it does in the following screenshot:

On the left, you have a list of services. The main portion of the window contains the metrics, and the top menu bar has tabs for different functions. In this chapter, you will use the square comprised of nine smaller squares. Hover over the square icon and you will see a drop-down for the files view.

This is the root directory of the HDFS file system.

When connected to the container via ssh, run the hdfs dfs -ls / command and you will see the same directory structure.

From here, you can upload files. To try it out, open a text editor and create a simple CSV. This example will use the following data:

40, Paul
23, Fred
72, Mary
16, Helen
16, Steve

Save the CSV file and then click the Upload button in Ambari. You will be able to drag and drop the CSV to the browser. Ambari added the file to the HDFS file system on the container:

Now that you have data loaded in the container, you can query it in Hive using SQL. Using the square icon again, select the drop-down for Hive View 2.0. You should see a workspace as follows:

In Hive, you have worksheets. On the worksheet, you have the database you are connected to, which in this case is the default. Underneath that, you have the main query window. To the right, you have a list of existing tables. Lastly, scrolling down, you will see the Execute button, and under that is where the results will be loaded.

In the query pane, enter the SQL query as follows:

SELECT * FROM sample_07

The previous query is a basic select all in SQL. The results will be shown as follows:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset