老师, 我全套的setup都放到本地里了, go, python, consul, 但是所有的注册都fail了吗, 用了本地的对外接口
# c = consul.Consul(host="192.168.1.103")
c = consul.Consul(host= "192.168.1.186") #本地的对外ip
# 基于consul的 就更少一点了
address = "192.168.1.186"
# address = "127.0.0.1"
port = 50051
check={
"GRPC":f"{address}:{port}",
"GRPCUseTLS": False,
"Timeout": "5s",
"Interval": "5s",
"DeregisterCriticalServiceAfter": "15s"
}
if __name__ == "__main__":
rsp = c.agent.service.register(name="user-srv", service_id="user-srv2",
address=address, port=port, tags=["mxshop"],check=check)
print(rsp)
但是所有的服务注册都fail了, 请问我一定要放到虚拟机里吗?