Run Solr Control Script in Kubernetes

8/22/2017

I have a Kubernetes installation with Zookeeper and Solr 6.0 services correctly installed. We can call solr-node-x any Solr instance. In order to check Solr Health I would like to use the Solr Control Script for HealthChek that normally would be called locally using for instance:

$ bin/solr healthcheck -c gettingstarted -z localhost:9865

How can I run that command against Solr within a Kubernetes deployment?

-- AR1
kubernetes
solr
solrcloud

1 Answer

8/22/2017

To avoid having a local instance of bin/solr, you can use the one inside one of your containers.

Depending on the image you're using, you can call any script in your container by using kubectl exec.

Usually it's a good idea to start by exploring the layout inside your container by getting a shell:

kubectl exec -it <name of container> -- /bin/bash

When you have the location of the bin/solr script inside your container you can call it directly:

kubectl exec -it <name of container> -- /path/to/bin/solr healthcheck -c gettingstarted -z localhost:9865
-- MatsLindh
Source: StackOverflow