deploymentcloud-foundry

Rolling restart of cloudfoundry application


I have cloudfoundry setup on mydev environment. We have an application 'Test' with 3 instances against it. When I do cf restart Test it restart all the 3 instances.

Is there a way by which I can restart 1 instance at a time. This will be highly useful for me when I need to update my service and don't want an outage in live environment.

Any help will be greatly appreciated


Solution

  • Answering your question:

    Is there a way by which I can restart 1 instance at a time.

    Yes, there is a way to restart just a single instance as documented here: http://cli.cloudfoundry.org/en-US/cf/restart-app-instance.html

    cf restart-app-instance APP_NAME INDEX

    In your case this would be:

    cf restart-app-instance Test 0
    cf restart-app-instance Test 1
    cf restart-app-instance Test 2