[Groonga-commit] droonga/droonga.org at dc8e49d [gh-pages] Update tutorial based on new utility commands

アーカイブの一覧に戻る

YUKI Hiroshi null+****@clear*****
Sat Jun 28 04:43:00 JST 2014


YUKI Hiroshi	2014-06-28 04:43:00 +0900 (Sat, 28 Jun 2014)

  New Revision: dc8e49d2ef1fcc4e1ca97fdf26adc0792732b440
  https://github.com/droonga/droonga.org/commit/dc8e49d2ef1fcc4e1ca97fdf26adc0792732b440

  Message:
    Update tutorial based on new utility commands

  Modified files:
    _po/ja/tutorial/1.0.4/add-replica/index.po
    ja/tutorial/1.0.4/add-replica/index.md
    tutorial/1.0.4/add-replica/index.md

  Modified: _po/ja/tutorial/1.0.4/add-replica/index.po (+58 -244)
===================================================================
--- _po/ja/tutorial/1.0.4/add-replica/index.po    2014-06-28 04:25:16 +0900 (0c49817)
+++ _po/ja/tutorial/1.0.4/add-replica/index.po    2014-06-28 04:43:00 +0900 (5da0459)
@@ -302,21 +302,23 @@ msgstr ""
 
 msgid ""
 "    (on 192.168.0.12)\n"
-"    # droonga-engine-join --replica-source-host=192.168.0.10 \\\n"
+"    # droonga-engine-join --base-dir=~/droonga \\\n"
+"                          --replica-source-host=192.168.0.10 \\\n"
 "                          --my-host=192.168.0.12"
 msgstr ""
 
-msgid "Note, you must specify two options for the command always."
-msgstr "以下の2つのオプションの指定が必須である事に注意して下さい。"
-
 msgid ""
 " * You must specify the host name or the IP address of an existing node of the"
 " cluster, via the `--replica-source-host` option.\n"
 " * You must specify the host name or the IP address of the new replica node it"
-"self, via the `--my-host` option."
+"self, via the `--my-host` option.\n"
+" * You must run the command in the directory `catalog.json` is located, or spe"
+"cify path to the directory via the `--base-dir` option."
 msgstr ""
 " * `--replica-source-host` オプションで、クラスタ中の既存のノードの1つのホスト名またはIPアドレスを指定して下さい。\n"
-" * `--my-host` オプションで、その新しいreplicaノード自身のホスト名またはIPアドレスを指定して下さい。"
+" * `--my-host` オプションで、その新しいreplicaノード自身のホスト名またはIPアドレスを指定して下さい。\n"
+" * コマンドは `catalog.json` が置かれたディレクトリで実行するか、もしくはそのディレクトリのパスを `--base-dir` オプションで"
+"指定して下さい。"
 
 msgid ""
 "Then the command automatically starts to synchronize all data of the cluster t"
@@ -400,196 +402,35 @@ msgid "### Unjoin an existing replica from the cluster"
 msgstr "### 既存のreplicaをクラスタから分離する"
 
 msgid ""
-"To remove a replica from an existing cluster, you just have to update the \"cat"
-"alog.json\" with new list of replica nodes except the node to be removed:"
+"To remove a replica from an existing cluster, you just run the `droonga-engine"
+"-unjoin` command on any existing node in the cluster."
 msgstr ""
-"既存のクラスタからreplicaノードを取り除くには、単に、そのノードを含まないreplicaノードのリストを伴って`catalog.json` を更新する"
-"だけでよいです:"
+"新しいreplicaノードを既存のクラスタから削除するには、*新しいreplicaノード自身の上で*`droonga-engine-unjoin`コマンドを"
+"実行します:"
 
 msgid ""
 "    (on 192.168.0.10)\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --remove-replica-hosts=192.168.0.12"
