简体   繁体   中英

Amazon AWS how to configure servers to scale?

I'm fairly new to amazon, not to Linux, routing, web serving/hosting. So please be patient with me and my novice AWS questions.

The company I work for has a team building an application that they don't want hosted internally and are pushing to AWS. I have played with and configured a couple hosting servers in AWS but not to this complexity. I understand VPC and EC2 and have working knowledge of S3.

I have searched through the web, but no where does it detail how the scaling part works, and I'm not talking about automated scaling. I'm interested to know how the actual server configuration works.

For instance, we have a jar file and properties files that need to be deployed to a server in order to have a running site. The questions is, where do I place these files, so that if I wanted to scale to another bigger or smaller resource instance, it would use those same files? My research seems to be pointing to "EBS" and S3 for this setup, but I'm not to clear on how... I guess the question is, how do I configure instances to read site files?

My question is presuming that at any given point I have one instance running and reading the site files, and if I wanted to use a bigger instance or a smaller instance I would shutdown the current instance and boot up a new instance, of course, while always reading from the same site files..

My scenario may not be the correct way to create a scalable architecture, so if you have a better suggestion, than I'm all ears. This is how I've understood the scalable aspect of AWS works. And keeping in mind I'm using the scaling up or down approach and not the scaling out, which scaling out suggests having more than one instance running in order to balance computation between instances and increasing the cost by instances running..

Clarity would be greatly appreciated!

AWS OpsWorks will allow you to use Chef recipes (written with Ruby) to deploy code and resources to your servers as your needs change.

  • Create a "Stack"
  • Configure Applications within your "Stack"
  • Put Instances in your Application (EC2s)
  • Deploy

An alternative, would be to use ECS (Elastic Container Service) with Docker to put your jar files into appropriately sized containers.

  • Create a Cluster
  • Add Task Definitions
  • Configure Auto Scaling Group (instance type, desired size, etc)
  • Launch

Both of these options can be configured with an Auto Scaling Group (in EC2) to quickly adjust the amount of resources based on need and deploy your code in a consistent and automated way.

That's the gist of it, anything beyond this would be a full blown tutorial which will be based heavily on your architecture. I'd recommend reading some guides, hitting up the documentation and giving it a try.

For Bonus Points, check out CloudFormation , which will allow you to configure your AWS resources/provisions in code, so you don't need to fiddle with the UI to make adjustments or to (re)deploy.

As long as you choose EBS drives for your server then you can stop the server, change the size, and restart it without losing any data on the drive. This will allow you to add more CPU/RAM to your single server.

If you want a more scalable architecture you should design your system to work well on multiple servers behind a load balancer. Then you can use Autoscaling Groups or Elastic Beanstalk to automatically add and remove servers to the pool based on current system load.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM