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.

oozie property file

oozie property file

New Contributor

Ozzie Configuration file (job.properties file) is created based on environment obviously (test, ver or prod environments where it is running). Customer felt that the Production job Properties file will be  invoked only if prod is running(obviously). So the file was not tested out file before production. So we need to have a single file with all the environment variables which suppose to provide appropriate variables to workflow.xml based on where it is running. We need to consolidate/standerdaise  all environment variables into one single property file and should work on all the enviornments (test, ver or prod environments) . Anybody please help me to do this

3 REPLIES 3
Highlighted

Re: oozie property file

Champion
The properties files is just a list of k/v pairs that then get applied in the workflow.xml.

To achieve what you want you will need to write a script (Bash, Python, Perl, etc.) that detects the environment and then updates the nameNode and jobTracker values (those are the two big ones I recall that are cluster specific).

Re: oozie property file

New Contributor

Thanks for your quick reply.Looks like a great idea.  

 

I think the psudo code for your suggestion is

 

If test environment

write  property file for test or use test environment variables from consolidated property file.

 

else If ver environment

write property file for ver or use ver environment variables from consolidated property file.

 

else prod environment

write property file for prod or use prod environment variables from consolidated property file.

 

Here are my question on this.

1. Where we are going to run the bash script inside oozie(shell action) or outside oozie using crontab?

2. If we are plasnning to run this inside  oozie using shell action in Oozie, to run a shell action we need to send propert file or environment specific information right (Job tracker etc)?

3. If we are planning to run this outside  oozie, now my question would be how we are going to pass which environment (test,ver or prod) the bash script is running. How the bash script know the environment?

So it is kind of confusing me. Looking for your valuable suggestion.

  Thanks in advance.

Re: oozie property file

Champion
Either oozie or cron should work. As for how to tell it the env, my first inclination is to look for something at the OS level that you can check like hostname. If the hostname has something that identifies the environment, read, parse, and detect.
Don't have an account?
Coming from Hortonworks? Activate your account here