Fabric CA 健康检查

Sou*_*rya 5 hyperledger-fabric-ca

hyperledger在集群中部署了一个结构网络 v2.2.0,其中有 2 个对等组织和一个排序组织kubernetes。每个组织都有自己的 CA 服务器。CA pod 有时会不断重新启动。为了知道CA服务器的服务是否可达,我尝试使用healthz端口9443上的API。

livenessProbe我在 CA 部署中使用了这样的条件:

    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /healthz
        port: 9443
        scheme: HTTP
      initialDelaySeconds: 10
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
Run Code Online (Sandbox Code Playgroud)

配置此活性探针后,Pod 会随着事件继续重新启动Liveness probe failed: HTTP probe failed with status code: 400。为什么会发生这种情况?

Mat*_*one 2

HTTP 400 代码

\n
\n

HTTP 400 错误请求响应状态代码表示服务器由于被认为是客户端错误的原因而无法或不会处理请求(例如,格式错误的请求语法、无效的请求消息帧或欺骗性的请求路由)。

\n
\n

这表明 Kubernetes 正在以拒绝的方式发送数据hyperledger,但在没有更多信息的情况下,很难说问题出在哪里。首先进行一些快速检查:

\n
    \n
  • 您自己直接向资源发送一些 GET 请求hyperledger /healthz。你得到了什么?200 "OK"如果一切正常,您应该返回 a ,或者返回 a 503 "Service Unavailable",其中包含哪些节点已关闭的详细信息(文档)。
  • \n
  • kubectl describe pod liveness-request。您应该看到底部有几行更详细地描述了活性探针的状态:
  • \n
\n
Restart Count:  0\n.\n.\n.\nEvents:\nType Reason Age From Message\n---- ------ ---- ---- -------\nNormal Scheduled <unknown> default-scheduler Successfully assigned example-dc/liveness-request to dcpoz-d-sou-k8swor3\nNormal Pulling 4m45s kubelet, dcpoz-d-sou-k8swor3 Pulling image "nginx"\nNormal Pulled 4m42s kubelet, dcpoz-d-sou-k8swor3 Successfully pulled image "nginx"\nNormal Created 4m42s kubelet, dcpoz-d-sou-k8swor3 Created container liveness\nNormal Started 4m42s kubelet, dcpoz-d-sou-k8swor3 Started container liveness\n
Run Code Online (Sandbox Code Playgroud)\n

其他一些需要调查的事情:

\n
    \n
  • httpGet可能有用的选项:\n
      \n
    • 方案 \xe2\x80\x93 协议类型 HTTP 或 HTTPS
    • \n
    • httpHeaders\xe2\x80\x93 要在请求中设置的自定义标头
    • \n
    • 配置了操作服务吗?
    • \n
    \n
  • \n
  • 您可能需要有效的客户端证书(如果启用了 TLS,并且clientAuthRequired设置为true)。
  • \n
\n