LoginSignup
2
4

More than 5 years have passed since last update.

Vagrantを使ってCentOS6.5の仮想マシンを2台立てる

Last updated at Posted at 2016-05-10

環境

  • Mac OS X Yosemite 10.10.2

手順

  • boxファイルをダウンロードしVagrantファイルを作成
$ vagrant add box CentOS65 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
$ vagrant init CentOS65
  • Vagrantfileを下記のように編集
Vagrant.configure(2) do |config|
  config.ssh.insert_key = false
  config.vm.box = "CentOS65"

  config.vm.define "web" do |node|
    node.vm.network "private_network", ip: "192.168.10.10"
    node.vm.hostname = "host1"
  end

  config.vm.define "db" do |node|
    node.vm.network "private_network", ip: "192.168.10.20"
    node.vm.hostname = "host2"
  end
end
  • 仮想マシンの立ち上げ
$ vagrant up [host1/host2]
# 仮想マシン名を指定することで、そのマシンだけ起動できます。
# 指定しなければ全てが起動されます。
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4