Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

how to stop all cloudera cluster services command line in single command?

avatar
New Contributor

how to stop all cloudera cluster services command line in single command?

We have CDH5.2 cluster setup using CM. We are assigned a task to write automation script to run TestDFSIO benchmark.

The tests needs to be run multiple time with pristine environment for diff. set of data size.

To achieve this I need to stop and start cluster each time before starting with TestDFSIO commands.

Want to know what is a single command using which I could stop all cluster services? It should be similar to what is called after clicking on "STOP" cluster and "START" cluster button on CM  home page.

 

1 ACCEPTED SOLUTION

avatar
Guru

You can use the API to stop and then subsequently start the cluster programatically if you'd like.

 

The one question I have is why you feel it is required to restart all the services in between test runs.  Is it because you want to make sure heap is cleared and just assure there are no lingering file handles/etc. from the last job?

View solution in original post

5 REPLIES 5

avatar
Guru

You can use the API to stop and then subsequently start the cluster programatically if you'd like.

 

The one question I have is why you feel it is required to restart all the services in between test runs.  Is it because you want to make sure heap is cleared and just assure there are no lingering file handles/etc. from the last job?

avatar
New Contributor

 

Thanks Clint.

I need to do this because I want each benchmark test to be run in pritine environment.

avatar
A restart in this case shouldn't be necessary, and can also mess up your benchmarking results if you aren't careful, as all services will be in a "cold start" state since all caches will be empty upon restart.

avatar
Contributor

Is there any CLI command available too? for doing the Services management. Its good when need to manage services automated using Cloudera Manager.

avatar
New Contributor

You can stop the services with the following: (another option is just to use restart, I like stop, verify all processes are gone/down then do the start when needed.)

 

 

Cloudera Manager Server: (stop agent, stop the server, stop database if using local postgres default )

sudo /sbin/service cloudera-scm-agent stop
sudo /sbin/service cloudera-scm-server stop
sudo /sbin/service cloudera-scm-server-db stop

 

Do the reverse to start:

 

sudo /sbin/service cloudera-scm-server-db start
sudo /sbin/service cloudera-scm-server start
sudo /sbin/service cloudera-scm-agent start

 

On the other nodes of  your servers in the cluster just stop/restart the agent.

sudo /sbin/service cloudera-scm-agent stop

sudo /sbin/service cloudera-scm-agent start

or

sudo /sbin/service cloudera-scm-agent restart

 

 

You can do the following to get a status of the services as well.

 

sudo /sbin/service cloudera-scm-server-db status
sudo /sbin/service cloudera-scm-server status
sudo /sbin/service cloudera-scm-agent status

 

May want to do a ps -ef |grep cloudera-scm to verify all processes are stopped on each server.