使用 Azure RM 模板的 Elasticsearch 插件 add/remove

Elasticsearch plugin add/remove using Azure RM template

我正在使用 this 模板在 Azure 上设置 elasticsearch 和 kibana。您如何 add/remove 将插件添加到使用上述 ARM 模板部署的集群?例如ARM 模板,默认部署了 Marvel 插件,即使它会在一个月后停止工作,除非应用许可证,我想删除它并添加另一个插件。

Marvel has a Basic license 提供对关键监控功能的访问。此许可可免费用于商业用途,您只需注册您的详细信息即可获得许可。

Azure ARM 模板是一种在 Azure 中部署和 运行Ning Elasticsearch 集群的简单方法,部署后,您可以像在自己的硬件上管理集群一样管理它或任何其他云提供商。要安装和卸载插件,您需要 运行 集群中每个节点上的插件安装脚本。

为此,您首先需要通过 ssh 连接到每个节点。您可以通过与集群在同一网络中的机器的 public IP 地址获得对每个 Elasticsearch 节点的外部访问;可以使用 Kibana IP 或 jumpbox IP(如果你安装了一个)

ssh <Kibana IP address>

您需要设置 ssh 密钥,并将使用您在第一步(基本设置)中配置的密码或 ssh 密钥来获得访问权限。一旦您登录到这台机器,您就可以使用每台机器的内部 IP 地址通过 ssh 连接到集群中的每个节点。你可以通过在 Azure 门户中查看虚拟网络上的附加设备来找到每个内部 IP 地址。例如,一旦通过 ssh 进入 Kibana 节点,要访问 10.0.0.5 上的主节点将是

ssh 10.0.0.5

再次使用您在第一步中配置的密码或 ssh 密钥获得访问权限。

访问节点后,您可以通过插件安装脚本安装插件。例如,要在 Elasticsearch 2.4.0 节点上安装 mapper-attachments 插件将是

sudo /usr/share/elasticsearch/bin/plugin install mapper-attachments

然后您需要 start/restart 节点。

Monit 作为部署的一部分安装到每个 VM 上,以便在 elasticsearch 进程意外停止时自动重新启动它。如果要停止安装插件的服务,使用monit停止进程

sudo monit -g elasticsearch stop

如果您看到错误

monit: Cannot connect to the monit daemon. Did you start it with http support?

然后使用

重新启动监控服务
sudo service monit restart

和运行命令再次停止elasticsearch组

sudo monit -g elasticsearch stop

完成更改后,您可以使用

再次启动 elasticsearch 服务
sudo service elasticsearch start
sudo monit start all

这也会再次启动monit来监控elasticsearch服务。

为确保您在集群中的所有节点上安装插件,最好使用类似 Puppet.

的方式自动执行此过程。

The template is open source under the MIT license so an alternative route would be to clone/fork this repository, make changes to the elasticsearch-ubuntu-install.sh脚本,然后部署这个修改后的部署模板。

万一你错过了,还有a blog post highlighting some of the features available in the ARM template.