-msgstr ""
-
-msgid "Then there are two overlapping Droonga clusters theoretically on this time."
-msgstr "この時点で、理論上、部分的に重なり合う2つのDroongaクラスタが存在するようになりました。"
-
-msgid ""
-" * The existing cluster \"charlie\" including three replicas.\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`\n"
-"   * `192.168.0.12`\n"
-" * The new cluster including two replicas.\n"
-"   Let's give a name *\"delta\"* to it, for now.\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`"
-msgstr ""
-" * 3つのreplicaを含む既存のクラスタ「charlie」。\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`\n"
-"   * `192.168.0.12`\n"
-" * 2つのreplicaを含む新しいクラスタ。以下、*「delta」*と仮称します。\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`"
-
-msgid "You can confirm that, via the `system.status` command for each cluster:"
-msgstr "この事は、各クラスタに対する `system.status` コマンドの実行結果を見ると確認できます:"
-
-msgid ""
-"~~~\n"
-"(for the cluster charlie)\n"
-"# curl \"http://192.168.0.11:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.12:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"# curl \"http://192.168.0.12:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.12:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"~~~"
-msgstr ""
-
-msgid ""
-"Because `catalog.json` on nodes `192.168.0.11` and `192.168.0.12` have no chan"
-"ge, they still detect three nodes in the cluster charlie."
-msgstr ""
-"`192.168.0.11` と `192.168.0.12` の `catalog.json` には何も変更がないため、これらのノードは依然としてクラスタ"
-" charlie が3つのノードから構成されていると認識しています。"
-
-msgid ""
-"On the other hand, the node `192.168.0.10` with new `catalog.json` knows the c"
-"luster delta includes only two nodes:"
-msgstr ""
-"その一方で、新しい `catalog.json` を持つ `192.168.0.10` は、クラスタ delta が2つのノードから構成されている事を知って"
-"います:"
-
-msgid ""
-"~~~\n"
-"(for the cluster delta)\n"
-"# curl \"http://192.168.0.10:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"~~~"
-msgstr ""
-
-msgid ""
-"So the node `192.168.0.10` doesn't deliver incoming messages to the missing no"
-"de `192.168.0.12` anymore."
-msgstr ""
-"そのため、ノード `192.168.0.10` へ流入してくるメッセージは、既に存在しないものと認識されているノード `192.168.0.12` へは決し"
-"て配送されません。"
-
-msgid "Next, update existing `catalog.json` on other nodes, like:"
-msgstr "次に、他のノードの既存の `catalog.json` を以下のようにして更新します:"
-
-msgid ""
-"    (on 192.168.0.11, 192.168.0.12)\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --remove-replica-hosts=192.168.0.12"
-msgstr ""
-
-msgid "Then there is only one Droonga cluster on this time."
-msgstr "この時点で、Droongaクラスタは1つだけ存在する状態となっています。"
-
-msgid ""
-" * The new cluster \"delta\" including two replicas.\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`"
-msgstr ""
-" * 2つのreplicaを含むクラスタ「delta」。\n"
-"   * `192.168.0.10`\n"
-"   * `192.168.0.11`"
-
-msgid ""
-"~~~\n"
-"(for the cluster delta)\n"
-"# curl \"http://192.168.0.10:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"# curl \"http://192.168.0.11:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"# curl \"http://192.168.0.12:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.10:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    },\n"
-"    \"192.168.0.11:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"~~~"
+"    # droonga-engine-unjoin --base-dir=~/droonga \\\n"
+"                            --replica-remove-host=192.168.0.12"
 msgstr ""
 
 msgid ""
-"Any incoming request is delivered to member nodes of the cluster delta.\n"
-"Because the orphan node `192.168.0.12` is not a member, it never process reque"
-"sts by self."
+" * You must specify the host name or the IP address of an existing node to be "
+"removed from the cluster, via the `--replica-remove-host` option.\n"
+" * You must run the command in the directory `catalog.json` is located, or spe"
+"cify path to the directory via the `--base-dir` option."
 msgstr ""
