Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hue Sqoop through Oozie - Passing Parameter values

Hue Sqoop through Oozie - Passing Parameter values

Explorer

Hi,

 

I am trying to pass the server details and username and password thorugh job.properties files in Sqoop action in HUE Oozie.

 

we are on sqoop 1.4.5-cdh5.3.3

 

If i run this command on CLI this runs fine, but on Hue Oozie workflow it fails

 

Command in sqoop action:

 

list-databases --connect "jdbc:sqlserver://${dbserver}:140" --username=edm_hadoop_user --password=${dbpass}

 

Scenario:

 

I have the job.properties files which has the below info in it and it is present along with workflow.xml file in HDFS.

 

dbserver=FACETS
dbport=140
dbuser=*******
dbpass=*******

 

1. if i populate "Parms" and test this with values to 'dbserver' and 'dbpass' it works fine, which i dont want to do it since i need to schedule this workflow and want it to run automatically by picking up the server and password details from a file

2. if i add "Job properties" like this

      property name = dbserver

      value=${dbserver} and like wise for dbpass as well it fails with error cannot resolve dbserver which means its not sustituting the values from job.properties file.

3. if i add "Files" and specify the job.properties file location in it its not picking up the values either and the job fails.

 

I have also created a job.xml file with above values in it as properties and gave that file name in "Job XML" even then the workflow failed.

 

How should i specify the parameters if i want to run sqoop action workflow from Hue oozie ?

 

 

5 REPLIES 5

Re: Hue Sqoop through Oozie - Passing Parameter values

Explorer
@Former Member could someone please help me on this.

Re: Hue Sqoop through Oozie - Passing Parameter values

Cloudera Employee

Hi, 

 

You should be able to define these variables in the job.properties file.

The job.properties is a properties file, not an XML. It's format is

property_name=value

 

So your file looks fine:

dbserver=FACETS
dbport=140
dbuser=*******
dbpass=*******

 

 

Have you referenced the job.properties in job submission with -config? It's not read from hdfs, but from the local file system in job submission time.

 

Re: Hue Sqoop through Oozie - Passing Parameter values

Explorer

Hi gezapeti,

 

i have a job.properties files with below properties in them.

 

dbserver=FACETSMEDIR
dbbase=RPT
dbport=140
dbuser=*****
dbpass=*****

 

I am not running the sqoop command from command line i am trying to setup a sqoop action from HUE OOZIE and i am not sure how to reference this properties file so that oozie picks it up and runs the sqoop command.

Re: Hue Sqoop through Oozie - Passing Parameter values

Cloudera Employee

When you're ediging an action, click on the gears in the top-right corner:Screen Shot 2016-11-21 at 3.37.23 PM.png

There you can add these parameters in the "Properties" section.

Screen Shot 2016-11-21 at 3.37.17 PM.png

 

I hope this helps, 

Re: Hue Sqoop through Oozie - Passing Parameter values

Cloudera Employee

You may also define workflow level properties if you click on the gear in the top-right corner:

Screen Shot 2016-11-21 at 3.40.52 PM.png

And add them in the workflow settings tab:

Screen Shot 2016-11-21 at 3.41.09 PM.png