Using vagrant on EC2

折月煮酒 提交于 2019-12-31 17:58:10

问题


I need to setup a web server and a database server on EC2. It should be easy to migrate to another service provider later.

Currently, I have a web server and a database server, each running on separate EC2 micro instances with software installed there remotely.

Can we run a vagrant box on these micro instances with pre-installed and pre-configured softwares like LAMP stack and use that instead. So I will end with 2 vagrant boxes , one for web server another for database server.

Amazon provides already means to copy an instance but it is copied to another EC2 instance only probably .. If there is need to move to some other provider, it will be same process of re-installing all. So, an own virtual box installed on Amazon's virtual box is what i was looking into..

I don't know how good or bad it is.. I doubt if this will affect performance as well. Please share your views. Target is to have env prepared locally and have flexibility to deploy it on any service provider easily.


回答1:


Running vagrant inside your AWS box is probably not the right solution. Have you looked into the Vagrant AWS provider?

That will allow you to setup and provision your AWS boxes with Vagrant and Puppet or Chef... if you are using Puppet or Chef to provision your servers then you will have a very portable "scripted" install for your servers that can easily be moved to another provider at a later date...




回答2:


So running a virtual machine, on another virtual machine probably isn't the best. But if you want to install Vagrant on Amazon Linux you can do:

wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.rpm   
sudo rpm -ivh vagrant_2.2.4_x86_64.rpm

The RPM is the Centos version from the downloads page here: https://www.vagrantup.com/downloads.html

But then you cannot install virtualbox to run a VM. So it doesn't actually work anyways.



来源:https://stackoverflow.com/questions/16870213/using-vagrant-on-ec2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!