-"流入してきたリクエストはクラスタ delta の各ノードに届けられますが、孤立したノード `192.168.0.12` はもはやクラスタの一員ではないため、"
-"リクエストを自分自身で処理する事はありません。"
+" * `--replica-remove-host` オプションで、クラスタから削除するノードのホスト名またはIPアドレスを指定して下さい。\n"
+" * コマンドは `catalog.json` が置かれたディレクトリで実行するか、もしくはそのディレクトリのパスを `--base-dir` オプションで"
+"指定して下さい。"
 
 msgid ""
-"OK, the node is ready to be removed.\n"
-"Stop servers and shutdown it if needed."
-msgstr ""
-"これで、ノードを取り除く準備ができました。\n"
-"必要に応じて、サービスを停止させ、コンピュータを停止させましょう。"
-
-msgid ""
-"    (on 192.168.0.12)\n"
-"    # kill $(cat ~/droonga/droonga-engine.pid)\n"
-"    # kill $(cat ~/droonga/droonga-http-server.pid)"
+"Then the specified node automatically unjoins from the cluster, and all nedes'"
+" `catalog.json` are also updated.\n"
+"Now, the node has been successfully unjoined from the cluster."
 msgstr ""
+"すると、ノードがクラスタから自動的に離脱し、すべてのノードの `catalog.json` も同時に更新されます。\n"
+"これで、ノードはクラスタから無事離脱しました。"
 
 msgid "## Replace an existing replica node in a cluster with a new one"
 msgstr "## クラスタ内の既存のreplicaノードを新しいreplicaノードで置き換える"
@@ -607,27 +448,19 @@ msgstr ""
 
 msgid ""
 "First, remove the unstable node.\n"
-"Remove the node from existing `catalog.json`, like:"
-msgstr ""
-"まず、不安定になっているノードを取り除きます。\n"
-"以下のようにして `catalog.json` から当該ノードの情報を削除します:"
+"Remove the node from the cluster, like:"
+msgstr "まず、不安定になっているノードを取り除きます。以下のようにしてクラスタからノードを離脱させて下さい:"
 
 msgid ""
-"    (on 192.168.0.10, 192.168.0.11)\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --remove-replica-hosts=192.168.0.11"
+"    (on 192.168.0.10)\n"
+"    # droonga-engine-unjoin --base-path=~/droonga \\\n"
+"                            --replica-remove-host=192.168.0.11"
 msgstr ""
 
-msgid "After that the node `192.168.0.11` unjoins from the cluster successfully."
-msgstr "これで、ノード `192.168.0.11` がクラスタから無事に分離します。"
-
 msgid ""
-"Now there is a cluster without the node `192.168.0.11`.\n"
+"Now the node has been gone.\n"
 "You can confirm that via the `system.status` command:"
-msgstr ""
-"この時点で、ノード `192.168.0.11` を含まないクラスタが存在するという状態になっています。\n"
-"これは `system.status` コマンドで確認できます:"
+msgstr "これで、ノードがクラスタから離脱しました。この事は `system.status` コマンドで確かめられます:"
 
 msgid ""
 "~~~\n"
@@ -647,59 +480,40 @@ msgstr "### 新しいreplicaを追加する"
 
 msgid ""
 "Next, setup the new replica.\n"
-"Construct a temporary cluster with only one node `192.168.0.12`.\n"
-"The result of the `system.status` command will be:"
+"Install required packages and starts the server with the `catalog.json` copied"
+" from an existing node of the cluster."
 msgstr ""
