Fabric CA 健康检查

发布于 2025-01-17 07:45:53 字数 764 浏览 2 评论 0原文

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

。 io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request" rel="nofollow noreferrer">livenessProbe 在 CA 部署中的情况如下:

    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /healthz
        port: 9443
        scheme: HTTP
      initialDelaySeconds: 10
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1

配置此活性探针后,pod 继续重新启动,并出现事件 Livenessprobe failed: HTTPprobe failed with status code :400。为什么会发生这种情况?

I have a hyperledger fabric network v2.2.0 deployed with 2 peer orgs and an orderer org in a kubernetes cluster. Each org has its own CA server. The CA pod keeps on restarting sometimes. In order to know whether the service of the CA server is reachable or not, I am trying to use the healthz API on port 9443.

I have used the livenessProbe condition in the CA deployment like so:

    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /healthz
        port: 9443
        scheme: HTTP
      initialDelaySeconds: 10
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1

After configuring this liveness probe, the pod keeps on restarting with the event Liveness probe failed: HTTP probe failed with status code: 400. Why might this be happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

番薯 2025-01-24 07:45:53

HTTP 400 代码

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

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

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

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

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

HTTP 400 code:

The HTTP 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).

This indicates that Kubernetes is sending the data in a way hyperledger is rejecting, but without more information it is hard to say where the problem is. Some quick checks to start with:

  • Send some GET requests directly to the hyperledger /healthz resource yourself. What do you get? You should get back either a 200 "OK" if everything is functioning, or a 503 "Service Unavailable" with details of which nodes are down (docs).
  • kubectl describe pod liveness-request. You should see a few lines towards the bottom describing the state of the liveness probe in more detail:
Restart Count:  0
.
.
.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned example-dc/liveness-request to dcpoz-d-sou-k8swor3
Normal Pulling 4m45s kubelet, dcpoz-d-sou-k8swor3 Pulling image "nginx"
Normal Pulled 4m42s kubelet, dcpoz-d-sou-k8swor3 Successfully pulled image "nginx"
Normal Created 4m42s kubelet, dcpoz-d-sou-k8swor3 Created container liveness
Normal Started 4m42s kubelet, dcpoz-d-sou-k8swor3 Started container liveness

Some other things to investigate:

  • httpGet options that might be helpful:
  • You may need a valid client certificate (if TLS is enabled, and clientAuthRequired is set to true).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文