Chef cookbook for Apache Cassandra, DataStax Enterprise (DSE) and DataStax agent
Chef cookbook for Apache Cassandra, DataStax Enterprise (DSE) and DataStax agent
This is a Chef cookbook for Apache Cassandra (DataStax Community Edition) as well as DataStax Enterprise.
It uses officially released packages and provides an Upstart service script. It has fairly complete support for adjustment of Cassandra configuration parameters using Chef node attributes.
It was originally created for CI and development environments and now supports cluster discovery using Chef search. Feel free to contribute what you find missing!
This cookbook targets Chef 12 and later versions.
depends 'java'
depends 'ulimit'
depends 'apt'
depends 'yum'
depends 'ark'Modern Cassandra versions require OracleJDK 8.
cookbook 'cassandra-dse', '~> 4.5.0'cookbook 'cassandra-dse', github: 'michaelklishin/cassandra-chef-cookbook'This cookbook currently provides
Cassandra 2.x requires JDK 7+, later versions require Oracle JDK 8+.
The main recipe is cassandra-dse::default which together with the node[:cassandra][:install_method] attribute will be responsible for including the proper installation recipe and recipe cassandra-dse::config for configuring both datastax and tarball C* installation.
Two actual installation recipes are cassandra-dse::tarball and cassandra-dse::datastax. The former uses official tarball
and thus can be used to provision any specific version.
The latter uses DataStax repository via packages. You can install different versions (ex. dsc20 for v2.0) available in the repository by altering :package_name attribute (dsc20 by default).
Recently we have moved all the configuration resources to a separate recipe cassandra-des::config, which means recipes cassandra-dse::tarball and cassandra-dse::datastax are only responsible for C* installation.
Users with cookbook version `=v2.1 Attributes
node[:cassandra][:config][:broadcast_rpc_address] RPC address to broadcast to drivers and other Cassandra nodes (default: node[:ipaddress])node[:cassandra][:config][:tombstone_failure_threshold] tombstone attribute, check C* documentation for more info (default: 100000)node[:cassandra][:config][:tombstone_warn_threshold] tombstone attribute, check C* documentation for more info (default: 1000)node[:cassandra][:config][:sstable_preemptive_open_interval_in_mb] This helps to smoothly transfer reads between the sstables, reducing page cache churn and keeping hot rows hot (default: 50)node[:cassandra][:config][:memtable_allocation_type] Specify the way Cassandra allocates and manages memtable memory (default: heap_buffers)node[:cassandra][:config][:index_summary_capacity_in_mb] A fixed memory pool size in MB for for SSTable index summaries. If left empty, this will default to 5% of the heap size (default: nil)node[:cassandra][:config][:index_summary_resize_interval_in_minutes] How frequently index summaries should be resampled (default: 60)node[:cassandra][:config][:concurrent_counter_writes] Concurrent writes, since writes are almost never IO bound, the ideal number of "concurrent_writes" is dependent on the number of cores in your system; (8 * number_of_cores) (default: 32)node[:cassandra][:config][:counter_cache_save_period] Duration in seconds after which Cassandra should save the counter cache (keys only) (default: 7200)node[:cassandra][:config][:counter_cache_size_in_mb] Counter cache helps to reduce counter locks' contention for hot counter cells. Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache. (default: nil)node[:cassandra][:config][:counter_write_request_timeout_in_ms] How long the coordinator should wait for counter writes to complete (default: 5000)node[:cassandra][:config][:commit_failure_policy] policy for commit disk failures (default: stop)node[:cassandra][:config][:cas_contention_timeout_in_ms] How long a coordinator should continue to retry a CAS operation that contends with other proposals for the same row (default: 1000)node[:cassandra][:config][:batch_size_warn_threshold_in_kb] Log WARN on any batch size exceeding this value. 5kb per batch by default (default: 5)node[:cassandra][:config][:batchlog_replay_throttle_in_kb] Maximum throttle in KBs per second, total. This will be reduced proportionally to the number of nodes in the cluster (default: 1024)node[:cassandra][:setup_jamm] (default: false): install the jamm jar file and use it to set java option -javaagent, obsolete for C* versions >v0.8.0node[:cassandra][:jamm][:sha256sum] (default: calculated): jamm lib sha256sum for calculated versionnode[:cassandra][:jamm][:base_url] (default: calculated): jamm lib jar urlnode[:cassandra][:jamm][:jar_name] (default: calculated): jamm lib jar namenode[:cassandra][:jamm][:version] (default: calculated): jamm lib versionnode[:cassandra][:jna][:base_url] The base url to fetch the JNA jar (default: https://github.com/twall/jna/tree/4.0/dist)node[:cassandra][:jna][:jar_name] The name of the jar to download from the base url. (default: jna.jar)node[:cassandra][:jna][:sha256sum] The SHA-256 checksum of the file. If the local jna.jar file matches the checksum, the chef-client will not re-download it. (default: dac270b6441ce24d93a96ddb6e8f93d8df099192738799a6f6fcfc2b2416ca19)node[:cassandra][:setup_priam] (default: false): install the priam jar file and use it to set java option -javaagent, uses the priam version corresponding to the cassandra versionnode[:cassandra][:priam][:sha256sum] (default: 9fde9a40dc5c538adee54f40fa9027cf3ebb7fd42e3592b3e6fdfe3f7aff81e1): priam lib sha256sum for version 2.2.0node[:cassandra][:priam][:base_url] (default: priam url on maven.org): priam lib jar urlnode[:cassandra][:priam][:jar_name] (default: calculated): priam lib jar namenode[:cassandra][:logback][:file][:max_file_size] (default: "20MB"): logback File appender log file rotation sizenode[:cassandra][:logback][:file][:max_index] (default: 20): logback File appender log files max_indexnode[:cassandra][:logback][:file][:min_index] (default: 1): logback File appender log files min_indexnode[:cassandra][:logback][:file][:pattern] (default: "%-5level [%thread] %date{ISO8601} %F:%L - %msg%n"): logback File appender log patternnode[:cassandra][:logback][:debug][:enable] (default: false): enable logback File appender log debugnode[:cassandra][:logback][:debug][:max_file_size] (default: "20MB"): logback File appender log file rotation sizenode[:cassandra][:logback][:debug][:max_index] (default: 20): logback File appender log files max_indexnode[:cassandra][:logback][:debug][:min_index] (default: 1): logback File appender log files min_indexnode[:cassandra][:logback][:debug][:pattern] (default: "%-5level [%thread] %date{ISO8601} %F:%L - %msg%n"): logback File appender log patternnode[:cassandra][:logback][:stdout][:enable] (default: true): enable logback STDOUT appendernode[:cassandra][:logback][:stdout][:pattern] (default: "%-5level %date{HH:mm:ss,SSS} %msg%n"): logback STDOUT appender log patternnode[:cassandra][:logback][:syslog][:enable] (default: false): enable logback SYSLOG appender. Requires RSYSLOG be installed and running on the node.node[:cassandra][:logback][:syslog][:host] (default: localhost): The host name the syslog is written to.node[:cassandra][:logback][:syslog][:facility] (default: USER) The facility specified for the appender.node[:cassandra][:logback][:syslog][:pattern] (default: "%-5level [%thread] %F:%L - %msg%n") lockback SYSLOG appender log patternnode[:cassandra][:logback][:override_loggers] (default: {}) Override log level of specific logger (i.e { 'org.apache.cassandra.utils.StatusLogger' => 'WARN' })node[:cassandra][:limits][:memlock] (default: "unlimited"): memory ulimit for Cassandra node processnode[:cassandra][:limits][:nofile] (default: 48000): file ulimit for Cassandra node processnode[:cassandra][:limits][:nproc] (default: "unlimited"): process ulimit for Cassandra node processnode[:cassandra][:yum][:repo] (default: datastax): name of the repo from which to installnode[:cassandra][:yum][:description] (default: "DataStax Repo for Apache Cassandra"): description of the reponode[:cassandra][:yum][:baseurl] (default: "http://rpm.datastax.com/community"): repo urlnode[:cassandra][:yum][:mirrorlist] (default: nil): a mirrorlist filenode[:cassandra][:yum][:gpgcheck] (default: false): whether to use gpgchecknode[:cassandra][:yum][:enabled] (default: true): whether the repo is enabled by defaultnode[:cassandra][:yum][:options] (default: ""): Additional options to pass to yum_packagenode[:cassandra][:opscenter][:server][:package_name] (default: opscenter-free)node[:cassandra][:opscenter][:server][:port] (default: 8888)node[:cassandra][:opscenter][:server][:interface] (default: 0.0.0.0)node[:cassandra][:opscenter][:server][:authentication] (default: false)node[:cassandra][:opscenter][:cassandra_metrics][:ignored_keyspaces] (default: [system, OpsCenter])node[:cassandra][:opscenter][:cassandra_metrics][:ignored_column_families] (default: [])node[:cassandra][:opscenter][:cassandra_metrics][:1min_ttl] (default: 604800)node[:cassandra][:opscenter][:cassandra_metrics][:5min_ttl] (default: 2419200)node[:cassandra][:opscenter][:cassandra_metrics][:2hr_ttl] (default: 31536000)node[:cassandra][:opscenter][:custom_configuration] (default: {}) a hash of custom configuration sections to add to opscenterd.conf, e.g.:{
'ui' => {
'default_api_timeout' => 300
},
'stat_reporter' => {
'interval' => 1
}
}node[:cassandra][:opscenter][:agent][:download_url] (default: "") Required. You need to specify
agent download url, because that could be different for each opscenter server version. ( S3 is a great
place to store packages )node[:cassandra][:opscenter][:agent][:checksum] (default: nil)node[:cassandra][:opscenter][:agent][:install_dir] (default: /opt)node[:cassandra][:opscenter][:agent][:install_folder_name] (default: opscenter_agent)node[:cassandra][:opscenter][:agent][:binary_name] (default: opscenter-agent) Introduced since Datastax changed agent binary name from opscenter-agent to datastax-agent. Make sure to set it right if you are updating to 4.0.2node[:cassandra][:opscenter][:agent][:server_host] (default: "" ). If left empty, will use search to get IP by opscenter server_role role.node[:cassandra][:opscenter][:agent][:server_role] (default: opscenter_server). Will be use for opscenter server IP lookup if :server_host is not set.node[:cassandra][:opscenter][:agent][:use_chef_search] (default: true). Determines whether chef search will be used for locating the data agent server.No open issues yet, or sync has not completed.