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?
As it discusses, if you want your parcel to affect an existing service, it should provide the 'foo-plugin' tag for that service, or cdh-plugin if you really want to affect all of them.
Only one parcel can provide the required tag ('cdh' in this case), and obviously the CDH parcel provides that.
What is your parcel providing that you want it to affect all services? LZO is a highly unusual example in this regard.
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.
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.
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.
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?
I checked this folder before, there is no "process" folder. i am using cm v5.
[root@lcigh158 cloudera-scm-agent]# pwd
[root@lcigh158 cloudera-scm-agent]# ls
cloudera-scm-agent.log cmf_listener.log supervisord.out