[Groonga-commit] droonga/droonga.org at 312dbb6 [gh-pages] Add a new tutorial to prepare virtual machines for experiments

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Sep 26 18:20:20 JST 2014


YUKI Hiroshi	2014-09-26 18:20:20 +0900 (Fri, 26 Sep 2014)

  New Revision: 312dbb654fd76bf29d1d22a0846561b213fd9806
  https://github.com/droonga/droonga.org/commit/312dbb654fd76bf29d1d22a0846561b213fd9806

  Message:
    Add a new tutorial to prepare virtual machines for experiments

  Added files:
    _po/ja/tutorial/1.0.6/virtual-machines-for-experiments/index.po
    tutorial/1.0.6/virtual-machines-for-experiments/index.md
    tutorial/virtual-machines-for-experiments/index.html
  Modified files:
    _po/ja/tutorial/1.0.6/index.po
    ja/tutorial/1.0.6/index.md
    tutorial/1.0.6/index.md

  Modified: _po/ja/tutorial/1.0.6/index.po (+4 -1)
===================================================================
--- _po/ja/tutorial/1.0.6/index.po    2014-09-26 14:54:33 +0900 (90447a1)
+++ _po/ja/tutorial/1.0.6/index.po    2014-09-26 18:20:20 +0900 (2730b42)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2014-03-05 12:52+0900\n"
+"PO-Revision-Date: 2014-09-26 18:15+0900\n"
 "Language: ja\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -24,10 +24,13 @@ msgstr "## 初心者とGroonga利用者向け"
 
 msgid ""
 " * [Getting started/How to migrate from Groonga?](groonga/)\n"
+"   * [How to prepare virtual machines for experiments?](virtual-machines-for-e"
+"xperiments/)\n"
 " * [How to backup and restore the database?](dump-restore/)\n"
 " * [How to add a new replica to an existing cluster?](add-replica/)"
 msgstr ""
 " * [使ってみる/Groongaからの移行手順](groonga/)\n"
+"   * [実験用の仮想マシンを用意する手順](virtual-machines-for-experiments/)\n"
 " * [データベースのバックアップと復元](dump-restore/)\n"
 " * [既存クラスタへのreplicaの追加](add-replica/)"
 

  Added: _po/ja/tutorial/1.0.6/virtual-machines-for-experiments/index.po (+324 -0) 100644
