Cloud foundry 应用程序必须映射到同一空间中的路由
下面是推送时出现的错误:Cloud foundry 应用程序必须映射到同一空间中的路由,cloud-foundry,Cloud Foundry,下面是推送时出现的错误: org.cloudfoundry.client.v2.ClientV2Exception: CF-InvalidRelation(1002): The app cannot be mapped to this route because the route is not in this space. Apps must be mapped to routes in the same space. 下面是清单文件: applications: - name: xyz-
org.cloudfoundry.client.v2.ClientV2Exception: CF-InvalidRelation(1002): The app cannot be mapped to this route because the route is not in this space. Apps must be mapped to routes in the same space.
下面是清单文件:
applications:
- name: xyz-api
instances: 1
memory: 1G
buildpack: java_buildpack_offline
path: target/xyz-api-0.1-SNAPSHOT.jar
我们有两个API端点:
a.b.c.d.org.cloud
x.y.z.w.org.cloud
根据调查,我们意识到路径名称已经存在于a.b.c.d.org.cloud
上,因为我们的源代码正在对任何API端点上的相同路径名称进行硬编码
不能对多个API端点使用相同的路由名称吗?为什么?
默认情况下,cf push为每个应用程序分配一条路由
我不知道该功能忽略了路由
,可能为空间中的应用程序分配了默认的/
,空间中的另一个应用程序可能已经使用了该应用程序
云计算通过将应用程序与地址(称为路由)关联,将请求路由到应用程序。我们称这种关联为映射。使用cf CLI cf map route命令将应用程序和路由关联起来
您可以运行cf routes
命令查看正在使用的路由
您可以在不使用路由、随机路由或提供路由的情况下运行应用程序
随机路径
---
...
random-route: true
确定的路线
---
...
routes:
- route: example.com
- route: www.example.com/foo
- route: tcp-example.com:1234
您可能需要查看routes文档,以获得关于route是什么的更详细解释
@overexchange>路由在全球范围内是唯一的。一个空间中的开发人员无法使用与另一个空间中的开发人员相同的URL创建路由,无论哪个组织控制这些空间。
---
...
random-route: true
---
...
routes:
- route: example.com
- route: www.example.com/foo
- route: tcp-example.com:1234