-"次に、新しいreplicaをセットアップします。\n"
-"1つのノード `192.168.0.12` だけを含む仮のクラスタを作ってください。\n"
-"`system.status` コマンドの結果はこのようになります:"
-
-msgid ""
-"~~~\n"
-"# curl \"http://192.168.0.12:10041/droonga/system/status\"\n"
-"{\n"
-"  \"nodes\": {\n"
-"    \"192.168.0.12:10031/droonga\": {\n"
-"      \"live\": true\n"
-"    }\n"
-"  }\n"
-"}\n"
-"~~~"
-msgstr ""
-
-msgid "Then, duplicate data from the existing cluster:"
-msgstr "クラスタが複数ある状態ができたら、既存クラスタから新しいクラスタへデータを複製します:"
+"次に、新しいreplicaを用意します。\n"
+"必要なパッケージをインストールし、クラスタの既存のノードから `catalog.json` をコピーして、サーバを起動します。"
 
 msgid ""
 "    (on 192.168.0.12)\n"
-"    # scp 192.168.0.10:~/droonga/catalog.json ~/droonga/\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --hosts=192.168.0.12\n"
-"    # droonga-engine-absorb-data --source-host=192.168.0.10 \\\n"
-"                                 --receiver-host=192.168.0.12"
+"    # cd ~/droonga\n"
+"    # scp 192.168.0.10:~/droonga/catalog.json ./\n"
+"    # host=192.168.0.12\n"
+"    # DROONGA_BASE_DIR=$PWD\n"
+"    # droonga-engine --host=$host \\\n"
+"                     --log-file=$DROONGA_BASE_DIR/droonga-engine.log \\\n"
+"                     --daemon \\\n"
+"                     --pid-file=$DROONGA_BASE_DIR/droonga-engine.pid\n"
+"    # env NODE_ENV=production \\\n"
+"        droonga-http-server --port=10041 \\\n"
+"                            --receive-host-name=$host \\\n"
+"                            --droonga-engine-host-name=$host \\\n"
+"                            --cache-size=-1 \\\n"
+"                            --daemon \\\n"
+"                            --pid-file=$DROONGA_BASE_DIR/droonga-http-server.p"
+"id"
 msgstr ""
 
-msgid ""
-"After the duplication successfully finished, the node is ready to join the clu"
-"ster.\n"
-"Add other nodes to the `catalog.json`:"
-msgstr ""
-"データの複製が完了したら、ノードをクラスタに参加させる準備は完了です。\n"
-"`catalog.json` に他のノードの情報を追加します:"
+msgid "Then, join the node to the cluster."
+msgstr "そうしたら、そのノードをクラスタに参加させましょう。"
 
 msgid ""
 "    (on 192.168.0.12)\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --add-replica-hosts=192.168.0.10"
-msgstr ""
-
-msgid ""
-"    (on 192.168.0.10)\n"
-"    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \\\n"
-"                                    --update \\\n"
-"                                    --add-replica-hosts=192.168.0.12"
+"    # droonga-engine-join --base-path=~/droonga \\\n"
+"                          --replica-source-host=192.168.0.10 \\\n"
+"                          --my-host=192.168.0.12"
 msgstr ""
 
 msgid ""

  Modified: ja/tutorial/1.0.4/add-replica/index.md (+37 -136)
===================================================================
--- ja/tutorial/1.0.4/add-replica/index.md    2014-06-28 04:25:16 +0900 (133a419)
+++ ja/tutorial/1.0.4/add-replica/index.md    2014-06-28 04:43:00 +0900 (66f9c15)
@@ -169,13 +169,13 @@ cronjobとして実行されるバッチスクリプトによって `load` コ
 新しいreplicaノードを既存のクラスタに追加するには、*新しいreplicaノード自身の上で*`droonga-engine-join`コマンドを実行します:
 
     (on 192.168.0.12)
-    # droonga-engine-join --replica-source-host=192.168.0.10 \
+    # droonga-engine-join --base-dir=~/droonga \
+                          --replica-source-host=192.168.0.10 \
                           --my-host=192.168.0.12
 
