Created on 09-26-2020 03:22 PM - edited 09-26-2020 03:23 PM
Hello,
I'm using Ubuntu 16 and Cloudera 6.2.1. I need to startup a couple other agents only after CDH HDFS has completely started upon OS start, which can take several minutes. I am unsure how to do this.
Anyone have any pointers?
Thank you.
Created 09-28-2020 08:05 AM
This will depend on what these other agents are to a large extent, but in the general case there are two options:
1) Run a cron job: one, check to see if the process is already running; two, check to see if HDFS is running; three start the process if neither of the above are true.
2) I believe Ubuntu 16 uses systemd. In systemd start order can be controlled via dependencies in the unit file of the process. You will have to reference it specifically for your version, but I believe there are two relevant settings: wants or requires determines which processes run together; before and after determines the order in which they are run. The most thorough solution is to set these other agents' unit files as requires HDFS and after HDFS.
Created 09-29-2020 12:56 PM
@muslihuddin , you can delay other agent startups using the “X-GNOME-Autostart-Delay” parameter under ~/.config/autostart/
You can add a delay by opening ~/.config/autostart and edit the related files. You should add the following commands:
X-GNOME-Autostart-enabled=true X-GNOME-Autostart-Delay=100
Ref: https://askubuntu.com/questions/48321/how-do-i-start-applications-automatically-on-login/48327#48327
Created 09-27-2020 10:12 PM
I think you can just run the linux command anytime.
Your command will only be HDFS command once you use #hdfs dfs
Created 09-28-2020 07:11 AM
Created 09-28-2020 08:01 AM
Hello @HV_Training ,
thank you for reaching out to Community with your question on how to check whether HDFS is started.
Can you please clarify what do you exactly consider "HDFS is fully started"?
If we are happy with an active NameNode as a "HDFS service started" state, I would use the CM API to find out if I already have an active NameNode by a REST call:
https://archive.cloudera.com/cm6/6.3.0/generic/jar/cm_api/apidocs/json_ApiNameservice.html
Please let us know if it covers your inquiry.
Thank you:
Ferenc
Ferenc Erdelyi, Technical Solutions Manager
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
Created 09-29-2020 12:56 PM
@muslihuddin , you can delay other agent startups using the “X-GNOME-Autostart-Delay” parameter under ~/.config/autostart/
You can add a delay by opening ~/.config/autostart and edit the related files. You should add the following commands:
X-GNOME-Autostart-enabled=true X-GNOME-Autostart-Delay=100
Ref: https://askubuntu.com/questions/48321/how-do-i-start-applications-automatically-on-login/48327#48327
Created 09-29-2020 01:11 PM
Thanks to everyone to answered this question. Many were helpful!
Created 09-28-2020 08:05 AM
This will depend on what these other agents are to a large extent, but in the general case there are two options:
1) Run a cron job: one, check to see if the process is already running; two, check to see if HDFS is running; three start the process if neither of the above are true.
2) I believe Ubuntu 16 uses systemd. In systemd start order can be controlled via dependencies in the unit file of the process. You will have to reference it specifically for your version, but I believe there are two relevant settings: wants or requires determines which processes run together; before and after determines the order in which they are run. The most thorough solution is to set these other agents' unit files as requires HDFS and after HDFS.
Created 09-29-2020 01:12 PM
I used the systemd. It worked great. Again, I appreciate everyone's help!