Wednesday, March 16, 2011

Hue Installation and Configuration

This section describes instructions for cloudera Hue installation and change its default configuration like configure other database with hue and send notification/email of job completion etc...


Installing Hue on one machine with CDH in pseudo-distributed mode:


To Install Hue:
  • With this single command hue will get installed

$ sudo apt-get install hue


To start Hue:
  • Start CDH

$ for service in /etc/init.d/hadoop-0.20-*; do sudo $service start; done
  • Start Hue

$ /etc/init.d/hue start
Some Default Configuration/Information:

Hue Installation Directory: /usr/share/hue/ Hue

Logging: /var/log/hue

Hue Configuration file: /etc/hue/hue.ini

Hue uses the CherryPy web server

http_port=8088

The Hue Database:

Hue requires a SQL database to store small amounts of data, including user account information as well as history of job submissions and Hive queries. By default, Hue is configured to use the embedded database SQLite
  • Inspecting the Hue Default Database

# sqlite3 /usr/share/hue/desktop/desktop.db
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select username from auth_user;
admin
test
sample
sqlite>

Configure Hue to Store Data in MySQL:

  • Create a new database in MySQL and grant privileges to a Hue user to manage this database


mysql> create database hue;
Query OK, 1 row affected (0.01 sec)
mysql> grant all on hue.* to 'hue'@'localhost' identified by 'secretpassword';
Query OK, 0 rows affected (0.00 sec)

  • Shut down Hue if it is running.
  • To migrate your existing data to MySQL, use the following command to dump the existing database data to a text file. Note that using the ".json" extension is required.

$ /usr/share/hue/build/env/bin/hue dumpdata > <fileName>.json
  • Open /etc/hue/hue.ini file, directly below the [[database]] line, add the following options

host=localhost
port=3306
engine=mysql
user=hue
password=secretpassword
name=hue
  • Install the Python drivers for MySQL into Hue’s environment

# su - hue -s /bin/bash
$ /usr/share/hue/build/env/bin/easy_install MySQL-python
  • As the Hue user, configure Hue to load the existing data and create the necessary database tables

$ /usr/share/hue/build/env/bin/hue syncdb --noinput
$ mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;"
$ /usr/share/hue/build/env/bin/hue loaddata <file-containing-dumped-data>.json
New Database is now configured and you can restart Hue



Configure Hue to send email notification:
  • Open /etc/hue/hue.ini file, directly below the [[smtp]]  line, add the following options
host = your host name
port = 25
user = your user name
password your password   
.
Hue logging: /var/log/hue
-->

No comments:

Post a Comment