Reputation: 646
I have an ubuntu
server (ami-714ba518)
which has a webserver on it (Apache
and PHP
). It is connected to a MySQL
server on RDS
. I want to setup auto scaling when load goes above 60-70% , but I'm having trouble getting my head around how it works.
My concern is that, when a change is made to a file in server, how does that change reflect on the other instances that auto scaling has started?
Regards!
Upvotes: 0
Views: 90
Reputation: 2376
Scaling http servers assumes that they are stateless, meaning that the state of them is dedicated to persistence layer - database, and not to servers themselves. If one of your instances writes something on its disk, this data won't be available to autoscaled new instances. Changes like this do not replicate by autoscaling feature. You can achieve that with shared file system via EFS, though, but it won't be replication. It'll be a shared resource.
P.S. Automatic EFS volumes attachment described here: https://docs.aws.amazon.com/efs/latest/ug/mount-fs-auto-mount-onreboot.html
Upvotes: 2
Reputation: 4506
The Autoscaling
doesn't replicate the changes from your host server. If you already done the changes in your site, then may be you can create Custom AMI
from your existing EC2
instance, and then use the same for launching new instances using autoscaling.
You need to use some common back-end service which will serve your changes to all of your web servers (existing or newly launched).
Upvotes: 1