YUKI Hiroshi
null+****@clear*****
Thu May 7 19:41:59 JST 2015
YUKI Hiroshi 2015-05-07 19:41:59 +0900 (Thu, 07 May 2015) New Revision: 708dfb205bf358abd9eb90d84456628d19e178ad https://github.com/droonga/droonga.org/commit/708dfb205bf358abd9eb90d84456628d19e178ad Message: Add reference for droonga-send Added files: _po/ja/reference/1.1.1/command-line-tools/droonga-send/index.po ja/reference/1.1.1/command-line-tools/droonga-send/index.md reference/1.1.1/command-line-tools/droonga-send/index.md Added: _po/ja/reference/1.1.1/command-line-tools/droonga-send/index.po (+496 -0) 100644 =================================================================== --- /dev/null +++ _po/ja/reference/1.1.1/command-line-tools/droonga-send/index.po 2015-05-07 19:41:59 +0900 (553997f) @@ -0,0 +1,496 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2014-11-30 23:19+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-send\n" +"layout: en\n" +"---" +msgstr "" +"---\n" +"title: droonga-send\n" +"layout: ja\n" +"---" + +msgid "" +"* TOC\n" +"{:toc}" +msgstr "" + +msgid "## Abstract {#abstract}" +msgstr "## 概要 {#abstract}" + +msgid "" +"`droonga-send` sends any message to a Droonga cluster, without waiting of resp" +"onses." +msgstr "`droonga-request`は、レスポンスを待たずに任意のメッセージをDroongaクラスタに送ります。" + +msgid "" +"This command supports both Droonga native protocol and HTTP.\n" +"For Droonga Engine nodes you can send a Droonga native message directly.\n" +"And, for HTTP protocol adapter nodes you can send HTTP requests also." +msgstr "" +"このコマンドはDroongaネイティブプロトコルとHTTPの両方に対応しています。\n" +"Droonga Engineノードに対しては、Droongaネイティブのメッセージを直接送れます。\n" + +msgid "" +"When you hope to get responses for requests, see also [descriptions of the `dr" +"oonga-request` command](../droonga-request/)." +msgstr "" +"リクエストに対するレスポンスを見る必要がある場合は、[`droonga-request`コマンドの説明](../droonga-request/)も併せて参" +"照して下さい。" + +msgid "## Usage {#usage}" +msgstr "## 使い方 {#usage}" + +msgid "### Basic usage" +msgstr "### 基本的な使い方" + +msgid "" +"For example, if there is a Droonga Engine node `192.168.100.50` and you are lo" +"gged in to a computer `192.168.100.10` in the same network segment, the comman" +"d line to send an [`add`](../../commands/add/) command is:" +msgstr "" +"例えば、`192.168.100.50`というDroonga Engineノードがあり、同一ネットワークセグメント内のコンピュータ`192.168.100." +"10`にログインしている場合、[`add`](../../commands/add/)コマンドのメッセージを送信するコマンド列は以下のようになります:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ echo '{\"type\":\"add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}}'" +" |\n" +" droonga-send --server droonga:192.168.100.50:10031/droonga\n" +"~~~" +msgstr "" + +msgid "" +"This command ordinarily reports nothing.\n" +"If you have to see requests are correctly processed or aren't, use [the `droon" +"ga-request` command](../droonga-request/) instead." +msgstr "" +"このコマンドは通常、何もメッセージを出力しません。\n" +"リクエストが正常に処理されたかどうかを知る必要がある場合には、代わりに[`droonga-request`コマンド](../droonga-request/" +")を使って下さい。" + +msgid "" +"As described at the [message format reference](../../message/), `id`, `date`, " +"and `dataset` are required fields of request messages.\n" +"If the given message doesn't have them, this command guesses or generates appl" +"icable values automatically by default.\n" +"You can see the completed message actually sent with the option `--report-requ" +"est`, like:" +msgstr "" +"[メッセージの形式のリファレンス](../../message/)の説明にある通り、`id`、`date`、`dataset`の各フィールドはリクエストメッ" +"セージの必須フィールドです。\n" +"与えられたメッセージがそれらを持っていなかった場合、このコマンドは初期状態で、適切な値を推測または生成して補います。\n" +"実際に送信された補完後のメッセージを見るには、`--report-request`オプションを指定して下さい:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ echo '{\"type\":\"add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}}'" +" |\n" +" droonga-send --server droonga:192.168.100.50:10031/droonga --report-reques" +"t\n" +"Request: {\n" +" \"type\": \"add\",\n" +" \"body\": {\n" +" \"key\": \"id1\",\n" +" \"values\": {\n" +" \"name\": \"Adam\",\n" +" \"age\": 20\n" +" }\n" +" },\n" +" \"id\": \"1430990130.1114423\",\n" +" \"date\": \"2015-05-07T09:15:30.111467Z\",\n" +" \"dataset\": \"Default\"\n" +"}\n" +"~~~" +msgstr "" + +msgid "" +"For the complete list of available commands, see also [the command reference](" +"../../commands/)." +msgstr "利用可能な全てのコマンドの一覧については、[コマンドリファレンス](../../commands/)を併せて参照して下さい。" + +msgid "### Combination with other commands" +msgstr "### 他のコマンドとの連携" + +msgid "" +"This command accepts messages to be sent via standard input.\n" +"As above, `echo`, `cat`, or any other command can be the source for this comma" +"nd.\n" +"For example, you'll be able to use [`drndump`](../drndump/)'s output as the so" +"urce:" +msgstr "" +"このメッセージは標準入力を通じて送信するメッセージを受け取れます。\n" +"上記の例のように、`echo`、`cat`、およびその他のコマンドをこのコマンドのための入力ソースとして利用できます。\n" +"例えば、[`drndump`](../drndump/)の出力もそのまま入力ソースとして利用できます:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ drndump --host 192.168.100.50 --receiver-host 192.168.100.10 | \\\n" +" droonga-send --server droonga:192.168.100.50:10031/droonga\n" +"~~~" +msgstr "" + +msgid "### Input from file" +msgstr "### ファイルからの入力" + +msgid "" +"You can use a text file as the source.\n" +"This command reads the file specified as an command line argument, like:" +msgstr "" +"テキストファイルを入力ソースとして使うこともできます。\n" +"このコマンドは以下のように、コマンドライン引数として指定されたファイルの内容を読み込んで利用します:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ cat /tmp/message.json\n" +"{\"type\":\"system.status\"}\n" +"$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/message.json" +"\n" +"~~~" +msgstr "" + +msgid "### Sending multiple messages at once" +msgstr "### 複数のメッセージを一度に送る" + +msgid "" +"This command can send multiple messages at once.\n" +"To do it, you simply give multiple messages as the input, like:" +msgstr "" +"このコマンドは複数のメッセージを一度に送る事もできます。\n" +"複数メッセージの一括送信は、単に、複数のメッセージを入力として与えるだけで行えます:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ echo '{\"type\":\"add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}} " +"{\"type\":\"add\",\"body\":{\"key\":\"id2\",\"values\":{\"name\":\"Becky\",\"age\":30}}}' |\n" +" droonga-send --server droonga:192.168.100.50:10031/droonga\n" +"~~~" +msgstr "" + +msgid "Of course, you can include multiple messages to the source file like:" +msgstr "もちろん、以下のようにしてソースファイル内に複数のメッセージを含めることもできます:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ cat /tmp/messages.jsons\n" +"{\"type\":\"add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}}\n" +"{\"type\":\"add\",\"body\":{\"key\":\"id2\",\"values\":{\"name\":\"Becky\",\"age\":30}}}\n" +"$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/messages.jso" +"ns\n" +"~~~" +msgstr "" + +msgid "" +"To simulate a round-robbin type load balancer for too much messages, you can s" +"pecify multiple `--server` options for multiple endpoints, like:" +msgstr "" +"非常に多くのメッセージに対して、ラウンドロビン型のロードバランサーの挙動を再現するために、`--server`オプションを複数回使って複数のエンドポイントを" +"指定することもできます:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ droonga-send --server droonga:192.168.100.50:10031/droonga \\\n" +" --server droonga:192.168.100.51:10031/droonga \\\n" +" --server droonga:192.168.100.52:10031/droonga \\\n" +" /tmp/messages.jsons\n" +"~~~" +msgstr "" + +msgid "Then messages are scattered to all endpoints parallelly." +msgstr "この時、メッセージは各エンドポイントに並行してばらまかれます。" + +msgid "" +"You can simulate overloaded too much requests with `--messages-per-second` opt" +"ion, like:" +msgstr "過負荷の状態を再現するには、以下のように`--messages-per-second`オプションを指定します:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ droonga-send --server droonga:192.168.100.50:10031/droonga \\\n" +" --server droonga:192.168.100.51:10031/droonga \\\n" +" --server droonga:192.168.100.52:10031/droonga \\\n" +" --messages-per-second=1000 \\\n" +" /tmp/messages.jsons\n" +"~~~" +msgstr "" + +msgid "" +"It is `100` by default but you can enlarge the limitation, if your computer is" +" powerful enough to do it.\n" +"The limitation is applied for each endpoint, so your clsuter will receive 3000" +" or less messages per second, with the example above." +msgstr "" +"このオプションの既定値は`100`ですが、コマンドを実行しているコンピュータの性能が十分に高ければ、制限を緩和することができます。\n" +"このオプションによる制限値は各エンドポイントごとに適用されるため、この例の場合、クラスタは最大で毎秒3000件のメッセージを受け取ることになります。" + +msgid "### Communication with the Droonga cluster in HTTP" +msgstr "### DroongaクラスタとHTTPで通信する" + +msgid "" +"This command can communicate not only with Droonga Engine nodes but with HTTP " +"protocol adapters, like:" +msgstr "このコマンドはDroonga Engineとの接続だけでなく、以下のようにしてHTTPプロトコルアダプターとも通信できます:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ echo '{\"type\":\"add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}}'" +" |\n" +" droonga-send --server http:192.168.100.50:10041 --report-request\n" +"Request: {\n" +" \"method\": \"GET\",\n" +" \"path\": \"/droonga/add?key=id1&values[name]=Adam&values[age]=20\",\n" +" \"headers\": {\n" +" \"Accept\": \"*/*\",\n" +" \"User-Agent\": \"Ruby\"\n" +" },\n" +" \"body\": null\n" +"}\n" +"~~~" +msgstr "" + +msgid "For HTTP protocol adapters, there are some differences:" +msgstr "HTTPプロトコルアダプタに接続する場合は、使い方が若干変わります:" + +msgid "" +" * You have to specify `http:` protocol and correct port number of the HTTP pr" +"otocol adapter via the `--server` option's value.\n" +" The port number is `10031` by default for Droonga Engine nodes, but HTTP pr" +"otocol adapters ordinarily listen with the port `10041`." +msgstr "" +" * `--server`オプションにおいて、プロトコルとして`http:`を指定し、HTTPプロトコルアダプター用に正しいポート番号を指定する必要がありま" +"す。\n" +" ポート番号は既定の状態ではDroonga Engineノード用に`10031`になっていますが、通常、HTTPプロトコルアダプターは`10041`番ポ" +"ートを使います。" + +msgid "" +"In this case you can use HTTP specific request message as the input.\n" +"Regular Droonga native protocol messages are automatically converted to HTTP r" +"equest messages like above." +msgstr "" +"この利用形態においては、HTTP用のリクエストメッセージを入力として与えることができます。\n" +"通常のDroongaネイティブプロトコルのメッセージは、上記の例のように自動的にHTTP用のリクエストメッセージに変換されます。" + +msgid "" +"You can use such custom HTTP request messages as the input.\n" +"This is an example to send HTTP POST request with a custom user agent string:" +msgstr "" +"同様の体裁で、独自のHTTPリクエストメッセージを入力として与えることもできます。\n" +"以下は、POSTメソッドで、独自のユーザーエージェント文字列を伴ったPOSTメソッドのHTTPリクエストを送信する例です:" + +msgid "" +"~~~\n" +"(on 192.168.100.10)\n" +"$ echo '{\"method\":\"POST\",\"headers\":{\"User-Agent\":\"Droonga Client\"},\"path\":\"/dr" +"oonga/add\",\"body\":{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}}' |\n" +" droonga-send --server http:192.168.100.50:10041 --report-request\n" +"Request: {\n" +" \"method\": \"POST\",\n" +" \"path\": \"/droonga/add\",\n" +" \"headers\": {\n" +" \"User-Agent\": \"Droonga Client\",\n" +" \"Accept\": \"*/*\"\n" +" },\n" +" \"body\": \"{\\\"key\\\":\\\"id1\\\",\\\"values\\\":{\\\"name\\\":\\\"Adam\\\",\\\"age\\\":20}}\"\n" +"}\n" +"~~~" +msgstr "" + +msgid "## Parameters {#parameters}" +msgstr "## パラメータ {#parameters}" + +msgid "" +"`--server=PROTOCOL:HOST:PORT/TAG`\n" +": Protocol, host name, port number, and tag name to communicate with the endpo" +"int of the Droonga cluster.\n" +" You can specify this option multiple times.\n" +" There is only one definition `(default protocol given via --default-protocol" +" option):(a guessed host name of the computer you are running the command):(de" +"fault port number given via --default-port option)/(default tag name given via" +" --default-tag option)`, by default." +msgstr "" +"`--server=PROTOCOL:HOST:PORT/TAG`\n" +": Droongaクラスタの接続先として使うプロトコル、ホスト名、ポート番号、タグ名。\n" +" このオプションは複数回指定できます。\n" +" 既定の状態では、`(--default-protocolによる既定のプロトコル):(このコマンドを実行しているコンピュータの推測された名前):(--de" +"fault-portによる既定のポート番号)/(--default-tagによる既定のタグ名)`, by default." + +msgid "" +"`--messages-per-second=N`\n" +": Maximum number of messages to be sent in a second.\n" +" `-1` means \"no limit\".\n" +" `100` by default." +msgstr "" +"`--messages-per-second=N`\n" +": 1秒間に送るメッセージの最大数。\n" +" `-1`を指定した場合、\"無制限\"を意味します。\n" +" 既定値は`100`です。" + +msgid "" +"`--default-protocol=PROTOCOL`\n" +": Default protocol to communicate with the endpoint of the Droonga cluster.\n" +" Possible values:" +msgstr "" +"`--default-protocol=PROTOCOL`\n" +": Droongaクラスタの接続先との通信に使う既定のプロトコル。\n" +" 取り得る値は以下の通りです:" + +msgid "" +" * `droonga` (default): the native protocol of Droonga Engine nodes.\n" +" * `http`: for HTTP protocol adapters." +msgstr "" +" * `droonga` (既定値): Droonga Engineノードのネイティブプロトコル。\n" +" * `http`: HTTP。" + +msgid "" +"`--default-port=PORT`\n" +": Default protocol number to communicate with the endpoint of the Droonga clus" +"ter.\n" +" `10031` by default." +msgstr "" +"`--default-port=PORT`\n" +": Droongaクラスタの接続先との通信に使う既定のポート番号。\n" +" 既定値は`10031`です。" + +msgid "" +"`--default-tag=TAG`\n" +": Default tag name to communicate with the endpoint of the Droonga cluster.\n" +" `droonga` by default." +msgstr "" +"`--default-tag=TAG`\n" +": Droongaクラスタの接続先との通信に使う既定のタグ名。\n" +" 既定値は`droonga`です。" + +msgid "" +"`--[no-]report-request`\n" +": Reports request messages actually sent or don't.\n" +" `--no-report-request` is given by default.\n" +" To report actually sent messages, you have to specify the option `--report-r" +"equest` manually." +msgstr "" +"`--[no-]report-request`\n" +": 実際に送信されたリクエストのメッセージを報告するかどうか。\n" +" 既定の状態は、`--no-report-request`が指定されている場合に等しいです。\n" +" 実際に送られたメッセージを見るためには、`--report-request`オプションを手動で指定する必要があります。" + +msgid "" +"`--[no-]report-throughput`\n" +": Reports throughput by messages per second or don't.\n" +" `--no-report-throughput` is given by default.\n" +" To report throughput, you have to specify the option `--report-throughput` m" +"anually." +msgstr "" +"`--[no-]report-throughput`\n" +": 1秒あたりのメッセージのスループットを報告するかどうか。\n" +" 既定の状態は、`--no-report-throughput`が指定されている場合に等しいです。\n" +" スループットを報告するには、`--report-throughput`オプションを手動で指定する必要があります。" + +msgid "" +"`--default-dataset=NAME`\n" +": Default dataset name for sending messages.\n" +" `Default` by default." +msgstr "" +"`--default-dataset=NAME`\n" +": メッセージの既定の送信先データセット名。\n" +" 既定値は`Default`です。" + +msgid "" +"`--default-target-role=ROLE`\n" +": Default role of engine nodes which should process messages.\n" +" Possible values:" +msgstr "" +"`--default-target-role=ROLE`\n" +": メッセージを処理できるEngineノードの既定のロール。\n" +" 以下のいずれかを指定します:" + +msgid "" +" * `service-provider`:\n" +" The message is processed by service provider nodes in the cluster.\n" +" For absorb-source nodes and absrob-destination nodes, the message will be " +"dispatched later.\n" +" * `absorb-source`:\n" +" The message is processed by absorb-source nodes in the cluster.\n" +" For service provider nodes and absrob-destination nodes, the message is ne" +"ver dispatched.\n" +" * `absorb-destination`:\n" +" The message is processed by absorb-destination nodes in the cluster.\n" +" For service provider nodes and absrob-source nodes, the message is never d" +"ispatched.\n" +" * `any`:\n" +" The message is always processed by the node specified via the option `--ho" +"st`." +msgstr "" +" * `service-provider`:\n" +" メッセージは、クラスタ内でサービスを提供中のノードで処理されます。\n" +" データ抽出操作に関わるノードには、後から遅れてメッセージが伝搬します。\n" +" * `absorb-source`:\n" +" メッセージは、クラスタへのノード追加操作におけるデータコピー元となっているノードで処理されます。\n" +" サービスを提供中のノード、並びにデータコピー先となっているノードへは、メッセージは伝搬しません。\n" +" * `absorb-destination`:\n" +" メッセージは、クラスタへのノード追加操作におけるデータコピー先となっているノードで処理されます。\n" +" サービスを提供中のノード、並びにデータコピー元となっているノードへは、メッセージは伝搬しません。\n" +" * `any`:\n" +" メッセージは、`--host`で指定されたノードで処理されます。" + +msgid " `any` by default." +msgstr " 既定値は`any`です。" + +msgid "" +"`--[no-]completion`\n" +": Do completion of required fields for input messages or not.\n" +" `--completion` is given by default.\n" +" To send broken message (missing any required field) intentionally, you have " +"to specify the option `--no-completion` manually." +msgstr "" +"`--[no-]completion`\n" +": 入力メッセージの必須フィールドを補完するかどうか。\n" +" 既定の状態は、`--completion`が指定されている場合に等しいです。\n" +" (既定のフィールドが欠落した)壊れたメッセージを意図的に送りたい場合は、`--no-completion`オプションを手動で指定する必要があります。" + +msgid "" +"`--[no-]validation`\n" +": Do validation for input messages or not.\n" +" `--validation` is given by default.\n" +" To send invalid message intentionally, you have to specify the option `--no-" +"validation` manually." +msgstr "" +"`--[no-]validation`\n" +": 入力メッセージの妥当性を検証するかどうか。\n" +" 既定の状態は、`--validation`が指定されている場合に等しいです。\n" +" 妥当でない内容のメッセージを意図的に送りたい場合は、`--no-validation`オプションを手動で指定する必要があります。" + +msgid "" +"`--help`\n" +": Shows the usage of the command." +msgstr "" +"`--help`\n" +": コマンドの使い方の説明を表示します。" + +msgid "## How to install {#install}" +msgstr "## インストール方法 {#install}" + +msgid "This is installed as a part of a rubygems package `droonga-client`." +msgstr "このコマンドは、Rubygemsのパッケージ`droonga-client`の一部としてインストールされます。" + +msgid "" +"~~~\n" +"# gem install droonga-client\n" +"~~~" +msgstr "" Added: ja/reference/1.1.1/command-line-tools/droonga-send/index.md (+268 -0) 100644 =================================================================== --- /dev/null +++ ja/reference/1.1.1/command-line-tools/droonga-send/index.md 2015-05-07 19:41:59 +0900 (e727c0b) @@ -0,0 +1,268 @@ +--- +title: droonga-send +layout: ja +--- + +{% comment %} +############################################## + THIS FILE IS AUTOMATICALLY GENERATED FROM + "_po/ja/reference/1.1.1/command-line-tools/droonga-send/index.po" + DO NOT EDIT THIS FILE MANUALLY! +############################################## +{% endcomment %} + + +* TOC +{:toc} + +## 概要 {#abstract} + +`droonga-request`は、レスポンスを待たずに任意のメッセージをDroongaクラスタに送ります。 + +このコマンドはDroongaネイティブプロトコルとHTTPの両方に対応しています。 +Droonga Engineノードに対しては、Droongaネイティブのメッセージを直接送れます。 + + +リクエストに対するレスポンスを見る必要がある場合は、[`droonga-request`コマンドの説明](../droonga-request/)も併せて参照して下さい。 + +## 使い方 {#usage} + +### 基本的な使い方 + +例えば、`192.168.100.50`というDroonga Engineノードがあり、同一ネットワークセグメント内のコンピュータ`192.168.100.10`にログインしている場合、[`add`](../../commands/add/)コマンドのメッセージを送信するコマンド列は以下のようになります: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +このコマンドは通常、何もメッセージを出力しません。 +リクエストが正常に処理されたかどうかを知る必要がある場合には、代わりに[`droonga-request`コマンド](../droonga-request/)を使って下さい。 + +[メッセージの形式のリファレンス](../../message/)の説明にある通り、`id`、`date`、`dataset`の各フィールドはリクエストメッセージの必須フィールドです。 +与えられたメッセージがそれらを持っていなかった場合、このコマンドは初期状態で、適切な値を推測または生成して補います。 +実際に送信された補完後のメッセージを見るには、`--report-request`オプションを指定して下さい: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga --report-request +Request: { + "type": "add", + "body": { + "key": "id1", + "values": { + "name": "Adam", + "age": 20 + } + }, + "id": "1430990130.1114423", + "date": "2015-05-07T09:15:30.111467Z", + "dataset": "Default" +} +~~~ + +利用可能な全てのコマンドの一覧については、[コマンドリファレンス](../../commands/)を併せて参照して下さい。 + +### 他のコマンドとの連携 + +このメッセージは標準入力を通じて送信するメッセージを受け取れます。 +上記の例のように、`echo`、`cat`、およびその他のコマンドをこのコマンドのための入力ソースとして利用できます。 +例えば、[`drndump`](../drndump/)の出力もそのまま入力ソースとして利用できます: + +~~~ +(on 192.168.100.10) +$ drndump --host 192.168.100.50 --receiver-host 192.168.100.10 | \ + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +### ファイルからの入力 + +テキストファイルを入力ソースとして使うこともできます。 +このコマンドは以下のように、コマンドライン引数として指定されたファイルの内容を読み込んで利用します: + +~~~ +(on 192.168.100.10) +$ cat /tmp/message.json +{"type":"system.status"} +$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/message.json +~~~ + +### 複数のメッセージを一度に送る + +このコマンドは複数のメッセージを一度に送る事もできます。 +複数メッセージの一括送信は、単に、複数のメッセージを入力として与えるだけで行えます: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}} {"type":"add","body":{"key":"id2","values":{"name":"Becky","age":30}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +もちろん、以下のようにしてソースファイル内に複数のメッセージを含めることもできます: + +~~~ +(on 192.168.100.10) +$ cat /tmp/messages.jsons +{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}} +{"type":"add","body":{"key":"id2","values":{"name":"Becky","age":30}}} +$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/messages.jsons +~~~ + +非常に多くのメッセージに対して、ラウンドロビン型のロードバランサーの挙動を再現するために、`--server`オプションを複数回使って複数のエンドポイントを指定することもできます: + +~~~ +(on 192.168.100.10) +$ droonga-send --server droonga:192.168.100.50:10031/droonga \ + --server droonga:192.168.100.51:10031/droonga \ + --server droonga:192.168.100.52:10031/droonga \ + /tmp/messages.jsons +~~~ + +この時、メッセージは各エンドポイントに並行してばらまかれます。 + +過負荷の状態を再現するには、以下のように`--messages-per-second`オプションを指定します: + +~~~ +(on 192.168.100.10) +$ droonga-send --server droonga:192.168.100.50:10031/droonga \ + --server droonga:192.168.100.51:10031/droonga \ + --server droonga:192.168.100.52:10031/droonga \ + --messages-per-second=1000 \ + /tmp/messages.jsons +~~~ + +このオプションの既定値は`100`ですが、コマンドを実行しているコンピュータの性能が十分に高ければ、制限を緩和することができます。 +このオプションによる制限値は各エンドポイントごとに適用されるため、この例の場合、クラスタは最大で毎秒3000件のメッセージを受け取ることになります。 + + +### DroongaクラスタとHTTPで通信する + +このコマンドはDroonga Engineとの接続だけでなく、以下のようにしてHTTPプロトコルアダプターとも通信できます: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server http:192.168.100.50:10041 --report-request +Request: { + "method": "GET", + "path": "/droonga/add?key=id1&values[name]=Adam&values[age]=20", + "headers": { + "Accept": "*/*", + "User-Agent": "Ruby" + }, + "body": null +} +~~~ + +HTTPプロトコルアダプタに接続する場合は、使い方が若干変わります: + + * `--server`オプションにおいて、プロトコルとして`http:`を指定し、HTTPプロトコルアダプター用に正しいポート番号を指定する必要があります。 + ポート番号は既定の状態ではDroonga Engineノード用に`10031`になっていますが、通常、HTTPプロトコルアダプターは`10041`番ポートを使います。 + +この利用形態においては、HTTP用のリクエストメッセージを入力として与えることができます。 +通常のDroongaネイティブプロトコルのメッセージは、上記の例のように自動的にHTTP用のリクエストメッセージに変換されます。 + +同様の体裁で、独自のHTTPリクエストメッセージを入力として与えることもできます。 +以下は、POSTメソッドで、独自のユーザーエージェント文字列を伴ったPOSTメソッドのHTTPリクエストを送信する例です: + +~~~ +(on 192.168.100.10) +$ echo '{"method":"POST","headers":{"User-Agent":"Droonga Client"},"path":"/droonga/add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server http:192.168.100.50:10041 --report-request +Request: { + "method": "POST", + "path": "/droonga/add", + "headers": { + "User-Agent": "Droonga Client", + "Accept": "*/*" + }, + "body": "{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}" +} +~~~ + + +## パラメータ {#parameters} + + +`--server=PROTOCOL:HOST:PORT/TAG` +: Droongaクラスタの接続先として使うプロトコル、ホスト名、ポート番号、タグ名。 + このオプションは複数回指定できます。 + 既定の状態では、`(--default-protocolによる既定のプロトコル):(このコマンドを実行しているコンピュータの推測された名前):(--default-portによる既定のポート番号)/(--default-tagによる既定のタグ名)`, by default. + +`--messages-per-second=N` +: 1秒間に送るメッセージの最大数。 + `-1`を指定した場合、"無制限"を意味します。 + 既定値は`100`です。 + +`--default-protocol=PROTOCOL` +: Droongaクラスタの接続先との通信に使う既定のプロトコル。 + 取り得る値は以下の通りです: + + * `droonga` (既定値): Droonga Engineノードのネイティブプロトコル。 + * `http`: HTTP。 + +`--default-port=PORT` +: Droongaクラスタの接続先との通信に使う既定のポート番号。 + 既定値は`10031`です。 + +`--default-tag=TAG` +: Droongaクラスタの接続先との通信に使う既定のタグ名。 + 既定値は`droonga`です。 + +`--[no-]report-request` +: 実際に送信されたリクエストのメッセージを報告するかどうか。 + 既定の状態は、`--no-report-request`が指定されている場合に等しいです。 + 実際に送られたメッセージを見るためには、`--report-request`オプションを手動で指定する必要があります。 + +`--[no-]report-throughput` +: 1秒あたりのメッセージのスループットを報告するかどうか。 + 既定の状態は、`--no-report-throughput`が指定されている場合に等しいです。 + スループットを報告するには、`--report-throughput`オプションを手動で指定する必要があります。 + +`--default-dataset=NAME` +: メッセージの既定の送信先データセット名。 + 既定値は`Default`です。 + +`--default-target-role=ROLE` +: メッセージを処理できるEngineノードの既定のロール。 + 以下のいずれかを指定します: + + * `service-provider`: + メッセージは、クラスタ内でサービスを提供中のノードで処理されます。 + データ抽出操作に関わるノードには、後から遅れてメッセージが伝搬します。 + * `absorb-source`: + メッセージは、クラスタへのノード追加操作におけるデータコピー元となっているノードで処理されます。 + サービスを提供中のノード、並びにデータコピー先となっているノードへは、メッセージは伝搬しません。 + * `absorb-destination`: + メッセージは、クラスタへのノード追加操作におけるデータコピー先となっているノードで処理されます。 + サービスを提供中のノード、並びにデータコピー元となっているノードへは、メッセージは伝搬しません。 + * `any`: + メッセージは、`--host`で指定されたノードで処理されます。 + + 既定値は`any`です。 + +`--[no-]completion` +: 入力メッセージの必須フィールドを補完するかどうか。 + 既定の状態は、`--completion`が指定されている場合に等しいです。 + (既定のフィールドが欠落した)壊れたメッセージを意図的に送りたい場合は、`--no-completion`オプションを手動で指定する必要があります。 + +`--[no-]validation` +: 入力メッセージの妥当性を検証するかどうか。 + 既定の状態は、`--validation`が指定されている場合に等しいです。 + 妥当でない内容のメッセージを意図的に送りたい場合は、`--no-validation`オプションを手動で指定する必要があります。 + +`--help` +: コマンドの使い方の説明を表示します。 + + + +## インストール方法 {#install} + +このコマンドは、Rubygemsのパッケージ`droonga-client`の一部としてインストールされます。 + +~~~ +# gem install droonga-client +~~~ + Added: reference/1.1.1/command-line-tools/droonga-send/index.md (+259 -0) 100644 =================================================================== --- /dev/null +++ reference/1.1.1/command-line-tools/droonga-send/index.md 2015-05-07 19:41:59 +0900 (4b4f7f8) @@ -0,0 +1,259 @@ +--- +title: droonga-send +layout: en +--- + +* TOC +{:toc} + +## Abstract {#abstract} + +`droonga-send` sends any message to a Droonga cluster, without waiting of responses. + +This command supports both Droonga native protocol and HTTP. +For Droonga Engine nodes you can send a Droonga native message directly. +And, for HTTP protocol adapter nodes you can send HTTP requests also. + +When you hope to get responses for requests, see also [descriptions of the `droonga-request` command](../droonga-request/). + +## Usage {#usage} + +### Basic usage + +For example, if there is a Droonga Engine node `192.168.100.50` and you are logged in to a computer `192.168.100.10` in the same network segment, the command line to send an [`add`](../../commands/add/) command is: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +This command ordinarily reports nothing. +If you have to see requests are correctly processed or aren't, use [the `droonga-request` command](../droonga-request/) instead. + +As described at the [message format reference](../../message/), `id`, `date`, and `dataset` are required fields of request messages. +If the given message doesn't have them, this command guesses or generates applicable values automatically by default. +You can see the completed message actually sent with the option `--report-request`, like: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga --report-request +Request: { + "type": "add", + "body": { + "key": "id1", + "values": { + "name": "Adam", + "age": 20 + } + }, + "id": "1430990130.1114423", + "date": "2015-05-07T09:15:30.111467Z", + "dataset": "Default" +} +~~~ + +For the complete list of available commands, see also [the command reference](../../commands/). + +### Combination with other commands + +This command accepts messages to be sent via standard input. +As above, `echo`, `cat`, or any other command can be the source for this command. +For example, you'll be able to use [`drndump`](../drndump/)'s output as the source: + +~~~ +(on 192.168.100.10) +$ drndump --host 192.168.100.50 --receiver-host 192.168.100.10 | \ + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +### Input from file + +You can use a text file as the source. +This command reads the file specified as an command line argument, like: + +~~~ +(on 192.168.100.10) +$ cat /tmp/message.json +{"type":"system.status"} +$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/message.json +~~~ + +### Sending multiple messages at once + +This command can send multiple messages at once. +To do it, you simply give multiple messages as the input, like: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}} {"type":"add","body":{"key":"id2","values":{"name":"Becky","age":30}}}' | + droonga-send --server droonga:192.168.100.50:10031/droonga +~~~ + +Of course, you can include multiple messages to the source file like: + +~~~ +(on 192.168.100.10) +$ cat /tmp/messages.jsons +{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}} +{"type":"add","body":{"key":"id2","values":{"name":"Becky","age":30}}} +$ droonga-send --server droonga:192.168.100.50:10031/droonga /tmp/messages.jsons +~~~ + +To simulate a round-robbin type load balancer for too much messages, you can specify multiple `--server` options for multiple endpoints, like: + +~~~ +(on 192.168.100.10) +$ droonga-send --server droonga:192.168.100.50:10031/droonga \ + --server droonga:192.168.100.51:10031/droonga \ + --server droonga:192.168.100.52:10031/droonga \ + /tmp/messages.jsons +~~~ + +Then messages are scattered to all endpoints parallelly. + +You can simulate overloaded too much requests with `--messages-per-second` option, like: + +~~~ +(on 192.168.100.10) +$ droonga-send --server droonga:192.168.100.50:10031/droonga \ + --server droonga:192.168.100.51:10031/droonga \ + --server droonga:192.168.100.52:10031/droonga \ + --messages-per-second=1000 \ + /tmp/messages.jsons +~~~ + +It is `100` by default but you can enlarge the limitation, if your computer is powerful enough to do it. +The limitation is applied for each endpoint, so your clsuter will receive 3000 or less messages per second, with the example above. + + +### Communication with the Droonga cluster in HTTP + +This command can communicate not only with Droonga Engine nodes but with HTTP protocol adapters, like: + +~~~ +(on 192.168.100.10) +$ echo '{"type":"add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server http:192.168.100.50:10041 --report-request +Request: { + "method": "GET", + "path": "/droonga/add?key=id1&values[name]=Adam&values[age]=20", + "headers": { + "Accept": "*/*", + "User-Agent": "Ruby" + }, + "body": null +} +~~~ + +For HTTP protocol adapters, there are some differences: + + * You have to specify `http:` protocol and correct port number of the HTTP protocol adapter via the `--server` option's value. + The port number is `10031` by default for Droonga Engine nodes, but HTTP protocol adapters ordinarily listen with the port `10041`. + +In this case you can use HTTP specific request message as the input. +Regular Droonga native protocol messages are automatically converted to HTTP request messages like above. + +You can use such custom HTTP request messages as the input. +This is an example to send HTTP POST request with a custom user agent string: + +~~~ +(on 192.168.100.10) +$ echo '{"method":"POST","headers":{"User-Agent":"Droonga Client"},"path":"/droonga/add","body":{"key":"id1","values":{"name":"Adam","age":20}}}' | + droonga-send --server http:192.168.100.50:10041 --report-request +Request: { + "method": "POST", + "path": "/droonga/add", + "headers": { + "User-Agent": "Droonga Client", + "Accept": "*/*" + }, + "body": "{\"key\":\"id1\",\"values\":{\"name\":\"Adam\",\"age\":20}}" +} +~~~ + + +## Parameters {#parameters} + + +`--server=PROTOCOL:HOST:PORT/TAG` +: Protocol, host name, port number, and tag name to communicate with the endpoint of the Droonga cluster. + You can specify this option multiple times. + There is only one definition `(default protocol given via --default-protocol option):(a guessed host name of the computer you are running the command):(default port number given via --default-port option)/(default tag name given via --default-tag option)`, by default. + +`--messages-per-second=N` +: Maximum number of messages to be sent in a second. + `-1` means "no limit". + `100` by default. + +`--default-protocol=PROTOCOL` +: Default protocol to communicate with the endpoint of the Droonga cluster. + Possible values: + + * `droonga` (default): the native protocol of Droonga Engine nodes. + * `http`: for HTTP protocol adapters. + +`--default-port=PORT` +: Default protocol number to communicate with the endpoint of the Droonga cluster. + `10031` by default. + +`--default-tag=TAG` +: Default tag name to communicate with the endpoint of the Droonga cluster. + `droonga` by default. + +`--[no-]report-request` +: Reports request messages actually sent or don't. + `--no-report-request` is given by default. + To report actually sent messages, you have to specify the option `--report-request` manually. + +`--[no-]report-throughput` +: Reports throughput by messages per second or don't. + `--no-report-throughput` is given by default. + To report throughput, you have to specify the option `--report-throughput` manually. + +`--default-dataset=NAME` +: Default dataset name for sending messages. + `Default` by default. + +`--default-target-role=ROLE` +: Default role of engine nodes which should process messages. + Possible values: + + * `service-provider`: + The message is processed by service provider nodes in the cluster. + For absorb-source nodes and absrob-destination nodes, the message will be dispatched later. + * `absorb-source`: + The message is processed by absorb-source nodes in the cluster. + For service provider nodes and absrob-destination nodes, the message is never dispatched. + * `absorb-destination`: + The message is processed by absorb-destination nodes in the cluster. + For service provider nodes and absrob-source nodes, the message is never dispatched. + * `any`: + The message is always processed by the node specified via the option `--host`. + + `any` by default. + +`--[no-]completion` +: Do completion of required fields for input messages or not. + `--completion` is given by default. + To send broken message (missing any required field) intentionally, you have to specify the option `--no-completion` manually. + +`--[no-]validation` +: Do validation for input messages or not. + `--validation` is given by default. + To send invalid message intentionally, you have to specify the option `--no-validation` manually. + +`--help` +: Shows the usage of the command. + + + +## How to install {#install} + +This is installed as a part of a rubygems package `droonga-client`. + +~~~ +# gem install droonga-client +~~~ + -------------- next part -------------- HTML����������������������������...Download