cloud-foundry - 应用程序必须映射到同一空间中的路线

标签 cloud-foundry

以下是 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.

下面是 list 文件:

applications:
- name: xyz-api
  instances: 1
  memory: 1G
  buildpack: java_buildpack_offline
  path: target/xyz-api-0.1-SNAPSHOT.jar

cf 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 端点不能使用相同的路由名称吗?为什么?

最佳答案

By default, cf push assigns a route to every app

我不知道省略路由的功能是什么,也许默认的/被分配给空间中的应用程序,该空间可能已经被另一个应用程序占用空间。

The Cloud Foundry Gorouter routes requests to apps by associating an app with an address, known as a route. We call this association a mapping. Use the cf CLI cf map-route command to associate an app and route.

您可以运行cf paths命令来查看正在使用哪些路由,

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:1234

https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#routes

您可能需要查看路由文档以获取有关路由含义的更详细说明。

https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html

关于cloud-foundry - 应用程序必须映射到同一空间中的路线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54580831/

相关文章:

python - Predix:没有名为 _tkinter 的模块

symfony - Symfony/PHP 数据库连接被拒绝

cloud-foundry - 云代工厂 : ERR Timed out after 1m0s: health check never passed

java - 如何在Cloud Foundry上获取java应用程序的threaddump?

java - Cloud Foundry 数据源oracle JDBC超时为什么?

python - 如何与 Cloud Foundry 上的 Celery 通信?

tomcat - 云类型转换厂 : Set Environment Variables via Manifest. yml

ssl - Bluemix 不提供正确的 ssl 证书

java - CloudFoundry 中部署的线程池代码不起作用

load-balancing - Cloud Foundry/Bluemix 负载平衡