Reply
Contributor
Posts: 40
Registered: ‎07-23-2014
Accepted Solution

Why my parcel can't be sourced or run?

My environment script has never been sourced or run even though my parcel is at actived status for each host. The parcel files were indeed distributed into each host.

I also tried restart the cluster, it was not working. Then I tried to manually source the script in a host, it could work, so the script itself has no problem.

I am wondering if any procedure was missed? Or any naming rule for the script? How can i tell if my parcel's shell script has been sourced by CM?

Cloudera Employee
Posts: 23
Registered: ‎07-19-2013

Re: Why my parcel can't be sourced or run?

The environment script is sourced as part of starting processes - it's not a global thing that happens when you activate the parcel. So, assuming you start a process after activating the parcel, and assuming your parcel's 'provides' tags match what the process' service is looking for, it should get sourced.

 

Contributor
Posts: 40
Registered: ‎07-23-2014

Re: Why my parcel can't be sourced or run?

He, philipl, thanks for your response! I thought after activating the parcel, the source will be automatically sourced.
Could you tell me how to "start a process" from CM browser?
Cloudera Employee
Posts: 23
Registered: ‎07-19-2013

Re: Why my parcel can't be sourced or run?

When you start a role, you are starting a process.

 

Let's use a concrete example.

 

* The lzo parcel contains the lzo plugin that's used by essentially all services in CDH.

* You download and activate the lzo parcel. At this point, nothing changes - you need ot restart everything to pick up the new parcel

* So you restart Hive (for example)

* When the hive server process starts, the Agent will source the lzo parcel's env script which appends the lzo jar to the classpath.

* Now the hive server is running with lzo support

 

The lzo parcel provides 'cdh-plugin' so this parcel will be loaded for all CDH processes. If a parcel provides 'hdfs-plugin' then it would only be loaded for HDFS, etc.

 

https://github.com/cloudera/cm_ext/wiki/The%20parcel.json%20file#providing-tags

Contributor
Posts: 40
Registered: ‎07-23-2014

Re: Why my parcel can't be sourced or run?

Your reply is clear to me.
When I checked the LZO example, I found " $PARCELS_ROOT" and "$PARCEL" are used as predefined environment variables, but when I echoed them, nothing come out. there is no such environment variables defined using " export -p".
I am wondering how to list all cms managed environment variables and then use them to evaluate if my script has been sourced or not?
Cloudera Employee
Posts: 23
Registered: ‎07-19-2013

Re: Why my parcel can't be sourced or run?

Where are you trying to echo variables? You won't see them set except from inside your environment script (which is sourced, so echo won't do anything). To see if your parcel's script is being sourced, look at the stderr.log for the process you think should be loading your parcel.

Contributor
Posts: 40
Registered: ‎07-23-2014

Re: Why my parcel can't be sourced or run?

I found stderr.log from CM web console. Could you tell me what's the absolute path of the log that i can track each process?

 

Cloudera Employee
Posts: 23
Registered: ‎07-19-2013

Re: Why my parcel can't be sourced or run?

On each host, you have: /var/log/cloudera-scm-agent/process/<process-name>/logs/stderr.log

Contributor
Posts: 40
Registered: ‎07-23-2014

Re: Why my parcel can't be sourced or run?

I checked this folder before, there is no "process" folder. i am using cm v5.

 

[root@lcigh158 cloudera-scm-agent]# pwd
/var/log/cloudera-scm-agent
[root@lcigh158 cloudera-scm-agent]# ls
cloudera-scm-agent.log  cmf_listener.log  supervisord.out
cloudera-scm-agent.out  supervisord.log

Cloudera Employee
Posts: 23
Registered: ‎07-19-2013

Re: Why my parcel can't be sourced or run?

Sorry, /var/run

Announcements