|...

问题描述 投票:0回答:1
You should only run

once. Every time you run it, it will create a new service instance.

You want to cf service service-name || cf create-service service-name

or use

to bind your services to your app. If you put the service names to bind in
cloudfoundry pivotal-cloud-foundry
1个回答
0
投票

As to your command, it seems OK. cf create-service should return 1 if it doesn't find the service name you specified, which should trigger the second part of the command to create the service. At the same time,

will definitely fail if you try to create a service with a name that already exists. It'll say cf bind-service. Thus if you're seeing the service instance being recreated by running that command, something probably deleted it prior. Maybe review any deployment code you have and check if something is deleting that service instance accidentally. You generally manifest.ymldon'tmanifest.yml want to delete a service instance, unless you're really, really done with it. Normally, it's enough to just unbind a service.cf bind-service

我是CF的新手,我的应用里有多个服务,其中有一个特定的服务只能第一次创建(而不是每次都创建)。我的应用程序中有多个服务,其中有一个特定的服务只需要第一次创建(而不是每次都创建)。cf service我使用了下面的代码。cf create-service但是,当我部署应用程序的时候,每次都会创建服务。有什么更好的方法吗?The service instance name is taken: foo 我是CF新手。我的应用程序中有多个服务,其中有一个特定的服务只在第一次创建(而不是每次都创建)。我使用以下代码: cf service service-name

© www.soinside.com 2019 - 2024. All rights reserved.