LoginSignup
6
2

More than 5 years have passed since last update.

ゼロからはじめるHortonworks(sandboxセットアップ~HDFSにデータロード)

Posted at

HortonWorksってデータ分析の何かだよね?

ぐらいの認識だった私が、Hortonworksに触れてみました。

この記事の内容を三行で

  • Hortonworksのsandboxは、様々なデータ分析が楽しめる
  • Microsoft Azureを使えば、ボタンぽちぽちですぐ使える
  • チュートリアルが充実(・・・しすぎてどれを始めればいいか迷った)

はじめるまえに

Hortonworksって何かのサービスの名前?
それとも会社の名前?

Hortonworks
http://jp.hortonworks.com/

なるほど

  • Hortonworksは会社名
  • Hortonworksのwは小文字
  • 企業の持っているデータをいい感じに活用する何かを提供している

いい感じに活用する何かは試せるのかな?

と「製品」を見ると
sandboxを使ったチュートリアルというものがあったので、
ここからはじめてみました。

Azureでsandboxのデプロイ

Azureでsandbox環境を作ってみることにしてみます。

デプロイ方法については、以下の記事を参考に作成しました。

Hadoop、Sparkを、Azure上のHortonworks Data Platformで試してみよう
http://qiita.com/kkitase/items/1d2e4662c2e8c9b0fd59

テンプレートからデプロイするときの説明文を読んでみると

Sandbox comes with over fifty hands-on tutorials that will guide you through the Hadoop, Spark, Storm, HBase, Kafka, Hive, Ambari and YARN; tutorials built on the experience gained from training thousands of people in our Hortonworks University Training classes.
If you are new to Hadoop, HDP and the Sandbox we suggest sequence of tutorials to get started:

sandbox環境は、たくさんのチュートリアルが楽しめるのですね!

http://<Azureで割り振られたパブリックIPアドレス>:8080/

にアクセスすると、Ambariという管理ポータルにアクセスできました。

初期ユーザIDとパスワードの
maria_dev / maria_dev
を入力することで、ログインできます。

snip_20161207192003.png

セットアップを進めてみる

sandboxのセットアップを進めていきます。
http://jp.hortonworks.com/hadoop-tutorial/learning-the-ropes-of-the-hortonworks-sandbox/

2.1 SETUP AMBARI ADMIN PASSWORD MANUALLY

AmbariのAdminパスワードの再設定と再起動を行います。

$ sudo ambari-admin-password-reset
Please set the password for admin:
Please retype the password for admin:

The admin password has been set.
Restarting ambari-server to make the password change effective...

Using python  /usr/bin/python2
Restarting ambari-server
Using python  /usr/bin/python2
Stopping ambari-server
Ambari Server stopped
Using python  /usr/bin/python2
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................
Ambari Server 'start' completed successfully.
$ sudo ambari-agent restart
Restarting ambari-agent
Verifying Python version compatibility...
Using python  /usr/bin/python2
Found ambari-agent PID: 3262
Stopping ambari-agent
Removing PID file at /var/run/ambari-agent/ambari-agent.pid
ambari-agent successfully stopped
Verifying Python version compatibility...
Using python  /usr/bin/python2
Checking for previously running Ambari Agent...
Starting ambari-agent
Verifying ambari-agent process status...
Ambari Agent successfully started
Agent PID at: /var/run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log

では、Ambariにもう一度サインインしてみます。
admin / 設定したパスワード

adminで入ることができ、
上メニューのAdminという項目を使えるようになりました。

snip_20161207194810.png

Hadoopチュートリアルを試してみる

膨大なチュートリアルが存在します。
http://jp.hortonworks.com/tutorials/

が、他のチュートリアルは、前提条件の知識が必要のようなので、
まずは初心者向けのこちらを進めてみます。

Hadoop Tutorial - Getting Started with HDP
http://hortonworks.com/hadoop-tutorial/hello-world-an-introduction-to-hadoop-hcatalog-hive-and-pig/

上記ページのリンクから、「Geolocation.zip」というデータをダウンロードして解凍します。
中身はcsvが2つ。このデータを可視化するまでがチュートリアルのようですね。
チュートリアルの通りに進めていきます。

Ambariを開き、左上のメニューから、「HDFS Files」を選びます。

snip_20161207202113.png

userを選択

snip_20161207202454.png

maria_devを選択

snip_20161207202549.png

右上のNew Directoryを選択

snip_20161207202711.png

dataディレクトリを作成

snip_20161207202751.png

さらに、dataディレクトリの下に移動して

snip_20161207202958.png

Geolocationに入っていたcsvをUpload!

snip_20161207203120.png

でん!

snip_20161207203406.png

一つ上の階層に戻って、dataフォルダの上で右クリック。
Permissionsを選択します。

snip_20161207204231.png

Writeをクリックして、青色にして保存します。

snip_20161207204406.png

snip_20161207204508.png

これでHDFSにデータをロードするところまでできました。
続きでは、データのテーブル化や分析が始まるようです。

チュートリアルは英語ですが、図や説明も多く、
ここまではとてもわかりやすく進めることができました。
・・・挫折しないようにします。

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2