Vikas Hardia
Vikas Hardia

Reputation: 2695

how to manually start/stop hadoop services on boot up/down?

Hi is someone aware about stopping and starting CDH(cloudera distribution Hadoop) Services with script we are doing this for production servers. For an instance if servers are restarted then before reboot all the Hadoop services stops gracefully and on startup the start.

I have a 8 Node Hadoop cluster on RHEL with cloudera 5.4.7 installed on it. Till now i have identified few ways to do that one is here on link it says i have to use chkconfig to register the service on OS for eg as below:

sudo chkconfig hadoop-hdfs-namenode on

But when i am doing that i am getting error as

error reading information on service hadoop-hdfs-namenode: No such file or directory

which clearly states that it is unable to find the file i have specifed. Then i searched for file and it is located in

/opt/cloudera/parcels/CDH-5.4.7-1.cdh5.4.7.p0.3/etc/rc.d/init.d/hadoop-hdfs-namenode
/opt/cloudera/parcels/CDH-5.4.7-1.cdh5.4.7.p0.3/etc/default/hadoop-hdfs-namenode

the i tried executing the same commands from the folder itself where files are located but the same error. The permissions are fine on file and tried ./ as well but same error.

I am also able to list all the process which are currently running by

sudo jps
14035 -- process information unavailable
10615 -- process information unavailable
15323 -- process information unavailable
5486 -- process information unavailable
2001 -- process information unavailable
46991 -- process information unavailable
42667 -- process information unavailable
33732 Jps
2698 -- process information unavailable
2727 -- process information unavailable
7901 -- process information unavailable
42624 -- process information unavailable

As one can see process names are not coming but these are hadoop process so to stop the process i can kill all of them but this is not the way to gracefully stop hadoop managed by cloudera. Please let me know if anyone is aware of anything which can help me moving forward.

Upvotes: 0

Views: 2240

Answers (2)

Vikas Hardia
Vikas Hardia

Reputation: 2695

Thanks to cloudera they provide a way to boot services on system startup. Below is the way to do that:

  1. Click on the service
  2. Go to the configuration
  3. Search for Automatically Restart Process
  4. Check the Check-Box.

It will restart the services on bootup.

Upvotes: 2

Bhuvan
Bhuvan

Reputation: 104

you can do this by executing curl command form shell script. For example to start solr service you can use

curl -u admin:admin -X POST http://ipaddress:7180/api/v4/clusters//services/solr1/commands/start -H 'Content-type:aplication/json; charset=utf-8';

For More details on the visit http://cloudera.github.io/cm_api/apidocs/v10/index.html

Upvotes: 0

Related Questions