-以下の2つのオプションの指定が必須である事に注意して下さい。
-
  * `--replica-source-host` オプションで、クラスタ中の既存のノードの1つのホスト名またはIPアドレスを指定して下さい。
  * `--my-host` オプションで、その新しいreplicaノード自身のホスト名またはIPアドレスを指定して下さい。
+ * コマンドは `catalog.json` が置かれたディレクトリで実行するか、もしくはそのディレクトリのパスを `--base-dir` オプションで指定して下さい。
 
 コマンドを実行すると、自動的に、クラスタのデータが新しいdeplicaノードへと同期され始めます。
 データの同期が完了すると、ノードが自動的に再起動してクラスタに参加します。
@@ -221,95 +221,21 @@ Droongaクラスタ内のノードは互いに監視しあっており、動作
 
 ### 既存のreplicaをクラスタから分離する
 
-既存のクラスタからreplicaノードを取り除くには、単に、そのノードを含まないreplicaノードのリストを伴って`catalog.json` を更新するだけでよいです:
+新しいreplicaノードを既存のクラスタから削除するには、*新しいreplicaノード自身の上で*`droonga-engine-unjoin`コマンドを実行します:
 
     (on 192.168.0.10)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.12
-
-この時点で、理論上、部分的に重なり合う2つのDroongaクラスタが存在するようになりました。
-
- * 3つのreplicaを含む既存のクラスタ「charlie」。
-   * `192.168.0.10`
-   * `192.168.0.11`
-   * `192.168.0.12`
- * 2つのreplicaを含む新しいクラスタ。以下、*「delta」*と仮称します。
-   * `192.168.0.10`
-   * `192.168.0.11`
-
-この事は、各クラスタに対する `system.status` コマンドの実行結果を見ると確認できます:
-
-~~~
-(for the cluster charlie)
-# curl "http://192.168.0.11:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-# curl "http://192.168.0.12:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
+    # droonga-engine-unjoin --base-dir=~/droonga \
+                            --replica-remove-host=192.168.0.12
 
-`192.168.0.11` と `192.168.0.12` の `catalog.json` には何も変更がないため、これらのノードは依然としてクラスタ charlie が3つのノードから構成されていると認識しています。
+ * `--replica-remove-host` オプションで、クラスタから削除するノードのホスト名またはIPアドレスを指定して下さい。
+ * コマンドは `catalog.json` が置かれたディレクトリで実行するか、もしくはそのディレクトリのパスを `--base-dir` オプションで指定して下さい。
 
-その一方で、新しい `catalog.json` を持つ `192.168.0.10` は、クラスタ delta が2つのノードから構成されている事を知っています:
+すると、ノードがクラスタから自動的に離脱し、すべてのノードの `catalog.json` も同時に更新されます。
+これで、ノードはクラスタから無事離脱しました。
 
-~~~
-(for the cluster delta)
-# curl "http://192.168.0.10:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
-
-そのため、ノード `192.168.0.10` へ流入してくるメッセージは、既に存在しないものと認識されているノード `192.168.0.12` へは決して配送されません。
-
-次に、他のノードの既存の `catalog.json` を以下のようにして更新します:
-
-    (on 192.168.0.11, 192.168.0.12)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.12
-
-この時点で、Droongaクラスタは1つだけ存在する状態となっています。
-
- * 2つのreplicaを含むクラスタ「delta」。
-   * `192.168.0.10`
-   * `192.168.0.11`
-
-この事は、各クラスタに対する `system.status` コマンドの実行結果を見ると確認できます:
+この事は、`system.status` コマンドの結果を見ると確認できます:
 
 ~~~