===================================================================
--- /dev/null
+++ _po/ja/tutorial/1.0.6/virtual-machines-for-experiments/index.po    2014-09-26 18:20:20 +0900 (a93261b)
@@ -0,0 +1,324 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2014-09-26 18:15+0900\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgid ""
+"---\n"
+"title: \"Droonga tutorial: How to prepare virtual machines for experiments?\"\n"
+"layout: en\n"
+"---"
+msgstr ""
+"---\n"
+"title: \"Droongaチュートリアル: 実験用の仮想マシンを用意する手順\"\n"
+"layout: ja\n"
+"---"
+
+msgid ""
+"* TOC\n"
+"{:toc}"
+msgstr ""
+
+msgid "## The goal of this tutorial"
+msgstr ""
+
+msgid "Learning steps to prepare multiple (three) virtual machines for experiments."
+msgstr ""
+
+msgid "## Why virtual machines?"
+msgstr ""
+
+msgid ""
+"Because Droonga is a distributed data processing system, you have to prepare m"
+"ultiple computers to construct a cluster.\n"
+"For safety (and good performance) you should use dedicated computers for Droon"
+"ga nodes."
+msgstr ""
+
+msgid ""
+"You need two or more computers for effective replication.\n"
+"If you are trying to manage node structure of your cluster effectively, three "
+"or more computers are required."
+msgstr ""
+
+msgid ""
+"However, it may cost money that using multiple server instances on virtual pri"
+"vate server services, even if you just want to do testing or development.\n"
+"So we recommend you to use private virtual machines on your own PC for such ca"
+"ses."
+msgstr ""
+
+msgid ""
+"Luckly, there is a useful software [Vagrant][] to manage virtual machines easi"
+"ly.\n"
+"This tutorial describes *how to prepare three virtual machines* by Vagrant."
+msgstr ""
+
+msgid "## Prepare a host machine"
+msgstr ""
+
+msgid ""
+"First, you have to prepare a PC as the host of VMs.\n"
+"Because each VM requires much RAM, the host machine should have much more RAM "
+"- hopefully, 8GB or larger."
+msgstr ""
+
+msgid ""
+"(However, 3GB RAM may be enough to do experiments.\n"
+"When you install components of the Droonga system, the machine must have 2GB R"
+"AM at minimum, to build native extensions of [Rroonga][].\n"
+"After that, Droonga nodes can work with less RAM, for example 512MB.)"
+msgstr ""
+
+msgid "## Steps to prepare VMs"
+msgstr ""
+
+msgid "### Install the VirtualBox"
+msgstr ""
+
+msgid ""
+"The Vagrant requires a backend to run VMs, so you have to install the most rec"
+"ommended one: [VirtualBox][].\n"
+"For example, if you use an [Ubuntu][] PC, it can be installed via the `apt` co"
+"mmand, like:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ sudo apt-get install virtualbox\n"
+"~~~"
+msgstr ""
+
+msgid "### Install the Vagrant"
+msgstr ""
+
+msgid ""
+"Go to the [Vagrant web site][Vagrant] and install it as instructed.\n"
+"For example, if you use an Ubuntu PC (x64):"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ sudo apt-get install virtualbox\n"
+"$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb\n"
+"$ sudo dpkg -i vagrant_1.6.5_x86_64.deb\n"
+"~~~"
+msgstr ""
+
+msgid "### Determine a box and prepare a Vagrantfile"
+msgstr ""
+
+msgid ""
+"Go to the [Vagrant Cloud][] and find a box for your experiments.\n"
+"For example, if you use a [box for Ubuntu Trusty (x64)](https://vagrantcloud.c"
+"om/ubuntu/boxes/trusty64), you just have to do:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ mkdir droonga-ubuntu-trusty\n"
+"$ cd droonga-ubuntu-trusty\n"
+"$ vagrant init ubuntu/trusty64\n"
+"~~~"
+msgstr ""
+
+msgid ""
+"Then a file `Vagrantfile` is automatically generated there.\n"
+"However you should rewrite it completely for experiments of Droonga cluster, l"
+"ike following:"
+msgstr ""
+
+msgid "`Vagrantfile`:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"n_machines = 3\n"
+"box        = \"ubuntu/trusty64\""
+msgstr ""
+
+msgid ""
+"VAGRANTFILE_API_VERSION = \"2\"\n"
+"Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|\n"
+"  n_machines.times do |index|\n"
+"    config.vm.define :\"node#{index}\" do |node_config|\n"
+"      node_config.vm.box = box\n"
+"      node_config.vm.network(:private_network,\n"
+"                             :ip => \"192.168.100.#{50 + index}\")\n"
+"      node_config.vm.host_name = \"node#{index}\"\n"
+"      node_config.vm.provider(\"virtualbox\") do |virtual_box|\n"
+"        virtual_box.memory = 2048\n"
+"      end\n"
+"    end\n"
+"  end\n"
+"end\n"
+"~~~"
+msgstr ""
+
+msgid ""
+"Note, this `Vagrantfile` defines three VMs with 2GB (2048MB) RAM for each.\n"
+"So your host machine must have 6GB or more RAM.\n"
+"If your machine has less RAM, set the size to `512` (meaning 512MB) for now."
+msgstr ""
+
+msgid "### Start virtual machines"
+msgstr ""
+
+msgid "To start VMs, you just run the command `vagrant up`:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ vagrant up\n"
+"Bringing machine 'node0' up with 'virtualbox' provider...\n"
+"Bringing machine 'node1' up with 'virtualbox' provider...\n"
+"Bringing machine 'node2' up with 'virtualbox' provider...\n"
+"...\n"
+"~~~"
+msgstr ""
+
+msgid ""
+"Then Vagrant automatically downloads VM image from the [Vagrant Cloud][] web s"
+"ite and starts VMs.\n"
+"After preparation processes, there are three running VMs with IP address in a "
+"virtual private network: `192.168.100.50`, `192.168.100.51`, and `192.168.100."
+"52`."
+msgstr ""
+
+msgid ""
+"Let's confirm that they are correctly working.\n"
+"You can log in those VMs by the command `vagrant ssh`, like:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ vagrant ssh node0\n"
+"Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-36-generic x86_64)\n"
+"...\n"
+"vagrant �� node0:~$ exit\n"
+"~~~"
+msgstr ""
+
+msgid "### Register your VMs to your SSH client"
+msgstr ""
+
+msgid ""
+"You have to use `vagrant ssh` instead of regular `ssh`, to log in VMs.\n"
+"Moreover you have to `cd` before running the command.\n"
+"It is annoying a little."
+msgstr ""
+
+msgid "So, let's register VMs to your local config file of the SSH client, like:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ vagrant ssh-config node0 >> ~/.ssh/config\n"
+"$ vagrant ssh-config node1 >> ~/.ssh/config\n"
+"$ vagrant ssh-config node2 >> ~/.ssh/config\n"
+"~~~"
+msgstr ""
+
+msgid ""
+"After that you can log in to your VMs from the host computer by their name, wi"
+"thout `vagrant ssh` command:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ ssh node0\n"
+"~~~"
+msgstr ""
+
+msgid "### Configure your MVs to access each other by their host name"
+msgstr ""
+
+msgid ""
+"Because there is no name server, each VM cannot resolve host names of others.\n"
+"So you have to type their raw IP addresses for now.\n"
+"It's very annoying."
+msgstr ""
+
+msgid "So, let's modify hosts file on VMs, like:"
+msgstr ""
+
+msgid "`/etc/hosts`:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"127.0.0.1 localhost\n"
+"192.168.100.50 node0\n"
+"192.168.100.51 node1\n"
+"192.168.100.52 node2\n"
+"~~~"
+msgstr ""
+
+msgid "After that your VMs can communicate with each other by their host name."
+msgstr ""
+
+msgid "### Shutdown VMs"
+msgstr ""
+
+msgid "You can shutdown all VMs by the command `vagrant halt`:"
+msgstr ""
+
+msgid ""
+"~~~\n"
+"$ vagrant halt\n"
+"~~~"
+msgstr ""
+
+msgid "Then Vagrant shuts down all VMs completely."
+msgstr ""
+
+msgid "### Appendix: if your host machine has less size RAM..."
+msgstr ""
+
+msgid ""
+"If your host machine has less RAM (for example smaller than 3GB), you cannot r"
+"un all VMs with 2GB RAM.\n"
+"However, if you configure VMs with small size RAM (ex. 512MB), you cannot inst"
+"all Droonga services."
+msgstr ""
+
+msgid "Then you can install Droonga services for each VM step by step, like:"
+msgstr ""
+
+msgid ""
+" 1. Shutdown all VMs by `vagrant halt`.\n"
+" 2. Open the VirtualBox console by `virtualbox`.\n"
+" 3. Go to `properties` of a VM, and enlarge the size of RAM to 2GB (2048MB).\n"
+" 4. Start the VM, from the VirtualBox console.\n"
+" 5. Log in to the VM and install Droonga services.\n"
+" 6. Shutdown the VM.\n"
+" 7. Go to `properties` of the VM, and decrease the size of RAM to the original"
+" size.\n"
+" 8. Repeat steps from 3 to 7 for each VM."
+msgstr ""
+
+msgid "## Conclusion"
+msgstr ""
+
+msgid "In this tutorial, you did prepare three virtual machines for Droonga nodes."
+msgstr ""
+
+msgid ""
+"You can try [the \"getting started\" tutorial](../groonga/) and others with mult"
+"iple nodes."
+msgstr ""
+
+msgid ""
+"  [Vagrant]: https://www.vagrantup.com/\n"
+"  [Vagrant Cloud]: https://vagrantcloud.com/\n"
+"  [VirtualBox]: https://www.virtualbox.org/\n"
+"  [Rroonga]: https://github.com/ranguba/rroonga\n"
+"  [Ubuntu]: http://www.ubuntu.com/\n"
+"  [Droonga]: https://droonga.org/\n"
+"  [Groonga]: http://groonga.org/"
+msgstr ""

  Modified: ja/tutorial/1.0.6/index.md (+1 -0)
