[Groonga-commit] droonga/droonga.org at 3f3a3df [gh-pages] Update steps to install for the next release

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Wed Sep 24 03:40:11 JST 2014


SHIMODA "Piro" Hiroshi	2014-09-24 03:40:11 +0900 (Wed, 24 Sep 2014)

  New Revision: 3f3a3df27d96fc24af77c40ebf010d3702fdcfa4
  https://github.com/droonga/droonga.org/commit/3f3a3df27d96fc24af77c40ebf010d3702fdcfa4

  Message:
    Update steps to install for the next release

  Modified files:
    _po/ja/tutorial/1.0.6/basic/index.po
    ja/tutorial/1.0.6/basic/index.md
    tutorial/1.0.6/basic/index.md

  Modified: _po/ja/tutorial/1.0.6/basic/index.po (+56 -55)
===================================================================
--- _po/ja/tutorial/1.0.6/basic/index.po    2014-09-24 03:13:06 +0900 (e69843c)
+++ _po/ja/tutorial/1.0.6/basic/index.po    2014-09-24 03:40:11 +0900 (b34b0b1)
@@ -168,12 +168,14 @@ msgid ""
 "Prepare a computer at first. This tutorial describes steps to develop a search"
 " service based on the Droonga, on an existing computer.\n"
 "Following instructions are basically written for a successfully prepared virtu"
-"al machine of the `Ubuntu 13.10 x64` or `CentOS 6.5 x64` on the service [Digit"
-"alOcean](https://www.digitalocean.com/), with an available console."
+"al machine of the `Ubuntu 14.04 x64`, `CentOS 7 x64`, or or `CentOS 6.5 x64` o"
+"n the service [DigitalOcean](https://www.digitalocean.com/), with an available"
+" console."
 msgstr ""
 "まずコンピュータを調達しましょう。このチュートリアルでは、既存のコンピュータにDroongaによる検索システムを構築する手順を解説します。\n"
-"以降の説明は基本的に、[DigitalOcean](https://www.digitalocean.com/)で `Ubuntu 13.10 x64` ま"
-"たは `CentOS 6.5 x64` の仮想マシンのセットアップを完了し、コンソールにアクセスできる状態になった後を前提として進めます。"
+"以降の説明は基本的に、[DigitalOcean](https://www.digitalocean.com/)で `Ubuntu 14.04 x64`、`"
+"CentOS 6.5 x64`、 または `CentOS 7 x64` の仮想マシンのセットアップを完了し、コンソールにアクセスできる状態になった後を前提と"
+"して進めます。"
 
 msgid ""
 "NOTE: Make sure to use instances with >= 2GB memory equipped, at least during "
@@ -202,15 +204,15 @@ msgid ""
 "m"
 msgstr ""
 
-msgid "CentOS:"
+msgid "CentOS 7:"
+msgstr ""
+
+msgid "CentOS 6.5:"
 msgstr ""
 
 msgid ""
 "    # yum -y groupinstall development\n"
-"    # curl -L get.rvm.io | bash -s stable\n"
-"    # source /etc/profile.d/rvm.sh\n"
-"    # rvm reload\n"
-"    # rvm install 2.1.2\n"
+"    # yum -y install epel-release ruby-devel\n"
 "    # yum -y install npm"
 msgstr ""
 
@@ -231,10 +233,10 @@ msgstr ""
 "Droonga Engine は、データベースを保持し、実際の検索を担当する部分です。\n"
 "このセクションでは、 droonga-engine をインストールし、検索対象となるデータを準備します。"
 
-msgid "### Install a droonga-engine and droonga-client"
-msgstr "### droonga-engineとdroonga-clientをインストールする"
+msgid "### Install `droonga-engine`"
+msgstr "### `droonga-engine`をインストールする"
 
-msgid "    # gem install droonga-engine droonga-client"
+msgid "    # gem install droonga-engine"
 msgstr ""
 
 msgid ""
