Can hyperledger-fabric get the peer node running status without entering the docker container?

471 Views Asked by At

Can hyperledger-fabric get the peer node running status without entering the docker container? If so, how should I get it?

2

There are 2 best solutions below

1
On BEST ANSWER

In docker-compose file, for peer service add following env variable. (You may add a different port for different services)

- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9440

expose the port(You may expose port number as per availability). Export different port for different peer

ports:
  - 9440:9440

Once all services up hit the following path for specific service(As per port defined)

curl -X GET localhost:9440/healthz

You will get a following response if the service is running.

    {
      "status": "OK",
      "time": "2009-11-10T23:00:00Z"
    }

If service is not available, you will get the following response.

 {
  "status": "Service Unavailable",
  "time": "2009-11-10T23:00:00Z",
  "failed_checks": [
    {
      "component": "docker",
      "reason": "failed to connect to Docker daemon: invalid endpoint"
    }
  ]
}
0
On

The Operations Service might be what you are looking for, the simple check is for "Health" and the more complex check is to look the "metrics".

It is covered in the Fabric docs.