X-Pack更新许可证

来源:互联网 发布:好一点淘宝男装店铺 编辑:程序博客网 时间:2024/04/29 14:43

原文:https://www.elastic.co/guide/en/x-pack/current/installing-license.html

您可以在运行时更新许可证,而无需关闭您的节点。许可证更新立即生效。该许可证作为您使用 API 安装JSON文件提供license

启用安全性时,需要集群管理员权限才能安装许可证。内置的elastic用户具有所需的权限。

更新您的许可证:

  1. licenseAPI 发送请求并指定包含新许可证的文件:

    curl - XPUT - u elastic'http :// <host>:<port> / _xpack / license' - H “Content-Type:application / json” - d @license.json  

    或在Windows机器上:

    gc .\license.json |  Invoke-WebRequest -uri http://<host>:<port>/_xpack/license -Credential elastic -Method Put

    哪里:

    • elastic是内置超级用户。默认密码为changeme如果还没有,请更改默认密码具有集群管理员权限的任何用户都可以安装许可证。
    • <host>是Elasticsearch节点的主机名(localhost如果在本地执行)
    • <port>是http端口(默认为9200
    • license.json 是许可证JSON文件
  2. 如果您正在安装的许可证不支持您以前的许可证提供的所有功能,您将在响应中收到通知。要完成许可证安装,则必须重新提交许可证更新请求,并设置acknowledge参数true,以表明你是知道的变化。

    curl - XPUT - u elastic'http :// <host>:<port> / _xpack / license?acknowledge = true' - H “Content-Type:application / json” - d @license.json
  3. windows下curl安装方法:在官网处下载工具包:http://curl.haxx.se/download.html    配置环境变量。

  4. 执行curl期间报错:curl: (1) Protocol 'http not supported or disabled in libcurl

  5. 解决方法是,把命令上的单引号换成双引号。

    curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'

    Woops, first try and already an error:

    curl: (1) Protocol 'http not supported or disabled in libcurl

    The reason for this error is kind of stupid, Windows doesn’t like it when you are using single quotes for commands. So the correct command is:

    curl XPUT "http://localhost:9200/api/twittervnext/tweet"
0 0