K8s集成EFK,抛出状态码406
K8s integrate EFK, status code 406 is thrown out
我的win10有3个虚拟机(VirtualBox centos 7.4)。我尝试配置 EFK 以便我可以监视日志。我有1master + 2nodes,master还有kubelet。
我遵循 this link 的指示。我没改下载kubernetes/cluster/addons/fluentd-elasticsearch,
因为我使用的是特定于云的服务,所以我没有进行以下操作。
volumeClaimTemplates:
- metadata:
name: elasticsearch-logging
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: managed-premium
resources:
requests:
storage: 64Gi
我将图像 link 主要是中文镜像站点更改为 gcr.io。
在 link 中,它说
I had one issue during my installation of Elasticsearch. For whatever
reason, Elasticsearch did not automatically assign missing shards to a
server, and it was necessary to shell into one of the elasticsearch
pods and then turn on automatic shard assignment:
我按照说明操作,
$ 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}
任何提示。我能做什么?
您错过了 header。试试这个:
curl -XPUT 'http://elasticsearch-logging:9200/_cluster/settings' -H 'Content-Type: application/json' -d '{ "transient": { "cluster.routing.allocation.enable": "all" } }'
我的win10有3个虚拟机(VirtualBox centos 7.4)。我尝试配置 EFK 以便我可以监视日志。我有1master + 2nodes,master还有kubelet。
我遵循 this link 的指示。我没改下载kubernetes/cluster/addons/fluentd-elasticsearch,
因为我使用的是特定于云的服务,所以我没有进行以下操作。
volumeClaimTemplates:
- metadata:
name: elasticsearch-logging
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: managed-premium
resources:
requests:
storage: 64Gi
我将图像 link 主要是中文镜像站点更改为 gcr.io。
在 link 中,它说
I had one issue during my installation of Elasticsearch. For whatever reason, Elasticsearch did not automatically assign missing shards to a server, and it was necessary to shell into one of the elasticsearch pods and then turn on automatic shard assignment:
我按照说明操作,
$ 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}
任何提示。我能做什么?
您错过了 header。试试这个:
curl -XPUT 'http://elasticsearch-logging:9200/_cluster/settings' -H 'Content-Type: application/json' -d '{ "transient": { "cluster.routing.allocation.enable": "all" } }'