===================================================================
--- ja/tutorial/1.0.6/index.md    2014-09-26 14:54:33 +0900 (221b6cc)
+++ ja/tutorial/1.0.6/index.md    2014-09-26 18:20:20 +0900 (3d37610)
@@ -15,6 +15,7 @@ layout: ja
 ## 初心者とGroonga利用者向け
 
  * [使ってみる/Groongaからの移行手順](groonga/)
+   * [実験用の仮想マシンを用意する手順](virtual-machines-for-experiments/)
  * [データベースのバックアップと復元](dump-restore/)
  * [既存クラスタへのreplicaの追加](add-replica/)
 

  Modified: tutorial/1.0.6/index.md (+1 -0)
===================================================================
--- tutorial/1.0.6/index.md    2014-09-26 14:54:33 +0900 (689d32b)
+++ tutorial/1.0.6/index.md    2014-09-26 18:20:20 +0900 (f1bdbbf)
@@ -6,6 +6,7 @@ layout: en
 ## For beginners and Groonga users
 
  * [Getting started/How to migrate from Groonga?](groonga/)
+   * [How to prepare virtual machines for experiments?](virtual-machines-for-experiments/)
  * [How to backup and restore the database?](dump-restore/)
  * [How to add a new replica to an existing cluster?](add-replica/)
 

  Added: tutorial/1.0.6/virtual-machines-for-experiments/index.md (+201 -0) 100755