-(for the cluster delta)
 # curl "http://192.168.0.10:10041/droonga/system/status"
 {
   "nodes": {
@@ -345,15 +271,6 @@ Droongaクラスタ内のノードは互いに監視しあっており、動作
 }
 ~~~
 
-流入してきたリクエストはクラスタ delta の各ノードに届けられますが、孤立したノード `192.168.0.12` はもはやクラスタの一員ではないため、リクエストを自分自身で処理する事はありません。
-
-これで、ノードを取り除く準備ができました。
-必要に応じて、サービスを停止させ、コンピュータを停止させましょう。
-
-    (on 192.168.0.12)
-    # kill $(cat ~/droonga/droonga-engine.pid)
-    # kill $(cat ~/droonga/droonga-http-server.pid)
-
 ## クラスタ内の既存のreplicaノードを新しいreplicaノードで置き換える
 
 ノードの置き換えは、上記の手順の組み合わせで行います。
@@ -362,18 +279,13 @@ Droongaクラスタ内のノードは互いに監視しあっており、動作
 
 ### 既存のreplicaをクラスタから分離する
 
-まず、不安定になっているノードを取り除きます。
-以下のようにして `catalog.json` から当該ノードの情報を削除します:
-
-    (on 192.168.0.10, 192.168.0.11)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.11
+まず、不安定になっているノードを取り除きます。以下のようにしてクラスタからノードを離脱させて下さい:
 
-これで、ノード `192.168.0.11` がクラスタから無事に分離します。
+    (on 192.168.0.10)
+    # droonga-engine-unjoin --base-path=~/droonga \
+                            --replica-remove-host=192.168.0.11
 
-この時点で、ノード `192.168.0.11` を含まないクラスタが存在するという状態になっています。
-これは `system.status` コマンドで確認できます:
+これで、ノードがクラスタから離脱しました。この事は `system.status` コマンドで確かめられます:
 
 ~~~
 # curl "http://192.168.0.10:10041/droonga/system/status"
@@ -388,43 +300,32 @@ Droongaクラスタ内のノードは互いに監視しあっており、動作
 
 ### 新しいreplicaを追加する
 
-次に、新しいreplicaをセットアップします。
-1つのノード `192.168.0.12` だけを含む仮のクラスタを作ってください。
-`system.status` コマンドの結果はこのようになります:
-
-~~~
-# curl "http://192.168.0.12:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
-
-クラスタが複数ある状態ができたら、既存クラスタから新しいクラスタへデータを複製します:
+次に、新しいreplicaを用意します。
+必要なパッケージをインストールし、クラスタの既存のノードから `catalog.json` をコピーして、サーバを起動します。
 
     (on 192.168.0.12)
-    # scp 192.168.0.10:~/droonga/catalog.json ~/droonga/
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --hosts=192.168.0.12
-    # droonga-engine-absorb-data --source-host=192.168.0.10 \
-                                 --receiver-host=192.168.0.12
+    # cd ~/droonga
+    # scp 192.168.0.10:~/droonga/catalog.json ./
+    # host=192.168.0.12
+    # DROONGA_BASE_DIR=$PWD
+    # droonga-engine --host=$host \
+                     --log-file=$DROONGA_BASE_DIR/droonga-engine.log \
+                     --daemon \
+                     --pid-file=$DROONGA_BASE_DIR/droonga-engine.pid
+    # env NODE_ENV=production \
+        droonga-http-server --port=10041 \
+                            --receive-host-name=$host \
+                            --droonga-engine-host-name=$host \
+                            --cache-size=-1 \
+                            --daemon \
+                            --pid-file=$DROONGA_BASE_DIR/droonga-http-server.pid
 
-データの複製が完了したら、ノードをクラスタに参加させる準備は完了です。
-`catalog.json` に他のノードの情報を追加します:
+そうしたら、そのノードをクラスタに参加させましょう。
 
     (on 192.168.0.12)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --add-replica-hosts=192.168.0.10
-
-    (on 192.168.0.10)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --add-replica-hosts=192.168.0.12
+    # droonga-engine-join --base-path=~/droonga \
+                          --replica-source-host=192.168.0.10 \
+                          --my-host=192.168.0.12
 
 最終的に、`192.168.0.10` と `192.168.0.12` の2つのノードからなるDroongaクラスタができあがりました。
 

  Modified: tutorial/1.0.4/add-replica/index.md (+36 -135)
===================================================================
--- tutorial/1.0.4/add-replica/index.md    2014-06-28 04:25:16 +0900 (d0863a9)
+++ tutorial/1.0.4/add-replica/index.md    2014-06-28 04:43:00 +0900 (b785013)
@@ -161,13 +161,13 @@ If you are reading this tutorial sequentially after the [previous topic](../dump
 To add a new replica node to an existing cluster, you just run a command `droonga-engine-join` *on the new replica node itself*, like:
 
     (on 192.168.0.12)
-    # droonga-engine-join --replica-source-host=192.168.0.10 \
+    # droonga-engine-join --base-dir=~/droonga \
+                          --replica-source-host=192.168.0.10 \
                           --my-host=192.168.0.12
 
-Note, you must specify two options for the command always.
-
  * You must specify the host name or the IP address of an existing node of the cluster, via the `--replica-source-host` option.
  * You must specify the host name or the IP address of the new replica node itself, via the `--my-host` option.
+ * You must run the command in the directory `catalog.json` is located, or specify path to the directory via the `--base-dir` option.
 
 Then the command automatically starts to synchronize all data of the cluster to the new replica node.
 After data is successfully synchronized, the node restarts and joins to the cluster automatically.
@@ -213,96 +213,21 @@ Assume that there is a Droonga cluster constructed with trhee replica nodes `192
 
 ### Unjoin an existing replica from the cluster
 
-To remove a replica from an existing cluster, you just have to update the "catalog.json" with new list of replica nodes except the node to be removed:
+To remove a replica from an existing cluster, you just run the `droonga-engine-unjoin` command on any existing node in the cluster.
 
     (on 192.168.0.10)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.12
-
-Then there are two overlapping Droonga clusters theoretically on this time.
-
- * The existing cluster "charlie" including three replicas.
-   * `192.168.0.10`
-   * `192.168.0.11`
-   * `192.168.0.12`
- * The new cluster including two replicas.
-   Let's give a name *"delta"* to it, for now.
-   * `192.168.0.10`
-   * `192.168.0.11`
-
-You can confirm that, via the `system.status` command for each cluster:
-
-~~~
-(for the cluster charlie)
-# curl "http://192.168.0.11:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-# curl "http://192.168.0.12:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
+    # droonga-engine-unjoin --base-dir=~/droonga \
+                            --replica-remove-host=192.168.0.12
 
-Because `catalog.json` on nodes `192.168.0.11` and `192.168.0.12` have no change, they still detect three nodes in the cluster charlie.
+ * You must specify the host name or the IP address of an existing node to be removed from the cluster, via the `--replica-remove-host` option.
+ * You must run the command in the directory `catalog.json` is located, or specify path to the directory via the `--base-dir` option.
 
-On the other hand, the node `192.168.0.10` with new `catalog.json` knows the cluster delta includes only two nodes:
+Then the specified node automatically unjoins from the cluster, and all nedes' `catalog.json` are also updated.
+Now, the node has been successfully unjoined from the cluster.
 
-~~~
-(for the cluster delta)
-# curl "http://192.168.0.10:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.10:10031/droonga": {
-      "live": true
-    },
-    "192.168.0.11:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
-
-So the node `192.168.0.10` doesn't deliver incoming messages to the missing node `192.168.0.12` anymore.
-
-Next, update existing `catalog.json` on other nodes, like:
-
-    (on 192.168.0.11, 192.168.0.12)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.12
-
-Then there is only one Droonga cluster on this time.
-
- * The new cluster "delta" including two replicas.
-   * `192.168.0.10`
-   * `192.168.0.11`
-
-You can confirm that, via the `system.status` command for each cluster:
+You can confirm that, via the `system.status` command:
 
 ~~~
-(for the cluster delta)
 # curl "http://192.168.0.10:10041/droonga/system/status"
 {
   "nodes": {
@@ -338,16 +263,6 @@ You can confirm that, via the `system.status` command for each cluster:
 }
 ~~~
 
-Any incoming request is delivered to member nodes of the cluster delta.
-Because the orphan node `192.168.0.12` is not a member, it never process requests by self.
-
-OK, the node is ready to be removed.
-Stop servers and shutdown it if needed.
-
-    (on 192.168.0.12)
-    # kill $(cat ~/droonga/droonga-engine.pid)
-    # kill $(cat ~/droonga/droonga-http-server.pid)
-
 ## Replace an existing replica node in a cluster with a new one
 
 Replacing of nodes is a combination of those instructions above.
@@ -357,16 +272,13 @@ Assume that there is a Droonga cluster constructed with two replica nodes `192.1
 ### Unjoin an existing replica from the cluster
 
 First, remove the unstable node.
-Remove the node from existing `catalog.json`, like:
-
-    (on 192.168.0.10, 192.168.0.11)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --remove-replica-hosts=192.168.0.11
+Remove the node from the cluster, like:
 
-After that the node `192.168.0.11` unjoins from the cluster successfully.
+    (on 192.168.0.10)
+    # droonga-engine-unjoin --base-path=~/droonga \
+                            --replica-remove-host=192.168.0.11
 
-Now there is a cluster without the node `192.168.0.11`.
+Now the node has been gone.
 You can confirm that via the `system.status` command:
 
 ~~~
@@ -383,42 +295,31 @@ You can confirm that via the `system.status` command:
 ### Add a new replica
 
 Next, setup the new replica.
-Construct a temporary cluster with only one node `192.168.0.12`.
-The result of the `system.status` command will be:
-
-~~~
-# curl "http://192.168.0.12:10041/droonga/system/status"
-{
-  "nodes": {
-    "192.168.0.12:10031/droonga": {
-      "live": true
-    }
-  }
-}
-~~~
-
-Then, duplicate data from the existing cluster:
+Install required packages and starts the server with the `catalog.json` copied from an existing node of the cluster.
 
     (on 192.168.0.12)
-    # scp 192.168.0.10:~/droonga/catalog.json ~/droonga/
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --hosts=192.168.0.12
-    # droonga-engine-absorb-data --source-host=192.168.0.10 \
-                                 --receiver-host=192.168.0.12
+    # cd ~/droonga
+    # scp 192.168.0.10:~/droonga/catalog.json ./
+    # host=192.168.0.12
+    # DROONGA_BASE_DIR=$PWD
+    # droonga-engine --host=$host \
+                     --log-file=$DROONGA_BASE_DIR/droonga-engine.log \
+                     --daemon \
+                     --pid-file=$DROONGA_BASE_DIR/droonga-engine.pid
+    # env NODE_ENV=production \
+        droonga-http-server --port=10041 \
+                            --receive-host-name=$host \
+                            --droonga-engine-host-name=$host \
+                            --cache-size=-1 \
+                            --daemon \
+                            --pid-file=$DROONGA_BASE_DIR/droonga-http-server.pid
 
-After the duplication successfully finished, the node is ready to join the cluster.
-Add other nodes to the `catalog.json`:
+Then, join the node to the cluster.
 
     (on 192.168.0.12)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --add-replica-hosts=192.168.0.10
-
-    (on 192.168.0.10)
-    # droonga-engine-catalog-modify --source=~/droonga/catalog.json \
-                                    --update \
-                                    --add-replica-hosts=192.168.0.12
+    # droonga-engine-join --base-path=~/droonga \
+                          --replica-source-host=192.168.0.10 \
+                          --my-host=192.168.0.12
 
 Finally a Droonga cluster constructed with two nodes `192.168.0.10` and `192.168.0.12` is here.
 
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る