Couchbase2.0でデフォルトの最大バケット数が10になってる件

Couchbase Type、Memcached Type関係無しにバケット数10個ある状態で
新規にバケットを作成しようとすると以下の様なメッセージが出て11個目のバケットが作成出来ませんでした。



Maximum Bucket Count Reached

Maximum number of buckets has been reached.
For optimal performance, no more than 10 buckets are allowd.


どうも10個以上バケットが作成出来ない模様。


Couchbaseのバージョン

2.0.0 community edition (build-1976)


理由

↓を参照すると、
http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-admin-restapi-max-buckets.html

推奨バケット数(デフォルト) 1クラスタあたり10個
最大バケット数 128個

とされていて、リソースが枯渇しないようにデフォルトで、推奨値の10個以上作成出来ないようになっているようです。

最大バケット数を上げてみる

とはいえバケットを10個以上作成する必要があったので、どうしようと思ったらちゃんとマニュアルに記載がありました。
REST APIを使用することで10個以上作成出来るよう上限を引き上げられそうです。


実際に最大バケット数を倍の10→20にしてみました。

curl -v -X POST -u Administrator:password -d maxBucketCount=20 http://couchbase01.example.com:8091/internalSettings


出力結果
* About to connect() to couchbase01.example.com port 8091 (#0)
*   Trying 10.0.0.1... connected
* Connected to couchbase01.example.com (10.0.0.1) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /internalSettings HTTP/1.1
> Authorization: Basic 
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: couchbase01.example.com:8091
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Server: Couchbase Server 2.0.0-1976-rel-community
< Pragma: no-cache
< Date: Mon, 11 Mar 2013 00:00:00 GMT
< Content-Type: application/json
< Content-Length: 2
< Cache-Control: no-cache
<
* Connection #0 to host couchbase01.example.com left intact
* Closing connection #0
[]

最大バケット数確認

本当に最大バケット数が10→20に引き上がっているか以下のコマンドで確認しました。

 curl -v -X GET -u Administrator:password http://couchbase01.example.com:8091/internalSettings
出力結果
* About to connect() to couchbase01.example.com port 8091 (#0)
*   Trying 10.0.0.1... connected
* Connected to couchbase01.example.com (10.0.0.1) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> GET /internalSettings HTTP/1.1
> Authorization: Basic 
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: couchbase01.example.com:8091
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Couchbase Server 2.0.0-1976-rel-community
< Pragma: no-cache
< Date: Mon, 11 Mar 2013 00:00:00 GMT
< Content-Type: application/json
< Content-Length: 329
< Cache-Control: no-cache
<
* Connection #0 to host couchbase01.example.com left intact
* Closing connection #0
{"indexAwareRebalanceDisabled":false,"rebalanceIndexWaitingDisabled":false,"rebalanceIndexPausingDisabled":false,"maxParallelIndexers":4,"maxParallelReplicaIndexers":2,"maxBucketCount":20,"xdcrMaxConcurrentReps":32,"xdcrCheckpointInterval":1800,"xdcrWorkerBatchSize":500,"xdcrDocBatchSizeKb":2048,"xdcrFailureRestartInterval":30}

出力結果の内、『maxBucketCount』の箇所が
"maxBucketCount":20
となっているので無事引き上がっているようです。


実際に管理画面から11個目のバケットを新規作成することが出来ました。