在ECS EC2中实现服务到服务的通信, 我已经创建了 ECS EC2 集群,并创建了 2 个服务并启用了服务连接: 如图所示
我尝试在 VPC 内使用 cmd 进行访问,但无法在缺少的地方获取输出..?
ubuntu@ip-10-0-1-211:~$ http://ms-kbt:3030
-bash: http://ms-kbt:3030: 没有这样的文件或目录
ubuntu@ip-10-0-1-211:~$curl http://ms-kbt:3030
curl:(6)无法解析主机:ms-kbt
我尝试使用路径访问,例如:http://>Service Connect serviceshttp://10.0.3.197:32772/xzy/health/
无法使用服务连接 url,但 sidecar 已启动并运行,并且服务也工作正常。
谢谢你。 ECS Servcies connect 已启用服务间通信请参阅此文档以启用 ECS 服务连接。
但是我有一些小疑问请澄清
我们可以用它吗
服务连接服务:- http://ms.kbt:80(在服务连接中创建的 DNS 名称)
这里无法在同一 VPC 中的命令提示符下 curl 我尝试没有得到任何回应
ubuntu@ip-10-0-1-211:~$curl http://ms.kbt/path/ 卷曲:(6)无法解析主机:ms.kbt
ubuntu@ip-10-0-1-211:~$curl -f http://ms.kbt/path/ 卷曲:(6)无法解析主机:ms.kbt
ubuntu@ip-10-0-1-211:~$curl -f http://ms.kbt:80/path/ 卷曲:(6)无法解析主机:ms.kbt
ubuntu@ip-10-0-1-211:~$curl -f http://ms.kbt.local:80/path/ 卷曲:(6)无法解析主机:ms.kbt.local
ubuntu@ip-10-0-1-211:~$curl -f http://demo.ms.kbt.local:80/path/ 卷曲:(6)无法解析主机:demo.ms.kbt.local