Skip to content

Useful commands for debugging

piroor edited this page Nov 30, 2014 · 5 revisions

Serfクラスタの様子を見る

$ sudo -u droonga-engine -H /home/droonga-engine/droonga/serf members -rpc-addr node0:7373
node0/protocol-adapter  192.168.100.50:8946  alive  role=protocol-adapter
node0:10031/droonga     192.168.100.50:7946  alive  role=engine,cluster_id=f52d474afd2c34511cddaf5bc92243b017670e6b
node1/protocol-adapter  192.168.100.51:8946  alive  role=protocol-adapter
node1:10031/droonga     192.168.100.51:7946  alive  role=engine,cluster_id=29a2f18f5a7f6c2f0d471ef618ed9d4369f56750
  • -rpc-addr(hostname):7373にすると、Engineから見た時のクラスタの様子が見える。
  • -rpc-addr(hostname):8373にすると、Protocol Adapterから見た時のクラスタの様子が見える。
  • -format jsonを加えると、結果をJSON形式で見ることができる。

Protocol Adapterを通して、クラスタの構成を見る

$ curl "http://node0:10041/droonga/system/status?" | jq "."
{
  "nodes": {
    "node0:10031/droonga": {
      "live": true
    }
  }
}

Protocol Adapterを通さずに、Engineが認識しているクラスタの構成を見る

$ echo '{"dataset":"Default","type":"system.status"}' | \
    droonga-request --host node0 --receiver-host node1
Elapsed time: 0.003526426
{
  "inReplyTo": "1417338968.0856526",
  "statusCode": 200,
  "type": "system.status.result",
  "body": {
    "nodes": {
      "node0:10031/droonga": {
        "live": false
      },
      "node1:10031/droonga": {
        "live": true
      }
    }
  }
}

Protocol Adapterが接続しているEngineの一覧を見る

$ curl "http://node0:10041/engines" | jq "."                                                      
{
  "hostNames": [
    "node1",
    "node0"
  ],
  "clusterId": "29a2f18f5a7f6c2f0d471ef618ed9d4369f56750"
}

Clone this wiki locally