辛星浅析vagrant的使用
2015-09-21 18:25
162 查看
可能每一个项目都会随着项目参与人数的增加而变得管理困难,没错,不论是在进度管理、任务划分,甚至是连简单的环境搭建,都有可能会出问题。可能一个问题在某个环境下跑的好好地,但是在另一个环境下却问题百出,踩了很多的坑,也因此付出了相当惨痛的代价。
为了方便环境的统一管理,因此两个优秀的产品就出现了,它们分别是vagrant和docker,对于docker我们以后再介绍,这里首先说一下vagrant。
准备工作:
(1)virtualbox 的下载
地址:https://www.virtualbox.org/
(2)vagrant的下载
地址:http://www.vagrantup.com/
(3)然后我们需要统一分配的环境就是若干以.box为后缀的文件啦,这里我们使用的是vanthink_dev.box
开始安装:
(1)首先我们在对应目录下使用vagrant init来初始化一下,如果不是base的话,我们需要指定名称,我们这里不妨设置为van,我们安装过程如下:
(2)然后我们使用vagrant box add box目录 来把对应的box添加到这个虚拟机中,过程如下:
至此,我们的vagrant就安装完毕啦。
为了方便环境的统一管理,因此两个优秀的产品就出现了,它们分别是vagrant和docker,对于docker我们以后再介绍,这里首先说一下vagrant。
准备工作:
(1)virtualbox 的下载
地址:https://www.virtualbox.org/
(2)vagrant的下载
地址:http://www.vagrantup.com/
(3)然后我们需要统一分配的环境就是若干以.box为后缀的文件啦,这里我们使用的是vanthink_dev.box
开始安装:
(1)首先我们在对应目录下使用vagrant init来初始化一下,如果不是base的话,我们需要指定名称,我们这里不妨设置为van,我们安装过程如下:
C:\wamp\www\xinguimeng>vagrant init van A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.
(2)然后我们使用vagrant box add box目录 来把对应的box添加到这个虚拟机中,过程如下:
C:\wamp\www\xinguimeng>vagrant box add van vanthink_dev.box ==> box: Box file was not detected as metadata. Adding it directly... ==> box: Adding box 'van' (v0) for provider: box: Unpacking necessary files from: file://C:/wamp/www/xinguimeng/vanthink_dev.box box: Progress: 100% (Rate: 19.5M/s, Estimated time remaining: --:--:--) ==> box: Successfully added box 'van' (v0) for 'virtualbox'!(3)然后我们使用vagrant up来启动此虚拟机,过程如下:
C:\wamp\www\xinguimeng>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'van'... ==> default: Matching MAC address for NAT networking... ==> default: Setting the name of the VM: xinguimeng_default_1442824653365_7382 ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 => 2222 (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.1.22 default: VirtualBox Version: 5.0 ==> default: Mounting shared folders... default: /vagrant => C:/wamp/www/xinguimeng
至此,我们的vagrant就安装完毕啦。
相关文章推荐
- maven 整理
- 第四周-项目5-自建算法库(循环双链表)
- hihocoder 1233 Boxes
- android 自定义dialog的实现(自定义大小、去除黑色边框等)
- HDU 4612 Warm up(边双连通分量+树的直径)
- 卓有成效的敏捷开发流程
- sql处理技巧之--按指定时间粒度汇总数据
- jemalloc for mysql
- AUF(Always Use Fragments)-activity 使用 fragment
- MYSQL的常用函数
- 成功搭建CXFWebService服务端(集成spring)
- linux环境下Catalina.out 乱码问题
- windows+vmware+centos7+hadoop2.7搭建伪分布式集群
- Objc编程2-类的抽象和构成
- C++中一些有用库函数
- 如何让CentOS服务器磁盘io性能翻倍
- [Hadoop] - TaskTracker源码分析(TaskTracker节点健康状况监控)
- 第三周实践项目2--建设“顺序表”算法库
- PHP几个函数pathinfo()、dirname()、basename()
- C语言判断“1000年—2000年”之间的闰年