@@ -242,34 +244,24 @@ msgid ""
 "figuration step."
 msgstr "Droonga Engine を構築するのに必要なパッケージがセットアップできました。引き続き設定に移ります。"
 
-msgid "### Prepare configuration files to start a Droonga engine"
-msgstr "### Droonga Engine を起動するための設定ファイルを用意する"
-
-msgid "Create a directory for a Droonga engine:"
-msgstr "まず Droonga Engine 用のディレクトリを作成します。"
+msgid "### Prepare configuration files to start `droonga-engine`"
+msgstr "### `droonga-engine`を起動するための設定ファイルを用意する"
 
 msgid ""
-"    # mkdir ~/droonga\n"
-"    # cd ~/droonga"
+"Create a user for the `droonga-engine` service and the configuration directory"
+".\n"
+"All configuration files and physical databases are placed under the directory:"
 msgstr ""
+"`droonga-engine`サービス用のユーザを作成し、設定ディレクトリを作成します。\n"
+"すべての設定ファイルと物理的なデータベースはこのディレクトリの下に置かれます:"
 
 msgid ""
-"Define and export a new environment varialbe `DROONGA_BASE_DIR`, the path to t"
-"he configuration directory."
-msgstr "作成したディレクトリへのパスを、環境変数 `DROONGA_BASE_DIR` として定義し、エクスポートしておきましょう。"
-
-msgid "    # export DROONGA_BASE_DIR=~/droonga"
+"    # useradd -m droonga-engine\n"
+"    $ sudo -u droonga-engine -H mkdir ~droonga-engine/droonga\n"
+"    $ cd ~droonga-engine/droonga"
 msgstr ""
 
 msgid ""
-"The environment variable is used by droonga-engine and various command line ut"
-"ilities.\n"
-"For convenience, you should define and export `DROONGA_BASE_DIR` globally."
-msgstr ""
-"この環境変数はdroonga-engineや他のコマンドラインユーティリティなどから参照されます。\n"
-"利便性のために、`DROONGA_BASE_DIR`はグローバルに定義・エクスポートしておく事をおすすめします。"
-
-msgid ""
 "Then put a configuration file `droonga-engine.yaml` like following, into the d"
 "irectory:"
 msgstr "以下の内容で設定ファイル `droonga-engine.yaml` をディレクトリ内に作成します。"
@@ -422,33 +414,35 @@ msgid ""
 "manual of catalog.json](/reference/catalog)."
 msgstr "`catalog.json` の詳細については [catalog.json](/ja/reference/catalog) を参照してください。"
 
-msgid "### Start an instance of droonga-engine"
-msgstr "### droonga-engine を起動する"
+msgid "### Start the `droonga-engine` server process"
+msgstr "### `droonga-engine`をサーバプロセスを起動する"
 
 msgid ""
-"Start a Droonga engine, you can start it with the command `droonga-engine`, li"
-"ke:"
-msgstr "以下のようにして droonga-engine を起動します。"
+"Start the `droonga-engine` server process. You can do it with the command `dro"
+"onga-engine`, like:"
+msgstr "`droonga-engine`のサーバプロセスを起動します。これは`droonga-engine`コマンドを使って以下のように行います:"
 
-msgid "    # droonga-engine"
+msgid "    $ sudo -u droonga-engine -H droonga-engine"
 msgstr ""
 
-msgid "### Stop an instance of droonga-engine"
-msgstr "### droonga-engine を終了する"
+msgid "### Stop the `droonga-engine` server process"
+msgstr "### `droonga-engine` のサーバプロセスを停止する"
 
-msgid "First, you need to know how to stop droonga-engine."
-msgstr "最初にdroonga-engineを終了する方法を知っておきましょう。"
+msgid "You need to know how to stop `droonga-engine` server process."
+msgstr "最初に`droonga-engine`のサーバプロセスを終了する方法を知っておきましょう。"
 
 msgid "Run `droonga-engine-stop`, a utility command to stop droonga-engine service:"
 msgstr "droonga-engineのサービスを停止するためのユーティリティコマンド `droonga-engine-stop` を実行します。"
 
