Need server environment variables instead of local machine

Highlighted
Seven Stars

Need server environment variables instead of local machine

I'm using talend enterprise edition, I'm trying to use system environment variables as parameters for my jobs. when using system.getenv("paramname") and runnig the job, I'm getting the values from my local machine. what I need to do to to get the values from the talend server machine. The idea is to centrally add all the parameters as environment variables in the talend server and all users should use those env variables as parameters. any input is appreciated.


Accepted Solutions
Highlighted
Community Manager

Re: Need server environment variables instead of local machine

When it comes to folder and files you should configure your system so that you have access to them from wherever you are likely to be running your jobs. Having files in a shared location is what I generally do. It can be a pain to configure, but once sorted it makes life so much easier

View solution in original post


All Replies
Highlighted
Community Manager

Re: Need server environment variables instead of local machine

The job will get the environment variables of whatever machine runs it. If you want to use environment variables you will need to set them up on all machines that are running the jobs (the job servers and runtimes). You *could* run the jobs through the Studio on a Remote Jobserver and ensure the environment variables are on that machine. That would probably work

Highlighted
Employee

Re: Need server environment variables instead of local machine

Unfortunately, there is no easy way, or Java API, I know to get the Server Environment Variables rather than the local machine environment variables.

However, you can design this another way:  Create a DB table or File, and have these settings stored there.  Thus all jobs will read these variable values in their PreJob when starting up.

 

Highlighted
Seven Stars

Re: Need server environment variables instead of local machine

Hi

Thanks for responding, I tried adding the remote server in the preference section and set the "Target Exec" to the remote server, but the job goes to "Not responding" state at "Building Process" and it never comes back. any idea?

 

thanks

mj

Highlighted
Community Manager

Re: Need server environment variables instead of local machine

Highlighted
Seven Stars

Re: Need server environment variables instead of local machine

It works after setting the "Enable SSL" to true. Thanks, One problem is, how can we refer to files when running jobs from remote server. 

Suppose if I have file in another server or in local, when the job runs in remote server, how it will read or write to those files. assuming i'm using tfileoutputdelimited component, how this component has to be configured?

Highlighted
Community Manager

Re: Need server environment variables instead of local machine

When it comes to folder and files you should configure your system so that you have access to them from wherever you are likely to be running your jobs. Having files in a shared location is what I generally do. It can be a pain to configure, but once sorted it makes life so much easier

View solution in original post

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog