Replacing a particular instance on AWS Elastic BeanStalk?

We are using Multiple Docker environment on Elastic BeanStalk with 2 instances running and we think there are some problem with one of the instances. What is the proper way to replace that particular instance?

I am thinking of one of the following:

  • Is it possible to add flags by default to Docker run
  • Need cq-quickstart-6.1.0-SNAPSHOT.jar file
  • Travis Multi-Architecture Buiilds
  • Class: Kitchen::ActionFailed - Test Kitchen + Docker + Remote API
  • Issue when trying to write to a mounted volume from inside a container as a non-root user
  • issues with docker-compose up
    1. Just terminate that instance via EC2 console and let Elastic BeanStalk spins up a new one.
    2. Increase the minimum instances in Elastic BeanStalk to 3 and decrease it back to 2 after the third instance is up and terminate the problematic instance.

    The goal is to minimize down time.

  • Batch install RPM packages from .tar.gz file on CentOS
  • Defaulting a variable to current window location if environment variable is not set
  • Scaling Rivescript chats
  • Docker 1.9.1 - ERROR 2005 (HY000): Unknown MySQL server host
  • Heroku load balancer vs Netflix zuul
  • Auto-restarting Docker container on Google Compute Engine
  • One Solution collect form web for “Replacing a particular instance on AWS Elastic BeanStalk?”

    If your goal is to minimize downtime then using the second option is recommended – i.e. increase the minimum number of instances to 3, wait for it to be healthy and then terminate the problematic instance.
    Before decreasing it back to 2, terminate the problematic instance. This is because automatic scaling will depend on EC2 health by default and even though your application will be unhealthy, your EC2 instance may be healthy. You might end up losing a healthy instance. So increase min size to 3, terminate the problematic instance and then scale back down to 2.

    Also if you are not already using it, I would recommend you to use the enhanced health reporting feature which was launched by Elastic Beanstalk in August 2015. Details on enhanced health reporting can be found here. With enhanced health reporting you can get detailed health of environment and each instance. You can get a health status, color, system metrics (CPU, memory), application latency, error rate, failure rate and a list of causes giving you detailed health descriptions of your environment and instance health. This can be additional information for you to determine if your newly launched instance is healthy or not. Read a quick intro to this feature here.

    If you plan to update your environment to enhanced health reporting keep in mind the instances in your environment will be replaced and hence if you are sensitive to downtime then it is better to scale up by 1 instance and then turn on rolling updates before switching your health system type to “enhanced”. Read more about rolling updates here.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.