运行 Kubernetes 中的 Solr 控制脚本

Run Solr Control Script in Kubernetes

我正确安装了 Kubernetes installation with Zookeeper and Solr 6.0 服务。我们可以调用 solr-node-x 任何 Solr 实例。 为了检查 Solr Health,我想使用通常会在本地调用的 Solr Control Script for HealthChek,例如:

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

我如何 运行 在 Kubernetes 部署中针对 Solr 命令?

为避免 bin/solr 的本地实例,您可以使用其中一个容器中的实例。

根据您使用的图像,您可以使用 kubectl exec 调用容器中的任何脚本。

通常从探索布局开始是个好主意inside your container by getting a shell:

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

当您在容器中找到 bin/solr 脚本的位置时,您可以直接调用它:

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