===================================================================
--- /dev/null
+++ tutorial/1.0.6/virtual-machines-for-experiments/index.md    2014-09-26 18:20:20 +0900 (25b480f)
@@ -0,0 +1,201 @@
+---
+title: "Droonga tutorial: How to prepare virtual machines for experiments?"
+layout: en
+---
+
+* TOC
+{:toc}
+
+## The goal of this tutorial
+
+Learning steps to prepare multiple (three) virtual machines for experiments.
+
+## Why virtual machines?
+
+Because Droonga is a distributed data processing system, you have to prepare multiple computers to construct a cluster.
+For safety (and good performance) you should use dedicated computers for Droonga nodes.
+
+You need two or more computers for effective replication.
+If you are trying to manage node structure of your cluster effectively, three or more computers are required.
+
+However, it may cost money that using multiple server instances on virtual private server services, even if you just want to do testing or development.
+So we recommend you to use private virtual machines on your own PC for such cases.
+
+Luckly, there is a useful software [Vagrant][] to manage virtual machines easily.
+This tutorial describes *how to prepare three virtual machines* by Vagrant.
+
+## Prepare a host machine
+
+First, you have to prepare a PC as the host of VMs.
+Because each VM requires much RAM, the host machine should have much more RAM - hopefully, 8GB or larger.
+
+(However, 3GB RAM may be enough to do experiments.
+When you install components of the Droonga system, the machine must have 2GB RAM at minimum, to build native extensions of [Rroonga][].
+After that, Droonga nodes can work with less RAM, for example 512MB.)
+
+## Steps to prepare VMs
+
+### Install the VirtualBox
+
+The Vagrant requires a backend to run VMs, so you have to install the most recommended one: [VirtualBox][].
+For example, if you use an [Ubuntu][] PC, it can be installed via the `apt` command, like:
+
+~~~
+$ sudo apt-get install virtualbox
+~~~
+
+### Install the Vagrant
+
+Go to the [Vagrant web site][Vagrant] and install it as instructed.
+For example, if you use an Ubuntu PC (x64):
+
+~~~
+$ sudo apt-get install virtualbox
+$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
+$ sudo dpkg -i vagrant_1.6.5_x86_64.deb
+~~~
+
+### Determine a box and prepare a Vagrantfile
+
+Go to the [Vagrant Cloud][] and find a box for your experiments.
+For example, if you use a [box for Ubuntu Trusty (x64)](https://vagrantcloud.com/ubuntu/boxes/trusty64), you just have to do:
+
+~~~
+$ mkdir droonga-ubuntu-trusty
+$ cd droonga-ubuntu-trusty
+$ vagrant init ubuntu/trusty64
+~~~
+
+Then a file `Vagrantfile` is automatically generated there.
+However you should rewrite it completely for experiments of Droonga cluster, like following:
+
+`Vagrantfile`:
+
+~~~
+n_machines = 3
+box        = "ubuntu/trusty64"
+
+VAGRANTFILE_API_VERSION = "2"
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  n_machines.times do |index|
+    config.vm.define :"node#{index}" do |node_config|
+      node_config.vm.box = box
+      node_config.vm.network(:private_network,
+                             :ip => "192.168.100.#{50 + index}")
+      node_config.vm.host_name = "node#{index}"
+      node_config.vm.provider("virtualbox") do |virtual_box|
+        virtual_box.memory = 2048
+      end
+    end
+  end
+end
+~~~
+
+Note, this `Vagrantfile` defines three VMs with 2GB (2048MB) RAM for each.
+So your host machine must have 6GB or more RAM.
+If your machine has less RAM, set the size to `512` (meaning 512MB) for now.
+
+### Start virtual machines
+
+To start VMs, you just run the command `vagrant up`:
+
+~~~
+$ vagrant up
+Bringing machine 'node0' up with 'virtualbox' provider...
+Bringing machine 'node1' up with 'virtualbox' provider...
+Bringing machine 'node2' up with 'virtualbox' provider...
+...
+~~~
+
+Then Vagrant automatically downloads VM image from the [Vagrant Cloud][] web site and starts VMs.
+After preparation processes, there are three running VMs with IP address in a virtual private network: `192.168.100.50`, `192.168.100.51`, and `192.168.100.52`.
+
+Let's confirm that they are correctly working.
+You can log in those VMs by the command `vagrant ssh`, like:
+
+~~~
+$ vagrant ssh node0
+Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-36-generic x86_64)
+...
+vagrant �� node0:~$ exit
+~~~
+
+
+### Register your VMs to your SSH client
+
+You have to use `vagrant ssh` instead of regular `ssh`, to log in VMs.
+Moreover you have to `cd` before running the command.
+It is annoying a little.
+
+So, let's register VMs to your local config file of the SSH client, like:
+
+~~~
+$ vagrant ssh-config node0 >> ~/.ssh/config
+$ vagrant ssh-config node1 >> ~/.ssh/config
+$ vagrant ssh-config node2 >> ~/.ssh/config
+~~~
+
+After that you can log in to your VMs from the host computer by their name, without `vagrant ssh` command:
+
+~~~
+$ ssh node0
+~~~
+
+### Configure your MVs to access each other by their host name
+
+Because there is no name server, each VM cannot resolve host names of others.
+So you have to type their raw IP addresses for now.
+It's very annoying.
+
+So, let's modify hosts file on VMs, like:
+
+`/etc/hosts`:
+
+~~~
+127.0.0.1 localhost
+192.168.100.50 node0
+192.168.100.51 node1
+192.168.100.52 node2
+~~~
+
+After that your VMs can communicate with each other by their host name.
+
+### Shutdown VMs
+
+You can shutdown all VMs by the command `vagrant halt`:
+
+~~~
+$ vagrant halt
+~~~
+
+Then Vagrant shuts down all VMs completely.
+
+### Appendix: if your host machine has less size RAM...
+
+If your host machine has less RAM (for example smaller than 3GB), you cannot run all VMs with 2GB RAM.
+However, if you configure VMs with small size RAM (ex. 512MB), you cannot install Droonga services.
+
+Then you can install Droonga services for each VM step by step, like:
+
+ 1. Shutdown all VMs by `vagrant halt`.
+ 2. Open the VirtualBox console by `virtualbox`.
+ 3. Go to `properties` of a VM, and enlarge the size of RAM to 2GB (2048MB).
+ 4. Start the VM, from the VirtualBox console.
+ 5. Log in to the VM and install Droonga services.
+ 6. Shutdown the VM.
+ 7. Go to `properties` of the VM, and decrease the size of RAM to the original size.
+ 8. Repeat steps from 3 to 7 for each VM.
+
+## Conclusion
+
+In this tutorial, you did prepare three virtual machines for Droonga nodes.
+
+You can try [the "getting started" tutorial](../groonga/) and others with multiple nodes.
+
+  [Vagrant]: https://www.vagrantup.com/
+  [Vagrant Cloud]: https://vagrantcloud.com/
+  [VirtualBox]: https://www.virtualbox.org/
+  [Rroonga]: https://github.com/ranguba/rroonga
+  [Ubuntu]: http://www.ubuntu.com/
+  [Droonga]: https://droonga.org/
+  [Groonga]: http://groonga.org/

  Added: tutorial/virtual-machines-for-experiments/index.html (+4 -0) 100644
===================================================================
--- /dev/null
+++ tutorial/virtual-machines-for-experiments/index.html    2014-09-26 18:20:20 +0900 (9e27525)
@@ -0,0 +1,4 @@
+---
+layout: redirect-to-current-version
+unversioned_path: /tutorial/
+---
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index