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.

How to determine the current running configuration under /var/run/cloudera-scm-agent/process?

How to determine the current running configuration under /var/run/cloudera-scm-agent/process?

Contributor

For example, I can see a few hdfs-DATANODE configuration directories under /var/run/cloudera-scm-agent/process/

 

drwxr-x--x 3 apps apps 360 Oct 17 12:41 818-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 14:34 820-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 14:40 837-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 16:03 870-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 16:12 888-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 16:22 919-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 17 16:27 937-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 21 12:38 968-hdfs-DATANODE
drwxr-x--x 3 apps apps 360 Oct 26 11:55 979-hdfs-DATANODE
drwxr-x--x 3 apps apps 340 Oct 26 12:08 999-hdfs-DATANODE

 

How do I determine which directory contains the the current config files such as hdfs-site.xml for datanode role?

 

I tried to use the diretory which has the latest timestamp. But it turned out wrong. Should I use the diretory name that has the highest number? in above example, 999-hdfs_DATANODE should be the current running config dir?

 

 

 

Thanks!

2 REPLIES 2
Highlighted

Re: How to determine the current running configuration under /var/run/cloudera-scm-agent/process?

Super Guru

Hello,

 

The timestamp is what I use and it should be good enough most of the time.  When Cloudera Manager initiates the start of a process, the agent will create a new process directory by incrementing the prefix number.  In your example, you see that the highest incremented DATANODE process is 999-hdfs-DATANODE.  I usually use this sort of command to find the most recent process for a particular role:

 

cd /var/run/cloudera-scm-agent/process/`ls -lrt /var/run/cloudera-scm-agent/process/ | awk '{print $9}' |grep DATANODE| tail -1`/

 

When you said that it turned out to be wrong, can you explain more about how you found that out?  I'm surprised that the process directory created most recently could not be the one running.

 

Regards,

 

Ben

 

Highlighted

Re: How to determine the current running configuration under /var/run/cloudera-scm-agent/process?

Contributor

Thanks. In my example, I found 979-hdfs-DATANODE has a newer timestampe than 999-hdfs-DATANODE. I don't know if I  observed it correctly though. My question is that can I also assum the directory name that has the highest number is always the latest?

Don't have an account?
Coming from Hortonworks? Activate your account here