Community Articles

Find and share helpful community-sourced technical articles.
Labels (2)
avatar
Contributor

Introduction

Ambari 2.4 introduces the Hue-to-Views Migration tool, which is specifically designed to migrate existing Hue artifacts to an Ambari View.

Currently in Hue the hive queries are saved in ‘Saved Queries’ in Hue UI. These queries can be invoked by the user by going to Saved Queries in Hue UI. HUETOAMBARI_MIGRATION would help in migrating these saved Hive artifacts from Hue to Ambari Hive View. Once the migration is done, the Saved Queries can be viewed from Ambari Hive View.

Currently HUETOAMBARI_MIGRATION would help in migrating the following artifacts from Hue to Ambari Views.

  1. Hive - Saved Queries, Query History
  2. Pig - Saved Scripts, Pig Jobs

The view would use JDBC to connect to Hue database to obtain the artifacts. Once obtained, these would be stored in the Ambari View Server database.

Today, the view migrates the scripts one user at a time. The user to be migrated would be specified during the migration.

Note:- This view does not validate scripts. Non-working Hue scripts will not work in Ambari Views.

Pre-requisites

  • Ambari Server serving the HUETOAMBARI_MIGRATION view should have connectivity to Hue server
  • Only users with 'Cluster Admin' privilege can do the migration
  • Ambari and Hue JDBC connection details are required while configuring the view
  • The user whose artifacts are being migrated should also exist in Ambari with correct permissions to the respective View (Hive / Pig)
  • Hive and Pig view should be pre-configured and in a workings state

Following article describes how to use HUETOAMBARI_MIGRATION view.

Migrating Hue Artifacts to an Ambari View

  1. View Creation: -

1.1 Create an Instance by going admin > manage ambari > views

7110-screen-shot-2016-08-23-at-102613-am.png

1.2 Give a suitable Name

7111-screen-shot-2016-08-23-at-102943-am.png

1.3 Enter view Parameters

7120-screen-shot-2016-08-23-at-103122-am.png

To show how to fill up the view-parameters we have assumed the following and we will use this while writing the examples in the table

1.Hue Server url :- c6401.ambari.apache.org

2.Hue NameNode URI:-c6402.ambari.apache.org

3.NameNode port:- 50070

4.Hue Database Name(mysql):- Huedb

5.Hue Database username(mysql):- hue

6.Hue Database Password(mysql):- hue

7.Ambari Hostname:-c6402.ambari.apache.org

8.Ambari Database Name(postgresql):- ambari

9.Ambari Database username(postgresql):- ambari

10.Ambari Database Password(postgresql):- bigdata

The table below describes each of the parameters

PropertyDescriptionSyntaxExample
Hue Http URLHttps url where Hue server is located<hue http url>http://c6401.ambari.apache.org:8000/
Hue Server hostnameHostname of Hue Server<hue hostname>c6401.ambari.apache.org
Ambari http URLHttp url where Ambari Server <ambari http url>http://c6402.ambari.apache.org:8080/
Ambari Server hostnameHostname of Ambari server<ambari hostname>c6402.ambari.apache.org
Webhdfs URI(Hue)Namenode URI of Huewebhdfs://<hostname>:50070webhdfs://c6402.ambari.apache.org:50070
Webhdfs URI(Ambari)NameNode URI of Ambariwebhdfs://<hostname>:50070webhdfs://c6402.ambari.apache.org:50070
Hue Database DriverJDBC Driver to access Hue DB <db driver>com.mysql.jdbc.Driver
Hue JDBC URLJDBC Url to access Hue DBjdbc:<dbtype>://<hostname>/<db name>jdbc:mysql://c6401.ambari.apache.org/huedb
Hue Database UsernameHue Database Username<db username>hue
Hue Database PasswordHue Database Password<db password>hue
Ambari Database DriverJDBC Driver to access Ambari DB<db driver>org.postgresql.Driver
Ambari JDBC URLJDBC Url to access Ambari DBjdbc:<dbtype>://<hostname>/<db name>jdbc:postgresql://c6402.ambari.apache.org:5432/ambari
Ambari Database UsernameAmbari Database Username<db username>ambari
Ambari Database PasswordAmbari Database Password<db password>bigdata
Kerberos enabled on Ambari cluster?(y/n)(y/n) for Kerberos <y/n>n
principal name (if kerberos is enabled)If Kerberos enable, Principal Name must be given or else it should be left blank<principal username>ambari-cl1

**For HA Setups: The Hue-to-Views Migration View does not support HA. You must provide the current active namenode for the target cluster regarding the Webhdfs URI for Ambari.

After submitting all the view parameters. click on save. wait for the instance to successfully created.

once the instance is successfully created . click on "Go to instance"

7121-screen-shot-2016-08-31-at-104939-am.png

2.Work flow of the view

2.1 Configuration check

If entered values in view parameters are correct then configuration check will succeed and home page of the view will open, incase of any wrong entries in view parameters configuration check will fail and proper stack trace will be shown

7113-screen-shot-2016-08-24-at-44746-pm.png

In case of any wrong entries in view parameter

7123-screen-shot-2016-08-31-at-111551-am.png

2.2 Hive Migration

Click on Hive → HiveHistory Query to transfer executed queries.

Click on Hive → HiveSaved Query to transfer saved queries.

7114-screen-shot-2016-08-31-at-100656-am.png

fill up the details

1. User Name (Hue User Name)

1.1 In Ambari also the user should exist in the same name. In this case "hue".

1.2 Make sure that the user in Ambari has the proper access rights to hive and pig views.

7124-screen-shot-2016-08-31-at-115231-am.png

Here ,the user "hue" exist in Ambari and has the right to access "HiveView123","hive_1" and "pig_view".

2. Instance Name (Hive View Instance where the queries need to be transferred)

**Make sure the user has permission to access the view instance.In this case target instance is "hive_1" to which user hue has proper access rights.

3. Start Date (Date from which queries need to be transferred - excluding)

4. End Date (Date to which queries need to be transferred - excluding)

7115-screen-shot-2016-08-31-at-100707-am.png

Click ‘Submit’. The transfer takes places and the below report is generated

7116-screen-shot-2016-08-31-at-100723-am.png

2.3 Pig Migration

Click on PigSaved Script to transfer saved pig jobs

Click on PigJob to transfer executed pig jobs

7117-screen-shot-2016-08-31-at-102447-am.png

fill up the details

1. User Name (Hue User Name) ** The queries will be migrating to the same username in Ambari view (make sure that the user exist in Ambari and has the proper right to access Pig views )

2. Instance Name (Pig View where the queries need to be transferred)

3. Start Date (Date from which queries need to be transferred - excluding)

4. End Date (Date to which queries need to be transferred - excluding)

7118-screen-shot-2016-08-31-at-102500-am.png

Click ‘Submit’. The transfer takes places and the below report is generated

7119-screen-shot-2016-08-31-at-102515-am.png

The migration reports shows the Total number of query selected according your your search criteria(start date, end date ),Number of query actually transferred,Total time taken.

You can verify the migration by login into the hive view or pig view.

Happy migration...


screen-shot-2016-08-31-at-105712-am.pngscreen-shot-2016-08-23-at-103122-am.png
3,004 Views