Can hyperledger-fabric get the peer node running status without entering the docker container? If so, how should I get it?
Asked
Active
Viewed 411 times
2 Answers
4
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"
}
]
}

PAVAN
- 771
- 4
- 14
-
Thanks. Later I read the official documentation and this problem has been solved. – xupter Dec 12 '19 at 01:13
1
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.

R Thatcher
- 5,550
- 1
- 7
- 15