YUKI Hiroshi
null+****@clear*****
Wed Nov 19 19:25:58 JST 2014
YUKI Hiroshi 2014-11-19 19:25:58 +0900 (Wed, 19 Nov 2014) New Revision: bd7b37d3ca2b13da01ea1b20d91955f2892d041a https://github.com/droonga/droonga.org/commit/bd7b37d3ca2b13da01ea1b20d91955f2892d041a Message: Update descriptions how to clear the cache Modified files: _po/ja/tutorial/1.0.8/add-replica/index.po _po/ja/tutorial/1.0.8/dump-restore/index.po ja/tutorial/1.0.8/add-replica/index.md ja/tutorial/1.0.8/dump-restore/index.md tutorial/1.0.8/add-replica/index.md tutorial/1.0.8/dump-restore/index.md Modified: _po/ja/tutorial/1.0.8/add-replica/index.po (+0 -3) =================================================================== --- _po/ja/tutorial/1.0.8/add-replica/index.po 2014-11-19 18:53:10 +0900 (baf9168) +++ _po/ja/tutorial/1.0.8/add-replica/index.po 2014-11-19 19:25:58 +0900 (88c54ee) @@ -502,9 +502,6 @@ msgid "" "~~~" msgstr "" -msgid "Refresh response caches:" -msgstr "レスポンスキャッシュを空にします:" - msgid "" "Now the node has been gone.\n" "You can confirm that via the `system.status` command:" Modified: _po/ja/tutorial/1.0.8/dump-restore/index.po (+34 -23) =================================================================== --- _po/ja/tutorial/1.0.8/dump-restore/index.po 2014-11-19 18:53:10 +0900 (e763fe1) +++ _po/ja/tutorial/1.0.8/dump-restore/index.po 2014-11-19 19:25:58 +0900 (8f0428c) @@ -267,8 +267,14 @@ msgid "" "~~~" msgstr "" -msgid "After that the cluster becomes empty. Confirm it:" -msgstr "これでクラスタは空になりました。確かめてみましょう:" +msgid "" +"After that the cluster becomes empty.\n" +"Let's confirm it.\n" +"You'll see empty result by `select` and `table_list` commands, like:" +msgstr "" +"これでクラスタは空になりました。\n" +"確かめてみましょう。\n" +"以下のように、`select`と`table_list`コマンドは空の結果を返します:" msgid "" "~~~\n" @@ -316,8 +322,9 @@ msgid "" " ]\n" " ]\n" "]\n" -"$ curl \"$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +" -"%s)\" | jq \".\"\n" +"$ curl -X DELETE \"$endpoint/cache\" | jq \".\"\n" +"true\n" +"$ curl \"$endpoint/d/select?table=Store&output_columns=name&limit=10\" | jq \".\"\n" "[\n" " [\n" " 0,\n" @@ -337,13 +344,15 @@ msgid "" msgstr "" msgid "" -"Note: you have to add an extra parameter `_=$(date +%s)` to bypass the respons" -"e cache.\n" -"If you forget to add it, you'll see unexpected cached result based on old conf" -"igurations." +"Note: before sending a request for the `select` command, clear the response ca" +"che.\n" +"Otherwise you'll see unexpected cached result based on old configurations.\n" +"You can clear all response caches by sending an HTTP `DELETE` request to the p" +"ath `/cache`, like above." msgstr "" -"注意: レスポンスキャッシュを無視するために、追加のパラメータとして `_=$(date +%s)` を加えていることに注意して下さい。\n" -"これを忘れると、古い設定に基づく異キャッシュされたレスポンス(期待に反した内容)を目にしてしまうことになるでしょう。" +"注意: `select`コマンド利にクエストを送る前に、まずキャッシュを削除しておいてください。\n" +"これを怠ると、古い情報に基づいて、キャッシュされた結果が意図せず返されてしまいます。\n" +"レスポンスキャッシュを削除するには、上記のように、`/cache`のパスの位置にHTTPの`DELETE`のリクエストを送信します。" msgid "### Restore data from a dump result, to an empty Droonga cluster" msgstr "### ダンプ結果から空のDroongaクラスタへデータを復元する" @@ -382,8 +391,9 @@ msgstr "これで、データが完全に復元されました。確かめてみ msgid "" "~~~\n" -"$ curl \"$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +" -"%s)\" | jq \".\"\n" +"$ curl -X DELETE \"$endpoint/cache\" | jq \".\"\n" +"true\n" +"$ curl \"$endpoint/d/select?table=Store&output_columns=name&limit=10\" | jq \".\"\n" "[\n" " [\n" " 0,\n" @@ -437,11 +447,6 @@ msgid "" "~~~" msgstr "" -msgid "" -"Note that adding an extra unique parameter for each request, to bypass old res" -"posne caches." -msgstr "古いレスポンスキャッシュを無視するために、各リクエストに追加の一意なパラメータを加えていることに注意して下さい。" - msgid "## Duplicate an existing Droonga cluster to another empty cluster directly" msgstr "## 既存のクラスタを別の空のクラスタに直接複製する" @@ -510,8 +515,10 @@ msgid "" " }\n" " }\n" "}\n" -"$ curl \"http://node0:10041/d/select?table=Store&output_columns=name&limit=10&_" -"=$(date +%s)\" | jq \".\"\n" +"$ curl -X DELETE \"http://node0:10041/cache\" | jq \".\"\n" +"true\n" +"$ curl \"http://node0:10041/d/select?table=Store&output_columns=name&limit=10\" " +"| jq \".\"\n" "[\n" " [\n" " 0,\n" @@ -570,8 +577,10 @@ msgid "" " }\n" " }\n" "}\n" -"$ curl \"http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_" -"=$(date +%s)\" | jq \".\"\n" +"$ curl -X DELETE \"http://node1:10041/cache\" | jq \".\"\n" +"true\n" +"$ curl \"http://node1:10041/d/select?table=Store&output_columns=name&limit=10\" " +"| jq \".\"\n" "[\n" " [\n" " 0,\n" @@ -626,8 +635,10 @@ msgstr "以上の操作で、2つのクラスタの内容が完全に同期さ msgid "" "~~~\n" -"$ curl \"http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_" -"=$(date +%s)\" | jq \".\"\n" +"$ curl -X DELETE \"http://node1:10041/cache\" | jq \".\"\n" +"true\n" +"$ curl \"http://node1:10041/d/select?table=Store&output_columns=name&limit=10\" " +"| jq \".\"\n" "[\n" " [\n" " 0,\n" Modified: ja/tutorial/1.0.8/add-replica/index.md (+0 -2) =================================================================== --- ja/tutorial/1.0.8/add-replica/index.md 2014-11-19 18:53:10 +0900 (413387c) +++ ja/tutorial/1.0.8/add-replica/index.md 2014-11-19 19:25:58 +0900 (d43d892) @@ -280,8 +280,6 @@ $ curl "http://node2:10041/droonga/system/status" | jq "." $ droonga-engine-unjoin --host=node1 ~~~ -レスポンスキャッシュを空にします: - これで、ノードがクラスタから離脱しました。この事は `system.status` コマンドで確かめられます: ~~~ Modified: ja/tutorial/1.0.8/dump-restore/index.md (+21 -16) =================================================================== --- ja/tutorial/1.0.8/dump-restore/index.md 2014-11-19 18:53:10 +0900 (91d10ee) +++ ja/tutorial/1.0.8/dump-restore/index.md 2014-11-19 19:25:58 +0900 (aadfc9a) @@ -173,7 +173,9 @@ $ curl "$endpoint/d/table_remove?name=Term" | jq "." ] ~~~ -これでクラスタは空になりました。確かめてみましょう: +これでクラスタは空になりました。 +確かめてみましょう。 +以下のように、`select`と`table_list`コマンドは空の結果を返します: ~~~ $ curl "$endpoint/d/table_list" | jq "." @@ -220,7 +222,9 @@ $ curl "$endpoint/d/table_list" | jq "." ] ] ] -$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "$endpoint/cache" | jq "." +true +$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -238,8 +242,9 @@ $ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s ] ~~~ -注意: レスポンスキャッシュを無視するために、追加のパラメータとして `_=$(date +%s)` を加えていることに注意して下さい。 -これを忘れると、古い設定に基づく異キャッシュされたレスポンス(期待に反した内容)を目にしてしまうことになるでしょう。 +注意: `select`コマンド利にクエストを送る前に、まずキャッシュを削除しておいてください。 +これを怠ると、古い情報に基づいて、キャッシュされた結果が意図せず返されてしまいます。 +レスポンスキャッシュを削除するには、上記のように、`/cache`のパスの位置にHTTPの`DELETE`のリクエストを送信します。 ### ダンプ結果から空のDroongaクラスタへデータを復元する @@ -260,7 +265,9 @@ $ droonga-send --server=node0 \ これで、データが完全に復元されました。確かめてみましょう: ~~~ -$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "$endpoint/cache" | jq "." +true +$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -313,8 +320,6 @@ $ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s ] ~~~ -古いレスポンスキャッシュを無視するために、各リクエストに追加の一意なパラメータを加えていることに注意して下さい。 - ## 既存のクラスタを別の空のクラスタに直接複製する 複数のDroongaクラスタが存在する場合、片方のクラスタの内容をもう片方のクラスタに複製することができます。 @@ -352,7 +357,9 @@ $ curl "http://node0:10041/droonga/system/status" | jq "." } } } -$ curl "http://node0:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node0:10041/cache" | jq "." +true +$ curl "http://node0:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -411,7 +418,9 @@ $ curl "http://node1:10041/droonga/system/status" | jq "." } } } -$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node1:10041/cache" | jq "." +true +$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -429,8 +438,6 @@ $ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$ ] ~~~ -古いレスポンスキャッシュを無視するために、各リクエストに追加の一意なパラメータを加えていることに注意して下さい。 - ### 2つのDroongaクラスタの間でデータを複製する @@ -454,7 +461,9 @@ Done. 以上の操作で、2つのクラスタの内容が完全に同期されました。確かめてみましょう: ~~~ -$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node1:10041/cache" | jq "." +true +$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -507,8 +516,6 @@ $ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$ ] ~~~ -古いレスポンスキャッシュを無視するために、各リクエストに追加の一意なパラメータを加えていることに注意して下さい。 - ### 2つのDroongaクラスタを結合する これらの2つのクラスタを結合するために、以下のコマンド列を実行しましょう: @@ -539,8 +546,6 @@ $ curl "http://node0:10041/droonga/system/status" | jq "." } ~~~ -古いレスポンスキャッシュを無視するために、各リクエストに追加の一意なパラメータを加えていることに注意して下さい。 - ## まとめ このチュートリアルでは、[Droonga][]クラスタのバックアップとデータの復元の方法を実践しました。 Modified: tutorial/1.0.8/add-replica/index.md (+0 -2) =================================================================== --- tutorial/1.0.8/add-replica/index.md 2014-11-19 18:53:10 +0900 (b5cc3da) +++ tutorial/1.0.8/add-replica/index.md 2014-11-19 19:25:58 +0900 (7433a61) @@ -273,8 +273,6 @@ Remove the node from the cluster, like: $ droonga-engine-unjoin --host=node1 ~~~ -Refresh response caches: - Now the node has been gone. You can confirm that via the `system.status` command: Modified: tutorial/1.0.8/dump-restore/index.md (+21 -16) =================================================================== --- tutorial/1.0.8/dump-restore/index.md 2014-11-19 18:53:10 +0900 (ad2a84a) +++ tutorial/1.0.8/dump-restore/index.md 2014-11-19 19:25:58 +0900 (8360d47) @@ -166,7 +166,9 @@ $ curl "$endpoint/d/table_remove?name=Term" | jq "." ] ~~~ -After that the cluster becomes empty. Confirm it: +After that the cluster becomes empty. +Let's confirm it. +You'll see empty result by `select` and `table_list` commands, like: ~~~ $ curl "$endpoint/d/table_list" | jq "." @@ -213,7 +215,9 @@ $ curl "$endpoint/d/table_list" | jq "." ] ] ] -$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "$endpoint/cache" | jq "." +true +$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -231,8 +235,9 @@ $ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s ] ~~~ -Note: you have to add an extra parameter `_=$(date +%s)` to bypass the response cache. -If you forget to add it, you'll see unexpected cached result based on old configurations. +Note: before sending a request for the `select` command, clear the response cache. +Otherwise you'll see unexpected cached result based on old configurations. +You can clear all response caches by sending an HTTP `DELETE` request to the path `/cache`, like above. ### Restore data from a dump result, to an empty Droonga cluster @@ -253,7 +258,9 @@ Note: Then the data is completely restored. Confirm it: ~~~ -$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "$endpoint/cache" | jq "." +true +$ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -306,8 +313,6 @@ $ curl "$endpoint/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s ] ~~~ -Note that adding an extra unique parameter for each request, to bypass old resposne caches. - ## Duplicate an existing Droonga cluster to another empty cluster directly If you have multiple Droonga clusters, then you can duplicate one to another. @@ -347,7 +352,9 @@ $ curl "http://node0:10041/droonga/system/status" | jq "." } } } -$ curl "http://node0:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node0:10041/cache" | jq "." +true +$ curl "http://node0:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -406,7 +413,9 @@ $ curl "http://node1:10041/droonga/system/status" | jq "." } } } -$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node1:10041/cache" | jq "." +true +$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -424,8 +433,6 @@ $ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$ ] ~~~ -Note that adding an extra unique parameter for each request, to bypass old resposne caches. - ### Duplicate data between two Droonga clusters @@ -449,7 +456,9 @@ Done. After that contents of these two clusters are completely synchronized. Confirm it: ~~~ -$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$(date +%s)" | jq "." +$ curl -X DELETE "http://node1:10041/cache" | jq "." +true +$ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10" | jq "." [ [ 0, @@ -502,8 +511,6 @@ $ curl "http://node1:10041/d/select?table=Store&output_columns=name&limit=10&_=$ ] ~~~ -Note that adding an extra unique parameter for each request, to bypass old resposne caches. - ### Unite two Droonga clusters Run following command lines to unite these two clusters: @@ -534,8 +541,6 @@ $ curl "http://node0:10041/droonga/system/status" | jq "." } ~~~ -Note that adding an extra unique parameter for each request, to bypass old resposne caches. - ## Conclusion In this tutorial, you did backup a [Droonga][] cluster and restore the data. -------------- next part -------------- HTML����������������������������... Download