Stop an Application Running on a Multi-Application Environment

If your application is running in a multi-application environment, it continues to run even after you detach the application from the environment and delete the application.

Follow this procedure to stop the application without bringing down the environment and stopping the other application(s) running on that environment.

To Stop an Application Running on a Multi-Application Environment:

  1. Log in to Engine Yard.
  2. Navigate to the relevant environment.
  3. Click “Detach app_name from this environment” at the bottom of the Environment page.

    This action only detaches the application from the environment. You still need to delete the application.

    Note: If applicable, you must delete the application from all environments and all environments that contain the application.

  4. Click the application name and then click the delete_button.png button.

  5. Click "Apply" on the environment where the application was removed.
  6. SSH into the application master instance.

  7. Type to delete nginx files and directories related to that application:

    rm -rf /etc/nginx/servers/myapp* 

    where myapp is the name of your application. The asterisk is necessary to remove files such as myapp.conf and myapp.ssl.conf. If your application uses keep files, remove them too.

  8. (Optional) Type to sanity check the remaining configuration:

    sudo /usr/sbin/nginx -t 
  9. Type to reload nginx configurations:

    sudo /etc/init.d/nginx reload 
  10. Stop the application workers:
    /engineyard/bin/<app_name> stop 
  11. (Optional) If the application is using Sidekiq, run monit stop <sidekiq_workers_name>:
    monit stop <sidekiq_workers_name>
  12. (Optional) If the application is using Resque, run monit stop <resque_workers_name>:
    monit stop <resque_workers_name>
  13. (Optional) If the application is using Delay Job, run monit stop <delay_job_workers_name>:
    monit stop <delay_job_workers_name>
  14. (Optional) If the application being removed is a Node app, also remove the "God" monitoring configuration:

    sudo god remove myapp && sudo rm -rf /etc/god/myapp
  15. (Optional) To completely remove the application data from the instance:

    sudo rm -rf /data/myapp
  16. If the application is running in a clustered environment, repeat Steps 3 to 6 for any application slave instances and utility instances.


Note: as an alternative to manually deleting the files, you can instead boot replacement application instance(s) using new volumes rather than snapshots, as these will only be configured with the remaining application(s).


More information

For more information about... See...
SSHing into an instance Connect to your Instance via SSH.
Configuring a multi-application environment Configure a Multi-Application Environment.

If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.


Article is closed for comments.