代码之家  ›  专栏  ›  技术社区  ›  user84592

K8S集成EFK,抛出状态码406

  •  0
  • user84592  · 技术社区  · 7 年前

    我的Win10上有3台虚拟机(virtualbox centos 7.4)。我尝试配置EFK以便监视日志。我有1个master+2个节点,master也有kubelet。

    我按照 this link .我没有更改下载的kubernetes/cluster/addons/fluentd elasticsearch,

    我没有跟踪,因为我使用的是特定于云的服务。

    volumeClaimTemplates:
      - metadata:
          name: elasticsearch-logging
        spec:
          accessModes: ["ReadWriteOnce"]
          storageClassName: managed-premium
          resources:
            requests:
              storage: 64Gi
    

    我把大部分中文镜像站点的镜像链接改为gcr.io。

    在链接中,它说,

    我在安装ElasticSearch时遇到了一个问题。不管怎样 原因,ElasticSearch没有自动将丢失的碎片分配给 服务器,有必要对其中一个ElasticSearch进行解压 pods,然后打开自动碎片分配:

    我遵照指示,

    $ kubectl exec -it elasticsearch-logging-0 -n kube-system -- /bin/bash
    $ curl -XPUT 'http://elasticsearch-logging:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable": "all" } }'
    

    但我按照说明得到了错误,状态代码406。

    {“error”:”Content-Type header [application/x-www-form-urlencoded] is not supported”,”status”:406}
    

    任何提示。我能做什么?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Konstantin Vustin    7 年前

    curl -XPUT 'http://elasticsearch-logging:9200/_cluster/settings' -H 'Content-Type: application/json' -d '{ "transient": { "cluster.routing.allocation.enable": "all" } }'
    
    推荐文章