piroor
null+****@clear*****
Tue Sep 16 14:14:43 JST 2014
piroor 2014-09-16 14:14:43 +0900 (Tue, 16 Sep 2014) New Revision: fff6661535887267cd6a714b1eb3cea2d960b7e4 https://github.com/droonga/wikipedia-search/wiki/%E5%AE%9F%E9%A8%93%E7%92%B0%E5%A2%83%EF%BC%88%E4%BB%AE%E6%83%B3%E7%92%B0%E5%A2%83%EF%BC%89%E3%81%AE%E6%A7%8B%E7%AF%89/fff6661535887267cd6a714b1eb3cea2d960b7e4 Message: Updated 実験環境(仮想環境)の構築 (markdown) Modified files: 実験環境(仮想環境)の構築.md Modified: 実験環境(仮想環境)の構築.md (+67 -60) =================================================================== --- 実験環境(仮想環境)の構築.md 2014-08-17 09:41:45 +0900 (9899575) +++ 実験環境(仮想環境)の構築.md 2014-09-16 14:14:43 +0900 (21077ad) @@ -1,60 +1,67 @@ -vagrantでUbuntu 14.04ベースの実験環境を用意する。 - -仮想マシンのホストとなる環境のセットアップ - - % sudo gem install chef knife-solo - -Vagrant自体もインストールする(まだ入っていなければ)。 - - % wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_i686.deb #32bit - % wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb #64bit - % sudo dpkg -i vagrant_1.6.3_x86_64.deb - -実験環境としての仮想マシンのセットアップ(Ubuntu 14.04) - - % vagrant box add ubuntu14.04 http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box - % mkdir testserver - % cd testserver - % vagrant init ubuntu14.04 - -設定を書き換えて、ノードが3つ起動するようにする。 - - % vi Vagrantfile - % cat Vagrantfile - VAGRANTFILE_API_VERSION = "2" - - Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - 0.upto(2).each do |i| - config.vm.define :"node#{i}" do |node_config| - node_config.vm.box = "ubuntu14.04" - node_config.vm.network :private_network, ip: "192.168.100.#{50 + i}" - node_config.vm.host_name = "node#{i}" - end - end - end - -設定ができたか確認する。 - - % vagrant up - % vagrant ssh node0 - % exit - % vagrant ssh node1 - % exit - % vagrant ssh node2 - % exit - -Vagrantfileがあるディレクトリ以外からもsshできるようにするには、.ssh/configに設定を書き込んでおく。 - - % vagrant ssh-config node0 >> ~/.ssh/config - % vagrant ssh-config node1 >> ~/.ssh/config - % vagrant ssh-config node2 >> ~/.ssh/config - % ssh node0 - % exit - -一旦VMを終了して、メモリの割り当てを増やす。 - - % vagrant halt - -VirtualBoxの画面からVMの設定を開いて、メモリの割り当てを2GB以上にする。その後、VMを起動し直す。 - - % vagrant up +vagrantでUbuntu 14.04ベースの実験環境を用意する。 + +仮想マシンのホストとなる環境のセットアップ + + % sudo gem install chef knife-solo + +Vagrant自体もインストールする(まだ入っていなければ)。 + + % wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_i686.deb #32bit + % wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb #64bit + % sudo dpkg -i vagrant_1.6.3_x86_64.deb + +実験環境としての仮想マシンのセットアップ(Ubuntu 14.04) + + % vagrant box add ubuntu14.04 http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box + % mkdir testservers-ubuntu + % cd testservers-ubuntu + % vagrant init ubuntu14.04 + +CentOS 7の方は、こう。 + + % vagrant box add centos7 https://dl.dropboxusercontent.com/s/w3lbekm7eunrskm/centos-7.0-x86_64.box + % mkdir testservers-centos + % cd testservers-centos + % vagrant init centos7 + +設定を書き換えて、ノードが3つ起動するようにする。 + + % vi Vagrantfile + % cat Vagrantfile + VAGRANTFILE_API_VERSION = "2" + + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + 0.upto(2).each do |i| + config.vm.define :"node#{i}" do |node_config| + node_config.vm.box = "ubuntu14.04" + node_config.vm.network :private_network, ip: "192.168.100.#{50 + i}" + node_config.vm.host_name = "node#{i}" + end + end + end + +設定ができたか確認する。 + + % vagrant up + % vagrant ssh node0 + % exit + % vagrant ssh node1 + % exit + % vagrant ssh node2 + % exit + +Vagrantfileがあるディレクトリ以外からもsshできるようにするには、.ssh/configに設定を書き込んでおく。 + + % vagrant ssh-config node0 >> ~/.ssh/config + % vagrant ssh-config node1 >> ~/.ssh/config + % vagrant ssh-config node2 >> ~/.ssh/config + % ssh node0 + % exit + +一旦VMを終了して、メモリの割り当てを増やす。 + + % vagrant halt + +VirtualBoxの画面からVMの設定を開いて、メモリの割り当てを2GB以上にする。その後、VMを起動し直す。 + + % vagrant up -------------- next part -------------- HTML����������������������������...Download