CouchbaseのSDKを作成する場合、Couchbase Serverと接続するためにプロキシパスまたはダイレクトパスを利用することができます。 SDKがダイレクトパスを利用している場合、SDKはバケットの変更による再構成の大部分に影響されます。これは、独自のSDKでバケットのURIをポーリングするか、バケットの設定が変化したときに更新を取得するストリーミングURIへ接続することが必要であることを意味します。バケットの構成では、たとえばノードの追加や削除、ノードの障害が発生します。
クラスタのすべてのバケットの情報を取得するには:
shell> curl -u Administrator:password http://10.4.2.5:8091/pools/default/buckets
GET /pools/default/buckets Host: localhost:8091 Authorization: Basic xxxxxxxxxxxxxxxxxxx Accept: application/json X-memcachekv-Store-Client-Specification-Version: 0.1
HTTP/1.1 200 OK Server: Couchbase Server 1.6.0 Pragma: no-cache Date: Wed, 03 Nov 2010 18:12:19 GMT Content-Type: application/json Content-Length: nnn Cache-Control: no-cache no-store max-age=0 [ { "name": "default", "bucketType": "couchbase", "authType": "sasl", "saslPassword": "", "proxyPort": 0, "uri": "/pools/default/buckets/default", "streamingUri": "/pools/default/bucketsStreaming/default", "flushCacheUri": "/pools/default/buckets/default/controller/doFlush", "nodes": [ { "uptime": "784657", "memoryTotal": 8453197824.0, "memoryFree": 1191157760, "mcdMemoryReserved": 6449, "mcdMemoryAllocated": 6449, "clusterMembership": "active", "status": "unhealthy", "hostname": "10.1.15.148:8091", "version": "1.6.0", "os": "windows", "ports": { "proxy": 11211, "direct": 11210 } } ], "stats": { "uri": "/pools/default/buckets/default/stats" }, "nodeLocator": "vbucket", "vBucketServerMap": { "hashAlgorithm": "CRC", "numReplicas": 1, "serverList": [ "192.168.1.2:11210" ], "vBucketMap": [ [ 0, -1 ], [ 0, -1 ], [ 0, -1 ], [ 0, -1 ], [ 0, -1 ], [ 0, -1 ]] }, "replicaNumber": 1, "quota": { "ram": 104857600, "rawRAM": 104857600 }, "basicStats": { "quotaPercentUsed": 24.360397338867188, "opsPerSec": 0, "diskFetches": 0, "itemCount": 0, "diskUsed": 0, "memUsed": 25543728 } }, { "name": "test-application", "bucketType": "memcached", "authType": "sasl", "saslPassword": "", "proxyPort": 0, "uri": "/pools/default/buckets/test-application", "streamingUri": "/pools/default/bucketsStreaming/test-application", "flushCacheUri": "/pools/default/buckets/test-application/controller/doFlush", "nodes": [ { "uptime": "784657", "memoryTotal": 8453197824.0, "memoryFree": 1191157760, "mcdMemoryReserved": 6449, "mcdMemoryAllocated": 6449, "clusterMembership": "active", "status": "healthy", "hostname": "192.168.1.2:8091", "version": "1.6.0", "os": "windows", "ports": { "proxy": 11211, "direct": 11210 } } ], "stats": { "uri": "/pools/default/buckets/test-application/stats" }, "nodeLocator": "ketama", "replicaNumber": 0, "quota": { "ram": 67108864, "rawRAM": 67108864 }, "basicStats": { "quotaPercentUsed": 4.064150154590607, "opsPerSec": 0, "hitRatio": 0, "itemCount": 1385, "diskUsed": 0, "memUsed": 2727405 } } ]