1

I want to restart solr cloud from command line or shell script. when i use the command sudo service solr-server restart it gives unrecognized service.

is there a way to restart solr cloud from command line?

I am using cloudea-serach 4.3 cdh 4.7

and also

1)is there a way to know the backend command executed by cloudera manager when the restart action is fired?

Bhuvan
  • 104
  • 9

2 Answers2

1

For anyone who is having the same question:

You can use the curl POST command

curl -u admin:admin -X POST http://ipaddress:7180/api/v4/clusters/<Cluster_name>/services/solr1/commands/start -H 'Content-type:aplication/json; charset=utf-8';
m4n0
  • 29,823
  • 27
  • 76
  • 89
Bhuvan
  • 104
  • 9
  • I'm getting this error while running the query: { "message" : "No content to map due to end-of-input\n at [Source: org.apache.cxf.transport.http.AbstractHTTPDestination$1@63620408; line: 1, column: 1]" }. – Alok Nath Saha Apr 03 '17 at 16:39
0

It works for me with @Bhuvan's solution just added escape char to run from Bash.

curl -k  -X POST -u user:password 'https://ipaddr:7183/api/v19/clusters/clustername/commands/restart' -H "Content-Type: **application\\/json**"
m4n0
  • 29,823
  • 27
  • 76
  • 89