By default the maximum number of buckets recommended for a Couchbase Cluster is ten. This is a safety mechanism to ensure that a cluster does not have resource and CPU overuse due to too many buckets. This limit is configurable using the REST API.
The Couchbase REST API has changed to enable you to change the default maximum number of buckets used in a Couchbase cluster. The maximum allowed buckets in this request is 128, however the suggested maximum number of buckets is ten per cluster. The following illustrates the endpoint and parameters used:
shell> curl -X POST -u admin:password -d maxBucketCount=6 http://ip_address:8091/internalSettingsFor this request you need to provide administrative credentials for the cluster. The following HTTP request will be sent:
About to connect() to 127.0.0.1 port 8091 (#0) Trying 127.0.0.1... connected Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0) Server auth using Basic with user 'Administrator' POST /internalSettings HTTP/1.1
If Couchbase Server successfully changes the bucket limit for the cluster, you will get a HTTP 200 response:
HTTP/1.1 200 OK Server: Couchbase Server 2.0.0r_501_gb614829 Pragma: no-cache Date: Wed, 31 Oct 2012 21:21:48 GMT Content-Type: application/json Content-Length: 2 Cache-Control: no-cache
If you provide an invalid number, such as 0, a negative number, or an amount over 128 buckets, you will get this error message:
["Unexpected server error, request logged."]