📜 ⬆️ ⬇️

AWS Hosting (EC2, EBS, S3) for Dummies

On Habré already periodically skipped notes on AWS (Amazon Web-Services) - so the topic is not new. However, if for me personally (and for many of my friends, as it turned out) - this term was familiar - but I did not know any details. I will try to tell you a little more on the basis of the experience I have just gained, and also outline the main steps for hosting a server on AWS and its advantages. Like a few links that may be helpful.
image

Immediately I want to say a huge thank you to haber man Gomer who shared some basic information and links. In this case, it turned out to be important to understand precisely - from which side to dig - to get the first kick, so to speak.

So, the moment of repair in the apartment has come, and hosting my EmForge on a home server (by the way, based on the Atom processor - but this is a separate story) - became impossible. I went to this for a long time (keeping the server at home was not the best idea). Where to go? Dedicated server is expensive, VPS - given that my server on J2EE required memory - it also turned out not cheap (at least it was necessary to 512 Mb) - plus a number of other problems. And so I decided (I was going for a long time) that it was AWS time
The first look at the website made it clear what I already heard. Yes, a set of web services, yes, it allows you to run an image of operating systems, yes, you can store data. But how? So, in order.

In principle, if we talk about AWS, then this is a constructor. With which you can do a lot of things - the main thing is to be able to do. And yet, hosting a server using AWS can be compared to building a computer (compared to buying a ready one, ordering hosting from a provider):

')
I will not consider here the organization of cluster systems, High Aviability systems and so on - I just had to pick up my server - ubuntu, tomcat, postgresql + actually my application. What had to be done (if this is not very interesting - you can immediately go to the end - where the pros and cons are described):
  1. Sign up for AWS, get the keys, put EC2-Tools. Under ubuntu there is a good starters guide . This will allow you to work with Amazon services.
  2. Select the most appropriate image (in aws they are called AMI) from which you will start building your system. The list of available AMIs can be viewed here , in the console (a very useful tool). For ubuntu there are both official AMIs (listed on the same starter guide) and “advanced” (by the way - Eric is the author of these AMIs - ships for all advanced people - very I recommend reading his blog - you can find answers to many questions). In my case, I chose “advanced” 9.04
  3. run the selected AMI (see ec2-run-instances) - at startup, you can specify which motherboard to run (how much memory, percent) and where to run (states, europe)
  4. By default, all ports on the machine will be closed - you need to open 22 (for ssh) with ec2-authorize default -p 22 and in the future do not forget to open other necessary ports (for example, 80)
  5. log in to the running system via ssh, install and configure the necessary software (later we will make our AMI with everything we need)
  6. Most likely, you will have a base and some other data that you need to store on “Vinca” - therefore, you need to make an EBS volume and connect it to your instance machine. A good description of how to do this (well, in principle, an article that turned out to be the most useful for me) is here - just pay attention to the comments about the use of Ext3 & XFS file systems from the same Eric
  7. after you connect volume to your system - you need to change the settings of the database and other services so that the necessary data is stored on it - that is, the data lay on the EBS Volume - and not inside the instance - remember - an instance can die - and with it and the data will die - and EBS will remain
  8. in the script we got the system we need it - now we need to “fix” this state (so as not to repeat the installation and configuration of the software every time a new instance is started). the same article describes how to make an image for a running instance, put it on S3 and register your AMI
  9. Ok, you have your own AMI - now, if that - you can quickly raise the server with all the necessary software
  10. there was a trifle - to take Elastic IP (fixed IP), change the DNS to use the new IP, migrate the data to the database. The server is ready!


Minuses




pros




I hope this information will allow you to make the right choice and, if anything, save time and money

UPD Just finished the post - as Habr suggested a similar one - as I hadn’t noticed it before - maybe “rice” confused?

UPD2 moved to hosting

Source: https://habr.com/ru/post/62362/


All Articles