官术网_书友最值得收藏!

Installing and configuring Hue

The Hortonworks virtual machine already has one version of Hue running, but that is very old. We will install the latest version of Hue ourselves since it has a better Oozie editor.

Start the virtual machine. Once the machine is up and running, we can log in to that via SSH using the following command:

$ ssh root@127.0.0.1 -p 2222

The default password is hadoop.

Let's download and configure Hue. Here are the steps to do so:

  1. Download the latest release of Hue.
  2. Install the dependencies required to build Hue via yum.
  3. Build the Hue package using the make command.
  4. Before you execute the following commands, check the Hue website ( version is present:
    $ mkdir -p /opt/learn_oozie/hue
    $ chmod 777 /opt/learn_oozie/hue
    $ chown hue:hue /opt/learn_oozie/hue
    $ sudo su hue
    $ cd /opt/learn_oozie/hue
    $ # Download Hue
    $ wget https://dl.dropboxusercontent.com/u/730827/hue/releases/3.8.1/hue-3.8.1.tgz
    $ tar -xvf hue-3.8.1.tgz
    $ cd hue-3.8.1
    $ Install dependencies required to build Hue
    $ yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel make mysql mysql-devel openldap-devel python-devel sqlite-devel openssl-devel gmp-devel
    $ Build Hue
    $ make apps
    
  5. Wait for some time for Hue to get ready. You can also run the following scripts to do all the steps in one go:
    <BOOK_CODE_HOME>/ch02/scripts/install_hue.sh
    

    Once it is successful, you will get following message:

    Post-processed 'zookeeper/art/line_icons.png' as 'zookeeper/art/line_icons.f50a9ca444bf.png'
    Post-processed 'zookeeper/art/icon_zookeeper_24.png' as 'zookeeper/art/icon_zookeeper_24.e3168d30a559.png'
    Post-processed 'zookeeper/help/index. ml'
    Post-processed 'zookeeper/css/zookeehtml' as 'zookeeper/help/index.7570dbb625f3.htper.css' as 'zookeeper/css/zookeeper.dab3cbab10bb.css'
    Post-processed 'zookeeper/js/base64.js' as 'zookeeper/js/base64.ce5e02af31e5.js'
    576 static files copied to '/opt/learn_oozie/hue/hue-3.8.1/build/static', 576 post-processed.
    make[1]: Leaving directory `/opt/learn_oozie/hue/hue-3.8.1/apps'[hue@sandbox hue-3.8.1]$
    

    Tip

    To save time in copying files from host machine to guest and vice versa, I have configured my host machine's Home folder as shared folder with guest. You can also do the same.

We need to start Hue now, but before that we need to make few changes to the Hue configuration file, hue.ini.

Following are the steps to make the changes and start Hue:

  1. The default port of Hue, 8888, is already used in this virtual machine. So we will change the port for Hue in our machine.
  2. Open the file in vi or your favorite editor and enter the following command:
    $ vi desktop/conf/hue.in
    
  3. Change the port from 8888 to 18888.

    There are few other changes related to hue.ini in which we need to change the hostname to sandbox.hortonworks.com. I have already done those changes in the hue.ini file. So you can just copy it from following location:

    <BOOK_CODE_HOME>/ch02/files/hue/hue.ini

    We need to add one port forwarding to see the Hue web page in the host machine.

  4. Open running VirtualBox.
  5. Go to Settings | Networking | Port Forwarding. Click on Add new port forwarding rule.
  6. Add one more entry to forward port 8888 on guest to host at 18888, as shown in the following screenshot:

    Hue port forwarding

  7. Let's start Hue using the following commands:
    $ sudo su hue
    $ cd /opt/learn_oozie/hue/hue-3.8.1
    $ build/env/bin/supervisor
    

    Once this is successful, you will get the following message:

    [hue@sandbox hue-3.8.1]$ build/env/bin/supervisor
    [INFO] Not running as root, skipping privilege drop
    starting server with options {'ssl_certificate': None, 'workdir': None, 'server_name': 'localhost', 'host': '0.0.0.0', 'daemonize': False, 'threads': 40, 'pidfile': None, 'ssl_private_key': None, 'server_group': 'hue', 'ssl_cipher_list':'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2', 'port': 18888, 'server_user': 'hue'}
    
  8. On the host machine, use your browser and open the URL http://127.0.0.1:18888/.
  9. Pick up any username and password for first login. I have chosen hue for both username and password.

    Note

    Take some time to browse the Hue interface. Hue has lots of functionality we can run, such as Hive, Pig, and Oozie jobs.

We are interested in the Workflow editor functionality, where we can edit and watch the Oozie jobs. Click on Workflows and take some time to see what Hue provides.

Note

This often happens with me! Learning new things make me forget the basics. So, if you need, have a quick refresher for XSD by referring to the following links:

http://www.w3schools.com/schema

http://www.w3schools.com/xml/default.asp

主站蜘蛛池模板: 刚察县| 泰州市| 遵义县| 福清市| 襄樊市| 乌拉特后旗| 潜江市| 抚州市| 博爱县| 桂林市| 泸州市| 维西| 手机| 康马县| 黔西县| 中江县| 永康市| 恭城| 尉犁县| 水城县| 崇州市| 峨山| 永善县| 宣城市| 称多县| 任丘市| 施甸县| 乐清市| 富顺县| 大宁县| 台前县| 邵阳县| 岫岩| 如东县| 德江县| 缙云县| 周口市| 万盛区| 纳雍县| 东莞市| 和田县|