Created on 08-31-2016 11:42 AM - edited 08-17-2019 10:32 AM
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.
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
Following article describes how to use HUETOAMBARI_MIGRATION view.
Migrating Hue Artifacts to an Ambari View
1.1 Create an Instance by going admin > manage ambari > views
1.2 Give a suitable Name
1.3 Enter view Parameters
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
Property | Description | Syntax | Example |
Hue Http URL | Https url where Hue server is located | <hue http url> | http://c6401.ambari.apache.org:8000/ |
Hue Server hostname | Hostname of Hue Server | <hue hostname> | c6401.ambari.apache.org |
Ambari http URL | Http url where Ambari Server | <ambari http url> | http://c6402.ambari.apache.org:8080/ |
Ambari Server hostname | Hostname of Ambari server | <ambari hostname> | c6402.ambari.apache.org |
Webhdfs URI(Hue) | Namenode URI of Hue | webhdfs://<hostname>:50070 | webhdfs://c6402.ambari.apache.org:50070 |
Webhdfs URI(Ambari) | NameNode URI of Ambari | webhdfs://<hostname>:50070 | webhdfs://c6402.ambari.apache.org:50070 |
Hue Database Driver | JDBC Driver to access Hue DB | <db driver> | com.mysql.jdbc.Driver |
Hue JDBC URL | JDBC Url to access Hue DB | jdbc:<dbtype>://<hostname>/<db name> | jdbc:mysql://c6401.ambari.apache.org/huedb |
Hue Database Username | Hue Database Username | <db username> | hue |
Hue Database Password | Hue Database Password | <db password> | hue |
Ambari Database Driver | JDBC Driver to access Ambari DB | <db driver> | org.postgresql.Driver |
Ambari JDBC URL | JDBC Url to access Ambari DB | jdbc:<dbtype>://<hostname>/<db name> | jdbc:postgresql://c6402.ambari.apache.org:5432/ambari |
Ambari Database Username | Ambari Database Username | <db username> | ambari |
Ambari Database Password | Ambari 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"
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
In case of any wrong entries in view parameter
2.2 Hive Migration
Click on Hive → HiveHistory Query to transfer executed queries.
Click on Hive → HiveSaved Query to transfer saved queries.
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.
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)
Click ‘Submit’. The transfer takes places and the below report is generated
2.3 Pig Migration
Click on PigSaved Script to transfer saved pig jobs
Click on PigJob to transfer executed pig jobs
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)
Click ‘Submit’. The transfer takes places and the below report is generated
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...