下面是cf push上的错误
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.jarcf login x.y.z.w.org.cloud ....
cf push xyz-api -p 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端点吗?为什么?
发布于 2019-02-07 19:36:55
默认情况下,cf push为每个应用程序分配一条路由。
我不知道什么功能遗漏了一个route,可能是将一个默认的/分配给空间中的应用程序,而这个空间可能已经被另一个应用程序占用了。
通过将应用程序与一个名为路由的地址相关联,将请求发送到应用程序。我们称这种关联为映射。使用CLI cf map-route命令将应用程序与路由关联起来。
您可以运行cf routes命令来查看正在使用的路由,
https://cli.cloudfoundry.org/en-US/cf/routes.html
您可以在没有路由、随机路由或提供路由的情况下运行应用程序。
https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#no-route
---
...
no-route: true随机路线,
---
...
random-route: true确定的路线,
---
...
routes:
- route: example.com
- route: www.example.com/foo
- route: tcp-example.com:1234https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#routes
您可能需要查看路由文档,以获得更详细的路由说明。
https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html
https://stackoverflow.com/questions/54580831
复制相似问题