[QUESTION] consul Health Checks exception
Before you submit this issue, you has been search all existed issues and search the documentation
- [Health Checks ] I've been search all existed issues
- [Health Checks ] I've been read all documentation
Describe your question
我自己写的服务注册到consul, 可以使用, 但是健康检查显示异常. 我需要怎么写健康检查呢
贴代码
服务的核心测试代码 `<?php /**
-
@RpcService(name="CalculatorService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="consul") */ class CalculatorService implements CalculatorServiceInterface {
public function sum(int $a, int $b): int { return $a + $b; } } `
服务注册的配置
<?php
return [
'consumers' => [
[
'name' => 'CalculatorService',
'service' => CalculatorServiceInterface::class,
'id' => CalculatorServiceInterface::class,
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
'protocol' => 'jsonrpc-http',
'load_balancer' => 'random',
'registry' => [
'protocol' => 'consul',
'address' => 'http://127.0.0.1:8500',
],
// 'nodes' => [
// ['host' => '127.0.0.1', 'port' => 9506],
// ],
'options' => [
'connect_timeout' => 10.0,
'recv_timeout' => 10.0,
'settings' => [
'open_eof_split' => true,
'package_eof' => "\r\n",
],
'pool' => [
'min_connections' => 1,
'max_connections' => 32,
'connect_timeout' => 10.0,
'wait_timeout' => 3.0,
'heartbeat' => -1,
'max_idle_time' => 60.0,
],
],
]
],
];
Consul健康检查截图看看呢?