Installs and configures Couchbase. Also has optional LWRP for setting up a cluster, buckets, and xcdr. Tested with couchbase version 4.
Chef 0.12 and Ohai 0.6.12 are required due to the use of platform_family.
- Debian family (Debian, Ubuntu etc)
- Red Hat family (Redhat, CentOS, Oracle etc)
- Microsoft Windows
Note that Couchbase Server does not support Windows 8 or Server 2012: see http://www.couchbase.com/issues/browse/MB-6395. This is targeted to be fixed in Couchbase 2.0.2.
node['couchbase']['server']['edition']
- The edition of couchbase-server to install, "community" or "enterprise"node['couchbase']['server']['version']
- The version of couchbase-server to installnode['couchbase']['server']['database_path']
- The directory Couchbase should persist data tonode['couchbase']['server']['index_path']
- The directory Couchbase should persist index tonode['couchbase']['server']['log_dir']
- The directory Couchbase should log tonode['couchbase']['server']['memory_quota_mb']
- The per server RAM quota for data in megabytesnode['couchbase']['server']['index_memory_quota_mb']
- The per server RAM quota for the index in megabytesnode['couchbase']['server']['services']
- Couchbase 4.0 and up. Services the node should run - data, query, and index Enterprise can do individual services, all community nodes must include datanode['couchbase']['server']['username']
- The cluster's username for the REST API and Admin UInode['couchbase']['server']['password']
- The cluster's password for the REST API and Admin UInode['couchbase']['server']['run_cluster_init']
- Boolean whether to initialize the node as a stand alone server. Default is true. Setting go false will require node to be joined to a cluster before it is usable.
node['couchbase']['moxi']['version']
- The version of moxi to installnode['couchbase']['moxi']['package_file']
- The package file to downloadnode['couchbase']['moxi']['package_base_url']
- The base URL where the packages are locatednode['couchbase']['moxi']['package_full_url']
- The full URL to the moxi packagenode['couchbase']['moxi']['cluster_server']
- The bootstrap server for moxi to contact for the node listnode['couchbase']['moxi']['cluster_rest_url']
- The bootstrap server's full REST URL for retrieving the initial node list
Installs the libcouchbase2 and devel packages for the c library.
Installs the couchbase-server package and starts the couchbase-server service. If run_cluster_init is true (default) will initialize the server.
Installs the moxi-server package and starts the moxi-server service.
Examples recipes for cluster management, bucket management, and xdcr can be found under test/fixtures/cookbooks/test.
Example recipe to join nodes into a cluster.
Example recipe to remove a node from a cluster.
Example recipe to add a bucket to the cluster.
Example recipe to establish xdcr between two cluster and replicate a bucket.
Example recipe to delete bucket replication and xdcr between two clusters.
:install
- Default Installs couchbase-server from couchbase package repository.
version
- Version of couchbase to install (i.e.: 4.0.0).edition
- Either community (default) or enterprise.
couchbase_install_server "self" do
version '4.0.0'
edition 'community'
end
:add
- Default Sets the data and index directories on the node
database_path
- The path to where database should persistindex_path
- The path to where the index should persist. If not set will default to database_path.username
- The username to use to authenticate with Couchbasepassword
- The password to use to authenticate with Couchbaseinstall_path
- Path to where couchbase is installed - /opt/couchbase.
couchbase_node_directories "self" do
database_path '/opt/couchbase/var/lib/couchbase/data'
index_path '/opt/couchbase/var/lib/couchbase/index'
username 'Administrator'
password 'password'
install_path '/opt/couchbase'
end
:init
- Default Initialize node setting username and password for web ui.:join
- Join a node to a cluster.:leave
- Remove a node from a cluster.
-
services
- Version 4 and above. Defines the services the node will perform. One of data, index, query. For community edition every node must have data. This is primarily used when joining a node to a cluster but is required when running init. -
ramsize
- Amount of RAM in MB to allocate to data -
index_ramsize
- Amount of RAM in MB to allocate to index. If not set index is lumped in with data. -
version
- Version of couchbase. Needed to determine required attributes for 4 and above not supported on 3. Default is 4.0.0. -
username
- The username to use to authenticate with Couchbase -
password
- The password to use to authenticate with Couchbase -
install_path
- Path to where couchbase is installed - /opt/couchbase. -
master_ip
- Required and used only for :join and :leave. The ip address of the master node in the cluster.
couchbase_manager_cluster "default" do
services 'data,index,query'
version '4.0.0'
ramsize '2048'
index_ramsize '256'
username 'Administrator'
password 'password'
install_path '/opt/couchbase'
end
couchbase_manager_cluster "default" do
services 'data,index'
version '4.0.0'
username 'Administrator'
password 'password'
install_path '/opt/couchbase'
master_ip '10.20.1.101'
action :join
end
couchbase_manager_cluster "default" do
services 'data,index'
version '4.0.0'
username 'Administrator'
password 'password'
install_path '/opt/couchbase'
master_ip '10.20.1.101'
action :leave
end
:create
- Default Create a Couchbase bucket. If you run :create on an exist bucket it switches to edit.:edit
- Edit settings for a couchbase bucket. If you run :edit on a bucket that does not exist it switches to :create.:delete
- Delete a couchbase bucket.
bucket_name
- The name to use for the Couchbase bucket, defaults to the resource namebucket_type
- Either couchbase or memcached.bucket_ramsize
- The bucket's per server RAM quota for the entire cluster in megabytesbucket_replicas
- Number of replicas, default is 1.bucket_priority
- Bucket priority compared to other buckets either high or low, default is high.bucket_password
- Password for bucket - optional, default is nil.bucket_port
- Default is 11211 for SASL authentication or dedicated port with no password.bucket_flush
- Enable or disable flush - default is falsebucket_index_replica
- Enable or disable defined number of replicas default is false.bucketn_enable_priority
- Enables or disables index - default low.username
- The username to use to authenticate with Couchbasepassword
- The password to use to authenticate with Couchbase- `install_path - The path to where couchbase is install - default is /opt/couchbase
couchbase_manage_bucket "test" do
bucket_ramsize 128
username 'Administrator'
password 'password'
end
couchbase_manage_bucket "test" do
bucket_ramsize 128
username 'Administrator'
password 'password'
action :delete
end
:create
- Default Create xdcr replication.:delete
- Delete xdcr replication - you need to delete buckets replications first.:replicate
- Create bucket replication.:delete_replicate
- Delete bucket replication.
-
:remote_cluster_name
- Name to give replication, defaults to resource name. -
:master_ip
- Ip address or host name of node in cluster to replicate from - master cluster. -
:replica_ip
- Ip address or host name of node in cluster to replicate to - replica or slave cluster. -
:replica_username
- Username of replica cluster. -
:replica_password
- Password for replica cluster. -
:demand_encryption
- Use encryption, default to false. -
:certificate
- Path to certificate if demand_encryption is true. -
username
- The username to use to authenticate with Couchbase -
password
- The password to use to authenticate with Couchbase -
`install_path - The path to where couchbase is install - default is /opt/couchbase
-
:from_bucket
- Name of of bucket to replicate from on master cluster. -
:to_bucket
- Name of bucket to replicate to on replica cluster - must exist. -
:checkpoint_interval
- Interval between checkpoint in seconds between 60 and 14400, default is 1800. -
:worker_batch_size
- Worker batch size in KB between 500 and 10000, default is 500. -
:doc_batch_size
- Document batch size in KB between 10 and 100000 KB, default is 2048. -
:failure_restart_interval
- Interval for restarting faild XDCR 1 to 300 seconds default is 30. -
:optomistic_replication_threshold
- Document body size threshold (bytes) to trigger optimistic replication, default is 256. -
:source_nozzle_per_node
- Number of source nozzles per node 1 - 100 default is 2. Should match target_nozzle_per_node. -
:target_nozzle_per_node
- Number of outgoing nozzles per node 1 - 100, default is 2. Should match source_nozzles_per_node. -
:log_level
- Logging level one of Error, Info, Debug, or Trace, default is Info. -
:stats_interval
- Interval in MS for status updates, default is 1000. -
:replication_mode
- Replication protocol either version 2 - xmem or version 1 - capi, default is xmem. -
:filter_expression_mode
- Option filter expression.
couchbase_manage_xdcr 'test' do
username 'Administrator'
password 'password'
replica_ip '10.30.1.101'
master_ip '10.20.1.101'
replica_username 'Administrator'
replica_password 'Password'
end
couchbase_manage_xdcr 'test' do
username 'Administrator'
password 'password'
master_ip '10.20.1.101'
from_bucket 'beer-sample'
to_bucket 'beer-sample'
action :replicate
end
couchbase_manage_xdcr 'test' do
username 'Administrator'
password 'password'
master_ip '10.20.1.101'
from_bucket 'beer-sample'
action :delete_replicate
end
couchbase_manage_xdcr 'test' do
username 'Administrator'
password 'password'
master_ip '10.20.1.101'
action :delete
end
Author:: Dann S Washko ([email protected]) Author:: Chris Griego ([email protected]) Author:: Morgan Nelson ([email protected]) Author:: Julian Dunn ([email protected])
Copyright 2015, Gannett
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.