-msgid "    # droonga-engine-stop"
+msgid "    $ sudo -u droonga-engine -H droonga-engine-stop"
 msgstr ""
 
 msgid "or, send SIGTERM to droonga-engine directly:"
 msgstr "または、droonga-engineに直接SIGTERMを送ります。"
 
-msgid "    # kill $(cat $DROONGA_BASE_DIR/droonga-engine.pid)"
+msgid ""
+"    $ sudo -u droonga-engine -H  kill $(cat ~droonga-engine/droonga/droonga-en"
+"gine.pid)"
 msgstr ""
 
 msgid "This is the way to stop droonga-engine."
@@ -923,7 +917,7 @@ msgstr "以下のようにして`stores.json`を送信します:"
 
 msgid ""
 "~~~\n"
-"# droonga-request stores.jsons\n"
+"$ droonga-request stores.jsons\n"
 "Elapsed time: 0.01101195\n"
 "[\n"
 "  \"droonga.message\",\n"
@@ -994,7 +988,7 @@ msgstr "Droonga Engine にリクエストを送信します:"
 
 msgid ""
 "~~~\n"
-"# droonga-request search-all-stores.json\n"
+"$ droonga-request search-all-stores.json\n"
 "Elapsed time: 0.008286785\n"
 "[\n"
 "  \"droonga.message\",\n"
@@ -1159,12 +1153,19 @@ msgstr "`droonga-http-server`は、Node.js のパッケージなので、`npm`
 msgid "    # npm install -g droonga-http-server"
 msgstr ""
 
+msgid "Next, prepare a user for the service."
+msgstr "次に、サービス用のユーザを用意します。"
+
 msgid ""
-"Next, put a configuration file `droonga-http-server.yaml` into the configurati"
-"on directory specified by the environment variable `DROONGA_BASE_DIR`."
+"    # useradd -m droonga-http-server\n"
+"    $ sudo -u droonga-http-server -H mkdir ~droonga-http-server/droonga\n"
+"    $ cd ~droonga-http-server/droonga"
 msgstr ""
-"次に、環境変数 `DROONGA_BASE_DIR` で示されているディレクトリに設定ファイル `droonga-http-server.yaml` を置き"
-"ます。"
+
+msgid ""
+"Then put a configuration file `droonga-http-server.yaml` into the configuratio"
+"n directory."
+msgstr "以下の内容で設定ファイル `droonga-http-server.yaml` を設定ディレクトリ内に作成します。"
 
 msgid "droonga-http-server.yaml:"
 msgstr ""
@@ -1195,14 +1196,14 @@ msgid ""
 "    port:        10041\n"
 "    environment: production\n"
 "    engine:\n"
-"      host:          192.168.100.50\n"
-"      receiver_host: 192.168.100.51"
+"      host:         192.168.100.50\n"
+"      receive_host: 192.168.100.51"
 msgstr ""
 
 msgid "OK, let's run it."
 msgstr "では、サーバを起動しましょう。"
 
-msgid "    # droonga-http-server"
+msgid "    $ sudo -u droonga-http-server -H droonga-http-server"
 msgstr ""
 
 msgid "### Search request via HTTP"
@@ -1224,7 +1225,7 @@ msgstr ""
 "として受け取ることができます)"
 
 msgid ""
-"    # curl \"http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1\""
+"    $ curl \"http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1\""
 "\n"
 "    {\n"
 "      \"stores\": {\n"
@@ -1369,7 +1370,7 @@ msgstr ""
 "を、`match_to` パラメータに検索対象として `_key` を指定し、以下のようなリクエストを発行します。"
 
 msgid ""
-"    # curl \"http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_"
+"    $ curl \"http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_"
 "key&attributes=_key&limit=-1\"\n"
 "    {\n"
 "      \"stores\": {\n"

  Modified: ja/tutorial/1.0.6/basic/index.md (+39 -35)
