CoreOS中如何安裝Vagrant

這篇文章給大家分享的是有關(guān)CoreOS中如何安裝Vagrant的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。

創(chuàng)新互聯(lián)建站是一家專注于網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作與策劃設(shè)計(jì),興賓網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)建站做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:興賓等地區(qū)。興賓做網(wǎng)站價(jià)格咨詢:028-86922220

準(zhǔn)備環(huán)境(本人電腦win7 x64)

  • 1 安裝最新版Oracle VM VirtualBox 4.3.18

  • 2 安裝最新版vagrant 1.6.5

  • 3 安裝windows版git

##安裝CoreOS ###創(chuàng)建安裝目錄下載vagrant配置文件 比如我在E盤創(chuàng)建了一個(gè)coreos文件夾,然后在git shell界面進(jìn)入這個(gè)文件夾,執(zhí)行:

git clone https://github.com/coreos/coreos-vagrant.git   
cd coreos-vagrant

###修改git clone下來(lái)的配置文件 將config.rb.sample復(fù)制一份為config.rb
將user-data.sample復(fù)制一份為user-data
修改config.rb文件內(nèi)容:

$num_instances=3  #如果安裝單個(gè)coreos就寫1,如果是集群就寫大于1的數(shù)字
$update_channel='alpha' #這個(gè)是版本,可以改為stable或者beta

###安裝coreos 執(zhí)行:

cd coreos-vagrant
vagrant up

此時(shí)有報(bào)錯(cuò)信息如下:

E:\coreos\coreos-vagrant>vagrant up
Bringing machine 'core-01' up with 'virtualbox' provider...
Bringing machine 'core-02' up with 'virtualbox' provider...
Bringing machine 'core-03' up with 'virtualbox' provider...
==> core-01: Box 'coreos-alpha' could not be found. Attempting to find and insta ll...
core-01: Box Provider: virtualbox
core-01: Box Version: >= 308.0.1
You specified a box version constraint with a direct box file path. Box version constraints only work with boxes from Vagrant Cloud or a custom box host. Please remove the version constraint and try again.

查看Vagrantfile文件內(nèi)容匹配報(bào)錯(cuò)有如下行:

config.vm.box_version = ">= 308.0.1"

將這一行在Vagrantfile文件里面用#注釋掉,然后重新執(zhí)行vagrant up:

E:\coreos\coreos-vagrant>vagrant up
Bringing machine 'core-01' up with 'virtualbox' provider...
Bringing machine 'core-02' up with 'virtualbox' provider...
Bringing machine 'core-03' up with 'virtualbox' provider...
==> core-01: Box 'coreos-alpha' could not be found. Attempting to find and insta ll...
core-01: Box Provider: virtualbox
core-01: Box Version: >= 0
==> core-01: Loading metadata for box 'http://alpha.release.core-os.net/amd64-us r/current/coreos_production_vagrant.json'
core-01: URL: http://alpha.release.core-os.net/amd64-usr/current/coreos_prod uction_vagrant.json
==> core-01: Adding box 'coreos-alpha' (v493.0.0) for provider: virtualbox
core-01: Downloading: http://alpha.release.core-os.net/amd64-usr/493.0.0/cor eos_production_vagrant.box
此處省略N多字*********************
==> core-03: Machine booted and ready!
==> core-03: Setting hostname...
==> core-03: Configuring and enabling network interfaces...
==> core-03: Running provisioner: file...
==> core-03: Running provisioner: shell...
core-03: Running: inline script

安裝完成。

###配置連接 執(zhí)行vagrant ssh, 會(huì)自動(dòng)生成ssh的信息:

E:\coreos\coreos-vagrant>vagrant ssh core-01
ssh executable not found in any directories in the %PATH% variable. Is an SSH client installed? Try installing Cygwin, MinGW or Git, all of which contain an SSH client. Or use your favorite SSH client with the following authentication information shown below:
Host: 127.0.0.1
Port: 2222
Username: core
Private key: C:/Users/Administrator/.vagrant.d/insecure_private_key

使用xshell或者secureCRT配置私鑰遠(yuǎn)程連接

Xshell 4 (Build 0131)
Copyright (c) 2002-2014 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
Xshell:>

Connecting to 192.168.83.131:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Last login: Wed Nov 12 13:16:55 2014 from 192.168.83.1
CoreOS (alpha)
core@localhost ~ $ cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=494.0.0
VERSION_ID=494.0.0
BUILD_ID=
PRETTY_NAME="CoreOS 494.0.0"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

查看docker版本

core@localhost ~ $ docker version  
Client version: 1.3.0  
Client API version: 1.15  
Go version (client): go1.3.2  
Git commit (client): c78088f  
OS/Arch (client): linux/amd64  
Server version: 1.3.0  
Server API version: 1.15  
Go version (server): go1.3.2  
Git commit (server): c78088f

感謝各位的閱讀!關(guān)于“CoreOS中如何安裝Vagrant”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

文章名稱:CoreOS中如何安裝Vagrant
URL鏈接:http://bm7419.com/article42/igieec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、網(wǎng)站維護(hù)定制開發(fā)、Google、網(wǎng)站建設(shè)、服務(wù)器托管

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名