===================================================================
--- ja/tutorial/1.0.6/basic/index.md    2014-09-24 03:13:06 +0900 (85bec96)
+++ ja/tutorial/1.0.6/basic/index.md    2014-09-24 03:40:11 +0900 (ce03870)
@@ -75,7 +75,7 @@ Droonga Engine自体は通信プロトコルとしてfluentdプロトコルに
 ## 実験用のマシンを用意する
 
 まずコンピュータを調達しましょう。このチュートリアルでは、既存のコンピュータにDroongaによる検索システムを構築する手順を解説します。
-以降の説明は基本的に、[DigitalOcean](https://www.digitalocean.com/)で `Ubuntu 13.10 x64` または `CentOS 6.5 x64` の仮想マシンのセットアップを完了し、コンソールにアクセスできる状態になった後を前提として進めます。
+以降の説明は基本的に、[DigitalOcean](https://www.digitalocean.com/)で `Ubuntu 14.04 x64`、`CentOS 6.5 x64`、 または `CentOS 7 x64` の仮想マシンのセットアップを完了し、コンソールにアクセスできる状態になった後を前提として進めます。
 
 注意:Droongaが必要とするパッケージをインストールする前に、マシンが2GB以上のメモリを備えていることを確認して下さい。メモリが不足していると、ビルド時にエラーが出て、ビルドに失敗することがあります。
 
@@ -91,13 +91,16 @@ Ubuntu:
     # apt-get -y upgrade
     # apt-get install -y ruby ruby-dev build-essential nodejs nodejs-legacy npm
 
-CentOS:
+CentOS 7:
+
+    # apt-get update
+    # apt-get -y upgrade
+    # apt-get install -y ruby ruby-dev build-essential nodejs nodejs-legacy npm
+
+CentOS 6.5:
 
     # yum -y groupinstall development
-    # curl -L get.rvm.io | bash -s stable
-    # source /etc/profile.d/rvm.sh
-    # rvm reload
-    # rvm install 2.1.2
+    # yum -y install epel-release ruby-devel
     # yum -y install npm
 
 要するに、`gem`と`npm`を使えるようにした上で、ネイティブ拡張をビルドするためのいくつかのパッケージをインストールする必要があるということです。
@@ -107,25 +110,20 @@ CentOS:
 Droonga Engine は、データベースを保持し、実際の検索を担当する部分です。
 このセクションでは、 droonga-engine をインストールし、検索対象となるデータを準備します。
 
-### droonga-engineとdroonga-clientをインストールする
+### `droonga-engine`をインストールする
 
-    # gem install droonga-engine droonga-client
+    # gem install droonga-engine
 
 Droonga Engine を構築するのに必要なパッケージがセットアップできました。引き続き設定に移ります。
 
-### Droonga Engine を起動するための設定ファイルを用意する
+### `droonga-engine`を起動するための設定ファイルを用意する
 
-まず Droonga Engine 用のディレクトリを作成します。
+`droonga-engine`サービス用のユーザを作成し、設定ディレクトリを作成します。
+すべての設定ファイルと物理的なデータベースはこのディレクトリの下に置かれます:
 
-    # mkdir ~/droonga
-    # cd ~/droonga
-
-作成したディレクトリへのパスを、環境変数 `DROONGA_BASE_DIR` として定義し、エクスポートしておきましょう。
-
-    # export DROONGA_BASE_DIR=~/droonga
-
-この環境変数はdroonga-engineや他のコマンドラインユーティリティなどから参照されます。
-利便性のために、`DROONGA_BASE_DIR`はグローバルに定義・エクスポートしておく事をおすすめします。
+    # useradd -m droonga-engine
+    $ sudo -u droonga-engine -H mkdir ~droonga-engine/droonga
+    $ cd ~droonga-engine/droonga
 
 以下の内容で設定ファイル `droonga-engine.yaml` をディレクトリ内に作成します。
 
@@ -248,29 +246,29 @@ catalog.json:
 
 `catalog.json` の詳細については [catalog.json](/ja/reference/catalog) を参照してください。
 
-### droonga-engine を起動する
+### `droonga-engine`をサーバプロセスを起動する
 
-以下のようにして droonga-engine を起動します。
+`droonga-engine`のサーバプロセスを起動します。これは`droonga-engine`コマンドを使って以下のように行います:
 
-    # droonga-engine
+    $ sudo -u droonga-engine -H droonga-engine
 
-### droonga-engine を終了する
+### `droonga-engine` のサーバプロセスを停止する
 
-最初にdroonga-engineを終了する方法を知っておきましょう。
+最初に`droonga-engine`のサーバプロセスを終了する方法を知っておきましょう。
 
 droonga-engineのサービスを停止するためのユーティリティコマンド `droonga-engine-stop` を実行します。
 
-    # droonga-engine-stop
+    $ sudo -u droonga-engine -H droonga-engine-stop
 
 または、droonga-engineに直接SIGTERMを送ります。
 
-    # kill $(cat $DROONGA_BASE_DIR/droonga-engine.pid)
+    $ sudo -u droonga-engine -H  kill $(cat ~droonga-engine/droonga/droonga-engine.pid)
 
 これがdroonga-engineを終了する方法です。
 
 再度droonga-engineを起動します。
 
-    # droonga-engine
+    $ sudo -u droonga-engine -H droonga-engine
 
 ### データベースを作成する
 
@@ -727,7 +725,7 @@ stores.jsons:
 以下のようにして`stores.json`を送信します:
 
 ~~~
-# droonga-request stores.jsons
+$ droonga-request stores.jsons
 Elapsed time: 0.01101195
 [
   "droonga.message",
@@ -789,7 +787,7 @@ search-all-stores.json:
 Droonga Engine にリクエストを送信します:
 
 ~~~
-# droonga-request search-all-stores.json
+$ droonga-request search-all-stores.json
 Elapsed time: 0.008286785
 [
   "droonga.message",
@@ -941,7 +939,13 @@ HTTP Protocol Adapterとして`droonga-http-server`を使用しましょう。
 
     # npm install -g droonga-http-server
 
-次に、環境変数 `DROONGA_BASE_DIR` で示されているディレクトリに設定ファイル `droonga-http-server.yaml` を置きます。
+次に、サービス用のユーザを用意します。
+
+    # useradd -m droonga-http-server
+    $ sudo -u droonga-http-server -H mkdir ~droonga-http-server/droonga
+    $ cd ~droonga-http-server/droonga
+
+以下の内容で設定ファイル `droonga-http-server.yaml` を設定ディレクトリ内に作成します。
 
 droonga-http-server.yaml:
 
@@ -957,19 +961,19 @@ droonga-http-server.yaml:
     port:        10041
     environment: production
     engine:
-      host:          192.168.100.50
-      receiver_host: 192.168.100.51
+      host:         192.168.100.50
+      receive_host: 192.168.100.51
 
 では、サーバを起動しましょう。
 
-    # droonga-http-server
+    $ sudo -u droonga-http-server -H droonga-http-server
 
 
 ### HTTPでの検索リクエスト
 
 準備が整いました。 Protocol Adapter に向けて HTTP 経由でリクエストを発行し、データベースに問い合わせを行ってみましょう。まずは `Shops` テーブルの中身を取得してみます。以下のようなリクエストを用います。(`attributes=_key` を指定しているのは「検索結果に `_key` 値を含めて返してほしい」という意味です。これがないと、`records` に何も値がないレコードが返ってきてしまいます。`attributes` パラメータには `,` 区切りで複数の属性を指定することができます。`attributes=_key,location` と指定することで、緯度経度もレスポンスとして受け取ることができます)
 
-    # curl "http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1"
+    $ curl "http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1"
     {
       "stores": {
         "count": 40,
@@ -1102,7 +1106,7 @@ droonga-http-server.yaml:
 
 もう少し複雑なクエリを試してみましょう。例えば、店名に「Columbus」を含む店舗を検索します。`query` パラメータにクエリ `Columbus` を、`match_to` パラメータに検索対象として `_key` を指定し、以下のようなリクエストを発行します。
 
-    # curl "http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_key&attributes=_key&limit=-1"
+    $ curl "http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_key&attributes=_key&limit=-1"
     {
       "stores": {
         "count": 2,

  Modified: tutorial/1.0.6/basic/index.md (+39 -35)
  Mode: 100644 -> 100755
===================================================================
--- tutorial/1.0.6/basic/index.md    2014-09-24 03:13:06 +0900 (1dfbf32)
+++ tutorial/1.0.6/basic/index.md    2014-09-24 03:40:11 +0900 (d3412c2)
@@ -67,7 +67,7 @@ For example, let's try to build a database system to find [Starbucks stores in N
 ## Prepare an environment for experiments
 
 Prepare a computer at first. This tutorial describes steps to develop a search service based on the Droonga, on an existing computer.
-Following instructions are basically written for a successfully prepared virtual machine of the `Ubuntu 13.10 x64` or `CentOS 6.5 x64` on the service [DigitalOcean](https://www.digitalocean.com/), with an available console.
+Following instructions are basically written for a successfully prepared virtual machine of the `Ubuntu 14.04 x64`, `CentOS 7 x64`, or or `CentOS 6.5 x64` on the service [DigitalOcean](https://www.digitalocean.com/), with an available console.
 
 NOTE: Make sure to use instances with >= 2GB memory equipped, at least during installation of required packages for Droonga. Otherwise, you may experience a strange build error.
 
@@ -83,13 +83,16 @@ Ubuntu:
     # apt-get -y upgrade
     # apt-get install -y ruby ruby-dev build-essential nodejs nodejs-legacy npm
 
-CentOS:
+CentOS 7:
+
+    # apt-get update
+    # apt-get -y upgrade
+    # apt-get install -y ruby ruby-dev build-essential nodejs nodejs-legacy npm
+
+CentOS 6.5:
 
     # yum -y groupinstall development
-    # curl -L get.rvm.io | bash -s stable
-    # source /etc/profile.d/rvm.sh
-    # rvm reload
-    # rvm install 2.1.2
+    # yum -y install epel-release ruby-devel
     # yum -y install npm
 
 Yes, in short, you have to activate `gem` and `npm` commands, and install some packages to build native extensions.
@@ -99,25 +102,20 @@ Yes, in short, you have to activate `gem` and `npm` commands, and install some p
 The part "Droonga engine" stores the database and provides the search feature actually.
 In this section we install a droonga-engine and load searchable data to the database.
 
-### Install a droonga-engine and droonga-client
+### Install `droonga-engine`
 
-    # gem install droonga-engine droonga-client
+    # gem install droonga-engine
 
 Required packages are prepared by the command above. Let's continue to the configuration step.
 
-### Prepare configuration files to start a Droonga engine
+### Prepare configuration files to start `droonga-engine`
 
-Create a directory for a Droonga engine:
+Create a user for the `droonga-engine` service and the configuration directory.
+All configuration files and physical databases are placed under the directory:
 
-    # mkdir ~/droonga
-    # cd ~/droonga
-
-Define and export a new environment varialbe `DROONGA_BASE_DIR`, the path to the configuration directory.
-
-    # export DROONGA_BASE_DIR=~/droonga
-
-The environment variable is used by droonga-engine and various command line utilities.
-For convenience, you should define and export `DROONGA_BASE_DIR` globally.
+    # useradd -m droonga-engine
+    $ sudo -u droonga-engine -H mkdir ~droonga-engine/droonga
+    $ cd ~droonga-engine/droonga
 
 Then put a configuration file `droonga-engine.yaml` like following, into the directory:
 
@@ -240,29 +238,29 @@ The `"address"` indicates the location of the corresponding physical storage whi
 
 For more details of the configuration file `catalog.json`, see [the reference manual of catalog.json](/reference/catalog).
 
-### Start an instance of droonga-engine
+### Start the `droonga-engine` server process
 
-Start a Droonga engine, you can start it with the command `droonga-engine`, like:
+Start the `droonga-engine` server process. You can do it with the command `droonga-engine`, like:
 
-    # droonga-engine
+    $ sudo -u droonga-engine -H droonga-engine
 
-### Stop an instance of droonga-engine
+### Stop the `droonga-engine` server process
 
-First, you need to know how to stop droonga-engine.
+You need to know how to stop `droonga-engine` server process.
 
 Run `droonga-engine-stop`, a utility command to stop droonga-engine service:
 
-    # droonga-engine-stop
+    $ sudo -u droonga-engine -H droonga-engine-stop
 
 or, send SIGTERM to droonga-engine directly:
 
-    # kill $(cat $DROONGA_BASE_DIR/droonga-engine.pid)
+    $ sudo -u droonga-engine -H  kill $(cat ~droonga-engine/droonga/droonga-engine.pid)
 
 This is the way to stop droonga-engine.
 
 Start droonga-engine again:
 
-    # droonga-engine
+    $ sudo -u droonga-engine -H droonga-engine
 
 ### Create a database
 
@@ -719,7 +717,7 @@ Open another terminal and send the json to the Droonga engine.
 Send `stores.jsons` as follows:
 
 ~~~
-# droonga-request stores.jsons
+$ droonga-request stores.jsons
 Elapsed time: 0.01101195
 [
   "droonga.message",
@@ -781,7 +779,7 @@ search-all-stores.json:
 Send the request to the Droonga Engine:
 
 ~~~
-# droonga-request search-all-stores.json
+$ droonga-request search-all-stores.json
 Elapsed time: 0.008286785
 [
   "droonga.message",
@@ -934,7 +932,13 @@ It is an npm package for the Node.js so you can install it by `npm` command easi
 
     # npm install -g droonga-http-server
 
-Next, put a configuration file `droonga-http-server.yaml` into the configuration directory specified by the environment variable `DROONGA_BASE_DIR`.
+Next, prepare a user for the service.
+
+    # useradd -m droonga-http-server
+    $ sudo -u droonga-http-server -H mkdir ~droonga-http-server/droonga
+    $ cd ~droonga-http-server/droonga
+
+Then put a configuration file `droonga-http-server.yaml` into the configuration directory.
 
 droonga-http-server.yaml:
 
@@ -950,19 +954,19 @@ droonga-http-server.yaml:
     port:        10041
     environment: production
     engine:
-      host:          192.168.100.50
-      receiver_host: 192.168.100.51
+      host:         192.168.100.50
+      receive_host: 192.168.100.51
 
 OK, let's run it.
 
-    # droonga-http-server
+    $ sudo -u droonga-http-server -H droonga-http-server
 
 
 ### Search request via HTTP
 
 We're all set. Let's send a search request to the protocol adapter via HTTP. At first, try to get all records of the `Stores` table by a request like following. (Note: The `attributes=_key` parameter means "export the value of the column `_key` to the search result". If you don't set the parameter, each record returned in the `records` will become just a blank array. You can specify multiple column names by the delimiter `,`. For example `attributes=_key,location` will return both the primary key and the location for each record.)
 
-    # curl "http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1"
+    $ curl "http://192.168.100.50:10041/tables/Store?attributes=_key&limit=-1"
     {
       "stores": {
         "count": 40,
@@ -1095,7 +1099,7 @@ Because the `count` says `40`, you know there are all 40 records in the table. S
 
 Next step, let's try more meaningful query. To search stores which contain "Columbus" in their name, give `Columbus` as the parameter `query`, and give `_key` as the parameter `match_to` which means the column to be searched. Then:
 
-    # curl "http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_key&attributes=_key&limit=-1"
+    $ curl "http://192.168.100.50:10041/tables/Store?query=Columbus&match_to=_key&attributes=_key&limit=-1"
     {
       "stores": {
         "count": 2,
-------------- next part --------------
HTML����������������������������...
Download 



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