GithubHelp home page GithubHelp logo

michaelklishin / cassandra-chef-cookbook Goto Github PK

View Code? Open in Web Editor NEW
161.0 32.0 228.0 1003 KB

Chef cookbook for Apache Cassandra, DataStax Enterprise (DSE) and DataStax agent

License: Apache License 2.0

Ruby 65.42% Shell 12.42% HTML 22.16%
cassandra chef-cookbook datastax-enterprise chef cookbook cookbooks

cassandra-chef-cookbook's Introduction

Apache Cassandra Chef Cookbook

Build Status

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!

Supported Chef Versions

This cookbook targets Chef 12 and later versions.

Cookbook Dependencies

depends 'java'
depends 'ulimit'
depends 'apt'
depends 'yum'
depends 'ark'

Cassandra Dependencies

Modern Cassandra versions require OracleJDK 8.

Berkshelf

Most Recent Release

cookbook 'cassandra-dse', '~> 4.5.0'

From Git

cookbook 'cassandra-dse', github: 'michaelklishin/cassandra-chef-cookbook'

Supported Apache Cassandra Version

This cookbook currently provides

  • Cassandra via tarballs
  • Cassandra (DataStax Community Edition) via apt and yum packages
  • DataStax Enterprise (DSE) via packages

Supported OS Distributions

  • Ubuntu 14.04 through 18.04 via DataStax apt repo.
  • RHEL/CentOS via DataStax yum repo.
  • RHEL/CentOS/Amazon via tarball

Support JDK Versions

Cassandra 2.x requires JDK 7+, later versions require Oracle JDK 8+.

Recipes

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 =<3.5.0 needs to update the run_list, in case of not using cassandra-dse::default recipe.

include_recipe cassandra-dse uses cassandra-dse::datastax as the default.

DataStax Enterprise

You can also install the DataStax Enterprise edition by adding node[:cassandra][:dse] attributes according to the datastax.rb.

  • node[:cassandra][:package_name]: Override default value to 'dse-full'.
  • node[:cassandra][:service_name]: Override default value to 'dse'.

Unencrypted Credentials:

  • node[:cassandra][:dse][:credentials][:username]: Your username from Datastax website.
  • node[:cassandra][:dse][:credentials][:password]: Your password from Datastax website.

Encrypted Credentials:

  • node[:cassandra][:dse][:credentials][:databag][:name]: Databag name, i.e. the value 'cassandra' will reference to /data_bags/cassandra.
  • node[:cassandra][:dse][:credentials][:databag][:item]: Databag item, i.e. the value 'main' will reference to /data_bags/cassandra/main.json.
  • node[:cassandra][:dse][:credentials][:databag][:entry]: The field name in the databag item, in which the credetials are written. i.e. the data_bag:
{
  "id": "main",
  "entry": {
    "username": "%USERNAME%",
    "password": "%PASSWORD%"
  }
}

There are also recipes for DataStax opscenter installation ( cassandra-dse::opscenter_agent_tarball, cassandra-dse::opscenter_agent_datastax, and cassandra-dse::opscenter_server ) along with attributes available for override (see below).

JNA Support (for C* Versions Prior to 2.1.0)

The node[:cassandra][:setup_jna] attribute will install the jna.jar in the /usr/share/java/jna.jar, and create a symbolic link to it on #{cassandra.lib\_dir}/jna.jar, according to the DataStax documentation.

Node Attributes

Please note that the maintainers try to keep the list below up-to-date but it fairly often misses some recently added attributes. Please refer to the attributes files if an attribute you are looking for isn't listed.

Core Attributes

  • node[:cassandra][:install_method] (default: datastax): The installation method to use (either 'datastax' or 'tarball').
  • node[:cassandra][:config][:cluster_name] (default: none): Name of the cluster to create. This is required.
  • node[:cassandra][:version] (default: a recent patch version): version to provision
  • node[:cassandra][:tarball][:url] and node[:cassandra][:tarball][:sha256sum] specify tarball URL and SHA256 check sum used by the cassandra::tarball recipe.
  • Setting node[:cassandra][:tarball][:url] to "auto" (default) will download the tarball of the specified version from the Apache repository.
  • node[:cassandra][:setup_user] (default: true): create user/group for Cassandra node process
  • node[:cassandra][:setup_user_limits] (default: true): setup Cassandra user limits
  • node[:cassandra][:user]: username Cassandra node process will use
  • node[:cassandra][:group]: groupname Cassandra node process will use
  • node[:cassandra][:heap_new_size] set JVM -Xmn. If set, node[:cassandra][:max_heap_size] must also be set; if nil, defaults to min(100MB * num_cores, 1/4 * heap size)
  • node[:cassandra][:max_heap_size] set JVM -Xms and -Xmx. If set, node[:cassandra][:heap_new_size] must also be set; if nil, defaults to max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))
  • node[:cassandra][:installation_dir] (default: /usr/local/cassandra): installation directory
  • node[:cassandra][:root_dir] (default: /var/lib/cassandra): data directory root
  • node[:cassandra][:log_dir] (default: /var/log/cassandra): log directory
  • node[:cassandra][:tmp_dir] (default: none): tmp directory. Be careful what you set this to, as the cassandra user will be given ownership of that directory.
  • node[:cassandra][:local_jmx] (default: true): bind JMX listener to localhost
  • node[:cassandra][:jmx_port] (default: 7199): port to listen for JMX
  • node[:cassandra][:jmx_remote_rmi_port] (default: $JMX_PORT): port for jmx remote method invocation. If using internode SSL, there is a bug requiring this to be different than node[:cassandra][:jmx_port]
  • node[:cassandra][:jmx_remote_authenticate] (default: false): turn on to require username/password for jmx operations including nodetool. To turn on requires node[:cassandra][:local_jmx] to be false
  • node[:cassandra][:jmx][:user] (default: cassandra): username for jmx authentication
  • node[:cassandra][:jmx][:password] (default: cassandra): password for jmx authentication.
  • node[:cassandra][:notify_restart] (default: false): notify Cassandra service restart upon resource update
  • Setting node[:cassandra][:notify_restart] to true will restart Cassandra service upon resource change
  • node[:cassandra][:setup_jna] (default: true): installs jna.jar
  • node[:cassandra][:skip_jna] (default: false): (2.1.0 and up only) removes jna.jar, adding '-Dcassandra.boot_without_jna=true' for low-memory C* installations
  • node[:cassandra][:pid_dir] (default: true): pid directory for Cassandra node process for cassandra::tarball recipe
  • node[:cassandra][:dir_mode] (default: 0755): default permission set for Cassandra node directory / files
  • node[:cassandra][:service_action] (default: [:enable, :start]): default service actions for the service
  • node[:cassandra][:install_java] (default: true): whether to run the open source java cookbook
  • node[:cassandra][:cassandra_old_version_20] (default: ): attribute used in cookbook to determine C* version older or newer than 2.1
  • node[:cassandra][:log_config_files] (default: calculated): log framework configuration files name array
  • node[:cassandra][:xss] JVM per thread stack-size (-Xss option) (default: 256k).
  • node[:cassandra][:jmx_server_hostname] java.rmi.server.hostname option for JMX interface, necessary to set when you have problems connecting to JMX) (default: false)
  • node[:cassandra][:heap_dump] -XX:+HeapDumpOnOutOfMemoryError JVM parameter (default: true)
  • node[:cassandra][:heap_dump_dir] Directory where heap dumps will be placed (default: nil, which will use cwd)
  • node[:cassandra][:vnodes] enable vnodes. (default: true)
  • node[:cassandra][:enable_assertions] Enable JVM assertions. Disabling this in production will give a modest performance benefit (around 5%) (default: true).
  • node[:cassandra][:on_oom] -XX:OnOutOfMemoryError JVM parameter (default: kill -9 %p)

For the complete set of supported attributes, please consult the source.

Attributes used to define JBOD functionality

  • default['cassandra']['jbod']['slices'] - defines the number of jbod slices while each represents data directory. By default disables with nil.
  • default['cassandra']['jbod']['dir_name_prefix'] - defines the data directory prefix For example if you want to connect 4 EBS disks as a JBOD slices the names will be in the following format: data1,data2,data3,data4 cassandra.yaml.erb will generate automatically entry per data_dir location Please note: this functionality is not creating volumes or directories. It takes care of configuration. You can use same parameters with AWS cookbook to create EBS volumes and map to directories.

Attributes for fine tuning CMS/ParNew, the GC algorithm recommended for Cassandra deployments:

  • node[:cassandra][:gc_survivor_ratio] -XX:SurvivorRatio JVM parameter (default: 8)
  • node[:cassandra][:gc_max_tenuring_threshold] -XX:MaxTenuringThreshold JVM parameter (default: 1)
  • node[:cassandra][:gc_cms_initiating_occupancy_fraction] -XX:CMSInitiatingOccupancyFraction JVM parameter (default: 75)

Descriptions for these JVM parameters can be found here and here.

Attributes for enabling G1 GC.

  • node[:cassandra][:jvm][:g1] (default: false)

Attributes for enabling GC detail/logging.

  • node[:cassandra][:jvm][:gcdetail] (default: false)
  • node[:cassandra][:log_gc] -Xloggc JVM parameter (default: ${CASSANDRA_HOME}/logs/gc.log)

Attributes for fine tuning the G1 GC algorithm:

  • node[:cassandra][:jvm][:g1_rset_updating_pause_time_percent] (default: 10)
  • node[:cassandra][:jvm][:g1_heap_region_size] -XX:G1HeapRegionSize (default: 0)
  • node[:cassandra][:jvm][:max_gc_pause_millis] -XX:MaxGCPauseMillis (default: 200)
  • node[:cassandra][:jvm][:heap_occupancy_threshold] -XX:InitiatingHeapOccupancyPercent (default: 45)
  • node[:cassandra][:jvm][:max_parallel_gc_threads] This will set -XX:ParallelGCThreads to the number of cores on the machine (default: false)
  • node[:cassandra][:jvm][:max_conc_gc_threads] This will set -XX:ConcGCThreads to the number of cores on the machine (default: false)
  • node[:cassandra][:jvm][:parallel_ref_proc] -XX:ParallelRefProcEnabled (default: false)
  • node[:cassandra][:jvm][:always_pre_touch] -XX:AlwaysPreTouch (default: false)
  • node[:cassandra][:jvm][:use_biased_locking] -XX:UseBiasedLocking (default: true)
  • node[:cassandra][:jvm][:use_tlab] -XX:UseTLAB (default: true)
  • node[:cassandra][:jvm][:resize_tlab] -XX:ResizeTLAB (default: true)

Oracle JVM 8 tuning parameters: here

Seed Discovery Attributes

  • node[:cassandra][:seeds] (default: [node[:ipaddress]]): an array of nodes this node will contact to discover cluster topology
  • node[:cassandra][:seed_discovery][:use_chef_search] (default: false): enabled seed discovery using Chef search
  • node[:cassandra][:seed_discovery][:search_role] (default: "cassandra-seed"): role to use in search query
  • node[:cassandra][:seed_discovery][:search_query] (default: uses node[:cassandra][:seed_discovery][:search_role]): allows for overriding the entire Chef search query
  • node[:cassandra][:seed_discovery][:count] (default: 3): how many nodes to include into seed list. First N nodes are taken in the order Chef search returns them. IP addresses of the nodes are sorted lexographically.

cassandra.yaml Attributes

  • node[:cassandra][:config][:num_tokens] set the desired number of tokens. (default: 256)
  • node[:cassandra][:config][:listen_address] (default: node[:ipaddress]): address clients will use to connect to the node
  • node[:cassandra][:config][:broadcast_address] (default: node IP address): address to broadcast to other Cassandra nodes
  • node[:cassandra][:config][:rpc_address] (default: 0.0.0.0): address to bind the RPC interface. Leave blank to lookup IP from hostname.
  • node[:cassandra][:config][:hinted_handoff_enabled] see http://wiki.apache.org/cassandra/HintedHandoff (default: true)
  • node[:cassandra][:config][:max_hint_window_in_ms] The maximum amount of time a dead host will have hints generated (default: 10800000).
  • node[:cassandra][:config][:hinted_handoff_throttle_in_kb] throttle in KB's per second, per delivery thread (default: 1024)
  • node[:cassandra][:config][:max_hints_delivery_threads] Number of threads with which to deliver hints (default: 2)
  • node[:cassandra][:config][:authenticator] Authentication backend (default: org.apache.cassandra.auth.AllowAllAuthenticator)
  • node[:cassandra][:config][:authorizer] Authorization backend (default: org.apache.cassandra.auth.AllowAllAuthorizer)
  • node[:cassandra][:config][:permissions_validity_in_ms] Validity period for permissions cache, set to0 to disable (default: 2000)
  • node[:cassandra][:config][:partitioner] The partitioner to distribute keys across the cluster (default: org.apache.cassandra.dht.Murmur3Partitioner).
  • node[:cassandra][:config][:disk_failure_policy] policy for data disk failures: stop, best_effort, or ignore (default: stop)
  • node[:cassandra][:config][:key_cache_size_in_mb] Maximum size of the key cache in memory. Set to 0 to disable, or "" for auto = (min(5% of Heap (in MB), 100MB)) (default: "", auto).
  • node[:cassandra][:config][:key_cache_save_period] Duration in seconds after which key cache is saved to saved_caches_directory. (default: 14400)
  • node[:cassandra][:config][:row_cache_size_in_mb] Maximum size of the row cache in memory, 0 to disable (default: 0)
  • node[:cassandra][:config][:row_cache_save_period] Duration in seconds after which row cache is saved to saved_caches_directory, 0 to disable cache save. (default: 0)
  • node[:cassandra][:config][:row_cache_provider] The provider for the row cache to use (default: SerializingCacheProvider)
  • node[:cassandra][:config][:commitlog_sync] periodic to ack writes immediately with periodic fsyncs, or batch to wait until fsync to ack writes (default: periodic)
  • node[:cassandra][:config][:commitlog_sync_period_in_ms] period for commitlog fsync when commitlog_sync = periodic (default: 10000)
  • node[:cassandra][:config][:commitlog_sync_batch_window_in_ms] batch window for fsync when commitlog_sync = batch (default: 50)
  • node[:cassandra][:config][:commitlog_segment_size_in_mb] Size of individual commitlog file segments (default: 32)
  • node[:cassandra][:config][:commitlog_total_space_in_mb] If space gets above this value (it will round up to the next nearest segment multiple), Cassandra will flush every dirty CF in the oldest segment and remove it. (default: 4096)
  • node[:cassandra][:config][:concurrent_reads] Should be set to 16 * drives (default: 32)
  • node[:cassandra][:config][:concurrent_writes] Should be set to 8 * cpu cores (default: 32)
  • node[:cassandra][:config][:trickle_fsync] Enable this to avoid sudden dirty buffer flushing from impacting read latencies. Almost always a good idea on SSDs; not necessary on platters (default: false)
  • node[:cassandra][:config][:trickle_fsync_interval_in_kb] Interval for fsync when doing sequential writes (default: 10240)
  • node[:cassandra][:config][:storage_port] TCP port, for commands and data (default: 7000)
  • node[:cassandra][:config][:ssl_storage_port] SSL port, unused unless enabled in encryption options (default: 7001)
  • node[:cassandra][:config][:listen_address] Address to bind for communication with other nodes. Leave blank to lookup IP from hostname. 0.0.0.0 is always wrong. (default: node[:ipaddress]).
  • node[:cassandra][:config][:broadcast_address] Address to broadcast to other Cassandra nodes. If '', will use listen_address (default: '')
  • node[:cassandra][:config][:start_native_transport] Whether to start the native transport server (default: true)
  • node[:cassandra][:config][:native_transport_port] Port for the CQL native transport to listen for clients on (default: 9042)
  • node[:cassandra][:config][:start_rpc] Whether to start the Thrift RPC server (default: true)
  • node[:cassandra][:config][:rpc_port] Port for Thrift RPC server to listen for clients on (default: 9160)
  • node[:cassandra][:config][:rpc_keepalive] Enable keepalive on RPC connections (default: true)
  • node[:cassandra][:config][:rpc_server_type] sync for one thread per connection; hsha for "half synchronous, half asynchronous" (default: sync)
  • node[:cassandra][:config][:thrift_framed_transport_size_in_mb] Frame size for Thrift (maximum field length) (default: 15)
  • node[:cassandra][:config][:thrift_max_message_length_in_mb] Max length of a Thrift message, including all fields and internal Thrift overhead (default: 16)
  • node[:cassandra][:config][:incremental_backups] Enable hardlinks in backups/ for each sstable flushed or streamed locally. Removing these links is the operator's responsibility (default: false)
  • node[:cassandra][:config][:snapshot_before_compaction] Take a snapshot before each compaction (default: false)
  • node[:cassandra][:config][:auto_snapshot] Take a snapshot before keyspace truncation or dropping of column families. If you set this value to false, you will lose data on truncation or drop (default: true)
  • node[:cassandra][:config][:column_index_size_in_kb] Add column indexes to a row after its contents reach this size (default: 64)
  • node[:cassandra][:config][:compaction_throughput_mb_per_sec] Throttle compaction to this total system throughput. Generally should be 16-32 times data insertion rate (default: 16)
  • node[:cassandra][:config][:read_request_timeout_in_ms] How long the coordinator should wait for read operations to complete (default: 10000)
  • node[:cassandra][:config][:range_request_timeout_in_ms] How long the coordinator should wait for seq or index scans to complete (default: 10000).
  • node[:cassandra][:config][:write_request_timeout_in_ms] How long the coordinator should wait for writes to complete (default: 10000)
  • node[:cassandra][:config][:truncate_request_timeout_in_ms] How long the coordinator should wait for truncates to complete (default: 60000)
  • node[:cassandra][:config][:request_timeout_in_ms] Default timeout for other, miscellaneous operations (default: 10000)
  • node[:cassandra][:config][:cross_node_timeout] Enable operation timeout information exchange between nodes to accurately measure request timeouts. Be sure ntp is installed and node times are synchronized before enabling. (default: false)
  • node[:cassandra][:config][:streaming_socket_timeout_in_ms] Enable socket timeout for streaming operation (default: 3600000 - 1 hour)
  • node[:cassandra][:config][:phi_convict_threshold] Adjusts the sensitivity of the failure detector on an exponential scale (default: 8)
  • node[:cassandra][:config][:endpoint_snitch] SimpleSnitch, PropertyFileSnitch, GossipingPropertyFileSnitch, RackInferringSnitch, Ec2Snitch, Ec2MultiRegionSnitch (default: SimpleSnitch)
  • node[:cassandra][:config][:dynamic_snitch_update_interval_in_ms] How often to perform the more expensive part of host score calculation (default: 100)
  • node[:cassandra][:config][:dynamic_snitch_reset_interval_in_ms] How often to reset all host scores, allowing a bad host to possibly recover (default: 600000)
  • node[:cassandra][:config][:dynamic_snitch_badness_threshold] Allow 'pinning' of replicas to hosts in order to increase cache capacity. (default: 0.1)
  • node[:cassandra][:config][:request_scheduler] Class to schedule incoming client requests (default: org.apache.cassandra.scheduler.NoScheduler)
  • node[:cassandra][:config][:index_interval] index_interval controls the sampling of entries from the primary row index in terms of space versus time (default: 128).
  • node[:cassandra][:config][:auto_bootstrap] Setting this parameter to false prevents the new nodes from attempting to get all the data from the other nodes in the data center. (default: true).
  • node[:cassandra][:config][:data_file_directories] (default: node['cassandra']['data_dir']): C* data cirectories
  • node[:cassandra][:config][:saved_caches_directory] (default: saved_caches_directory): C* saved cache directory
  • node[:cassandra][:config][:commitlog_directory] (default: node['cassandra']['commitlog_dir']) *C commit log directory

C* <v2.0 Attributes

  • node[:cassandra][:config][:memtable_flush_queue_size] Number of full memtables to allow pending flush, i.e., waiting for a writer thread (default: 4)
  • node[:cassandra][:config][:in_memory_compaction_limit_in_mb] Size limit for rows being compacted in memory (default: 64)
  • node[:cassandra][:config][:concurrent_compactors] Sets the number of concurrent compaction processes allowed to run simultaneously on a node. (default: nil, which will result in one compaction process per CPU core)
  • node[:cassandra][:config][:multithreaded_compaction] Enable multithreaded compaction. Uses one thread per core, plus one thread per sstable being merged. (default: false)
  • node[:cassandra][:config][:compaction_preheat_key_cache] Track cached row keys during compaction and re-cache their new positions in the compacted sstable. Disable if you use really large key caches (default: true)
  • node[:cassandra][:config][:native_transport_min_threads] Min number of threads for handling transport requests when the native protocol is used (default: nil)
  • node[:cassandra][:config][:native_transport_max_threads] Max number of threads for handling transport requests when the native protocol is used (default: nil)

C* >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)

JAMM Attributes

  • 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.0
  • node[:cassandra][:jamm][:sha256sum] (default: calculated): jamm lib sha256sum for calculated version
  • node[:cassandra][:jamm][:base_url] (default: calculated): jamm lib jar url
  • node[:cassandra][:jamm][:jar_name] (default: calculated): jamm lib jar name
  • node[:cassandra][:jamm][:version] (default: calculated): jamm lib version

JNA Attributes (Prior C* version 2.1.0)

  • node[: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)

Priam Attributes

  • 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 version
  • node[:cassandra][:priam][:sha256sum] (default: 9fde9a40dc5c538adee54f40fa9027cf3ebb7fd42e3592b3e6fdfe3f7aff81e1): priam lib sha256sum for version 2.2.0
  • node[:cassandra][:priam][:base_url] (default: priam url on maven.org): priam lib jar url
  • node[:cassandra][:priam][:jar_name] (default: calculated): priam lib jar name

Logback Attributes

  • node[:cassandra][:logback][:file][:max_file_size] (default: "20MB"): logback File appender log file rotation size
  • node[:cassandra][:logback][:file][:max_index] (default: 20): logback File appender log files max_index
  • node[:cassandra][:logback][:file][:min_index] (default: 1): logback File appender log files min_index
  • node[:cassandra][:logback][:file][:pattern] (default: "%-5level [%thread] %date{ISO8601} %F:%L - %msg%n"): logback File appender log pattern
  • node[:cassandra][:logback][:debug][:enable] (default: false): enable logback File appender log debug
  • node[:cassandra][:logback][:debug][:max_file_size] (default: "20MB"): logback File appender log file rotation size
  • node[:cassandra][:logback][:debug][:max_index] (default: 20): logback File appender log files max_index
  • node[:cassandra][:logback][:debug][:min_index] (default: 1): logback File appender log files min_index
  • node[:cassandra][:logback][:debug][:pattern] (default: "%-5level [%thread] %date{ISO8601} %F:%L - %msg%n"): logback File appender log pattern
  • node[:cassandra][:logback][:stdout][:enable] (default: true): enable logback STDOUT appender
  • node[:cassandra][:logback][:stdout][:pattern] (default: "%-5level %date{HH:mm:ss,SSS} %msg%n"): logback STDOUT appender log pattern
  • node[: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 pattern
  • node[:cassandra][:logback][:override_loggers] (default: {}) Override log level of specific logger (i.e { 'org.apache.cassandra.utils.StatusLogger' => 'WARN' })

Ulimit Attributes

  • node[:cassandra][:limits][:memlock] (default: "unlimited"): memory ulimit for Cassandra node process
  • node[:cassandra][:limits][:nofile] (default: 48000): file ulimit for Cassandra node process
  • node[:cassandra][:limits][:nproc] (default: "unlimited"): process ulimit for Cassandra node process

Yum Attributes

  • node[:cassandra][:yum][:repo] (default: datastax): name of the repo from which to install
  • node[:cassandra][:yum][:description] (default: "DataStax Repo for Apache Cassandra"): description of the repo
  • node[:cassandra][:yum][:baseurl] (default: "http://rpm.datastax.com/community"): repo url
  • node[:cassandra][:yum][:mirrorlist] (default: nil): a mirrorlist file
  • node[:cassandra][:yum][:gpgcheck] (default: false): whether to use gpgcheck
  • node[:cassandra][:yum][:enabled] (default: true): whether the repo is enabled by default
  • node[:cassandra][:yum][:options] (default: ""): Additional options to pass to yum_package

OpsCenter Attributes

DataStax Ops Center Server attributes

  • node[: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
 }
}

DataStax Ops Center Agent Tarball attributes

  • 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.2
  • node[: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.
  • node[:cassandra][:opscenter][:agent][:use_ssl] (default: false)

DataStax Ops Center Agent Datastax attributes

  • node[:cassandra][:opscenter][:agent][:package_name] (default: "datastax-agent" ).
  • node[: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_ssl] (default: false)

Data Center and Rack Attributes

  • node[:cassandra][:rackdc][:dc] (default: "") The datacenter to specify in the cassandra-rackdc.properties file. (GossipingPropertyFileSnitch only)
  • node[:cassandra][:rackdc][:rack] (default: "") The rack to specify in the cassandra-rackdc.properties file (GossipingPropertyFileSnitch only)
  • node[:cassandra][:rackdc][:prefer_local] (default: "false") Whether the snitch will prefer the internal ip when possible, as the Ec2MultiRegionSnitch does. (GossipingPropertyFileSnitch only)

Contributing

See CONTRIBUTING.md and TESTING.md.

Copyright & License

Michael S. Klishin, Travis CI Development Team, and contributors, 2012-2018.

Released under the Apache 2.0 License.

cassandra-chef-cookbook's People

Contributors

arturmelo avatar bgipsy avatar calebgroom avatar cevaris avatar chrishenry avatar dcparker88 avatar gansbrest avatar gennadyspb avatar iconara avatar jbyck avatar jfwm2 avatar michaelklishin avatar mihasya avatar mikebthun avatar msaffitz avatar msilvey avatar nacx avatar pauloricardomg avatar restless-et avatar rnekkanti avatar sethrosenblum avatar shortdudey123 avatar td-4242 avatar tjnicholas avatar vkhatri avatar wdauchy avatar willejs avatar williamsjj avatar wittyhandle avatar yaitskov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cassandra-chef-cookbook's Issues

Init script on Centos 6.4

When I install using the cookbook everything works until cassandra is attempting to be started and I get the following.

Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service cassandra start ----
STDOUT:
STDERR: /etc/init.d/cassandra: line 35: /lib/init/vars.sh: No such file or directory
---- End output of /sbin/service cassandra start ----
Ran /sbin/service cassandra start returned 1

Now I have confirmed that the file indeed does not exist on the server. What needs to be in this file? Do I even need it?

Multiple Changes

Hello!

I have made some changes to the cookbook, some are just an addition but some are more of a change in cookbook existing resources.

like:

  • use ulimit cookbook for ulimits, add node.cassandra.limits.nproc
  • make jna recipe configurable by an attribute
  • make datastax/tarball recipe setup configurable by an attribute, so that we would just add recipe[cassandra], configure node.cassandra.flavor = 'datastax', default tarball
  • use node.cassandra.service_name to create service & init.d template resource in tarball
  • separate cassandra user setup to a recipe and make user setup configurable by attribute, node.cassandra.setup_user = true, default false
  • add node.cassandra.group to have both user and group, current recipe uses node.cassandra.user for group ownership
  • change init.d script resource for node.patform_family instead of family
  • add RHEL platform_family init.d script
  • update bash resource which does chown -R everytime chef runs which is not required and could create problem for large data sets. when C* process is run by node.cassandra user it will create system/data other data location folders with right ownership and does not require chown -R bash resource on every chef run
  • change install/extract flow to run chown one time on extracted folder
  • update node.cassandra.cluster_name = nil, it could/would create problem if node is accidentally provisioned without correct cluster_name, though default cluster is not meant for production. But for production node provisioning one would have to spend extra time to flush the new node and would be a problem if dont know the steps (saying from experience)
  • added check for node.cassandra.cluster_name
  • removed user/group resource from datastax & tarball recipe and created a separate recipe

These changes might not add much of value to running C* cluster and would make setup a bit better.

Feedback is appreciated.

Cheers

fix foodcritic

$ foodcritic .
FC002: Avoid string interpolation where not required: ./recipes/opscenter_agent_datastax.rb:72
FC002: Avoid string interpolation where not required: ./recipes/opscenter_agent_tarball.rb:22
FC002: Avoid string interpolation where not required: ./recipes/opscenter_server.rb:61
FC003: Check whether you are running with chef server before using server-specific features: ./recipes/opscenter_agent_datastax.rb:64
FC003: Check whether you are running with chef server before using server-specific features: ./recipes/opscenter_agent_tarball.rb:31
FC019: Access node attributes in a consistent manner: ./recipes/datastax.rb:39
FC019: Access node attributes in a consistent manner: ./recipes/datastax.rb:43
FC019: Access node attributes in a consistent manner: ./recipes/datastax.rb:84
FC019: Access node attributes in a consistent manner: ./recipes/datastax.rb:109
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_agent_datastax.rb:24
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_agent_datastax.rb:27
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_agent_datastax.rb:28
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_server.rb:24
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_server.rb:27
FC019: Access node attributes in a consistent manner: ./recipes/opscenter_server.rb:28
FC023: Prefer conditional attributes: ./recipes/datastax.rb:202
FC023: Prefer conditional attributes: ./recipes/tarball.rb:144
FC023: Prefer conditional attributes: ./recipes/tarball.rb:155
FC039: Node method cannot be accessed with key: ./templates/default/cassandra-topology.properties.erb:7
FC043: Prefer new notification syntax: ./recipes/opscenter_server.rb:70

Missing depends on java

Looks like a depends for java in metadata.rb is missing.

I would expect this line at the bottom of metadata.rb

depends "java"

Not having this while installing the cookbook results in the following role:

FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2013-03-26T23:13:23+00:00] ERROR: Exception handlers complete
Chef Client failed. 4 resources updated
[2013-03-26T23:13:23+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-03-26T23:13:23+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook java not found. If you're loading java from another cookbook, make sure you configure the dependency in your metadata

Recipe stopped compiling in Chef 11

We recently upgraded our gem to chef 11 and the cookbook (which we're all really fond of) stopped working. It seems to be that the dot notation used i.e. node.cassandra.user is failing where bracket notation is working i.e. node["cassandra"]["user"]. I'm starting to refactor now. I was wondering if anyone else has reported this or not.

Regards,

Bob

[Improved] Cassandra 2.1.0 support

Before we can proceed with #107, as @vkhatri points out, there's a bunch of improvements we have to make that are 2.1.0-specific. Quoting @vkhatri from #107:

  • jna is now part of C* package, jna setup needs to be modified for backward compatibility
  • logging framework used in 2.1.0 is logback (instead of log4j), need to add template and version dependency
  • some new cassandra.yaml configuration parameters

DSE recipe installs the wrong package

While it may be possible to install dsc20 from a Datastax Enterprise Repo there is no way that the DSE cassandra can be installed and configured using the templates and recipes in this repository. There are no configuration templates for DSE services. The 'DSE' integration test does not try to install the 'dse' package either - it installs the 'dsc20' instead.

Please update the README to clearly state that the Datastax Enterprise distribution of Cassandra is NOT supported so people don't waste time trying to make it work.

Consider changing default rpc_address to "0.0.0.0"

The current setting for rpc_address is the ip address of the box.
However this prevents local clients from connecting to the server (although they will connect using the node ip address) as it won't be listening on the loopback adapter.

The init script does not work on centos

Hi,

The init script you have given in the templates directory does not work for centos as the ". /lib/init/vars.sh" , ". /lib/lsb/init-functions" , "start-stop-daemon" do not exist on centos .. We need to do a case "platform" in the recipe which them uses that particular platforms init script.

I will write a new init script for it and submit it for review later ..

Please let me know if you have any questions.

Thanks,
Raj

Bug: JAR manifest missing : /usr/share/cassandra/lib/jamm-0.2.5.jar

Hey guys,

Noticed that when installing dsc21, the log gives an error for Error opening zip file or JAR manifest missing : /usr/share/cassandra/lib/jamm-0.2.5.jar. This can be fixed by simply checking if we're using dsc21 or greater, and doing a remote_file.

Will try to make a PR now to do that, and will add tests.

FC048 should not evaluate 'system' in user and group resources

Foodcritic reads users.rb and fails on "system" keyword. FC048 has an exception for user and group resources, but only when they has a boolean value. Once node attribute assign it fails.
I opened issue in foodcritic to disable FC048 evaluation in user and group.

'2.5.0-pre' does not match 'x.y.z' or 'x.y'

When I use the latest version of the cookbook I get the following error:

[2014-07-16T22:42:59+00:00] ERROR: '2.5.0-pre' does not match 'x.y.z' or 'x.y'

Googling around it seems this value from metadata.rb is invalid?

Versions / Tags / Releases

This is a great cookbook! Do you have any plans to bump the version to 2.3? More generally, it would be really nice if you included tags for specific version releases to make it easier to use w/ chef server deploys.

You must set the CASSANDRA_CONF and CLASSPATH vars

You'll have to excuse my ignorance on this. I've been able to find zero documentation on a) what these need to be set to or b) how to set them in my cassandra recipe.

EDIT: I'm using the tarball installation. I'm overridng the version to 1.2.10 (since 9 doesn't exist in the specified location anymore).

Arch for java already determined by java cookbook

In attributes/default.rb, the java architecture is set. For i686 architectures (and above), this causes problems:

NoMethodError
-------------
undefined method `[]' for nil:NilClass

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/java/recipes/oracle.rb:38:in `from_file'
  /var/chef/cache/cookbooks/java/recipes/default.rb:28:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/java/recipes/oracle.rb:

 31:
 32:  case node['java']['jdk_version'].to_s
 33:  when "6"
 34:    tarball_url = node['java']['jdk']['6'][arch]['url']
 35:    tarball_checksum = node['java']['jdk']['6'][arch]['checksum']
 36:    bin_cmds = node['java']['jdk']['6']['bin_cmds']
 37:  when "7"
 38>>   tarball_url = node['java']['jdk']['7'][arch]['url']
 39:    tarball_checksum = node['java']['jdk']['7'][arch]['checksum']
 40:    bin_cmds = node['java']['jdk']['7']['bin_cmds']
 41:  when "8"
 42:    tarball_url = node['java']['jdk']['8'][arch]['url']
 43:    tarball_checksum = node['java']['jdk']['8'][arch]['checksum']
 44:    bin_cmds = node['java']['jdk']['8']['bin_cmds']
 45:  end
 46:
 47:  if tarball_url =~ /example.com/

The java cookbook already sets it to an appropriate value that it can handle:

default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586"

Is there any reason this line can't be removed?

p.s. This is a little bizarre of a request I know... given no one sane will be running cassandra 32bit, hah.

metadata.rb missing depends "apt"

I kept receiving the below error. Once I added depends "apt" to metadata.rb, it worked.

[2013-08-15T15:37:57+00:00] DEBUG: Line number of compile error: '23'

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/cassandra/recipes/default.rb
================================================================================


NameError
---------
Cannot find a resource for apt_repository on ubuntu version 12.04


Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/cassandra/recipes/datastax.rb:23:in `from_file'
  /var/chef/cache/cookbooks/cassandra/recipes/default.rb:1:in `from_file'


Relevant File Content:
----------------------
/var/chef/cache/cookbooks/cassandra/recipes/datastax.rb:

 16:  # See the License for the specific language governing permissions and
 17:  # limitations under the License.
 18:  #
 19:
 20:  # This recipe relies on a PPA package and is Ubuntu/Debian specific. Please
 21:  # keep this in mind.
 22:
 23>> apt_repository "datastax" do
 24:    uri          "http://debian.datastax.com/community"
 25:    distribution "precise"
 26:    components   ["main"]
 27:    key          "http://debian.datastax.com/debian/repo_key"
 28:
 29:    action :add
 30:  end
 31:
 32:  # DataStax Server Community Edition package will not install w/o this

Failed join call on seeds, seed data already joined

[2013-11-28T00:33:52+00:00] INFO: Processing template[/etc/cassandra/cassandra.yaml] action create (cassandra::tarball line 97)

================================================================
Error executing action create on resource 'template[/etc/cassandra/cassandra.yaml]'

Chef::Mixin::Template::TemplateError


undefined method `join' for "192.168.2.10,192.168.2.11,192.168.2.12":String

Resource Declaration:


In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/cassandra/recipes/tarball.rb

97: template File.join(node.cassandra.conf_dir, f) do
98: source "#{f}.erb"
99: owner node.cassandra.user
100: group node.cassandra.user
101: mode 0644
102: end
103: end

Compiled Resource:


Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/cassandra/recipes/tarball.rb:97:in `block in from_file'

template("/etc/cassandra/cassandra.yaml") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
path "/etc/cassandra/cassandra.yaml"
backup 5
source "cassandra.yaml.erb"
cookbook_name :cassandra
recipe_name "tarball"
owner "cassandra"
group "cassandra"
mode 420
end

Template Context:


on line #235
233: # Ex: ",,"
234: #- seeds: "127.0.0.1"
235: - seeds: "<%= node[:cassandra][:seeds].join(",") %>"
236:
237: # emergency pressure valve: each time heap usage after a full (CMS)

Usage os init.d script in DataStax recipe

Hi!

Just started to use your cookbook.
As far I want, I've fixed some chef issues with users and groups on Ubuntu 12.04 in my fork.
When it will finally work, I will send you pull request.

I've stumbled on setting rpc address using datastax recipe, but four that that recipe does not use init.d template at all.

Is it intentional or I can fix it in coming pull request?

Property changes in cassandra 2.0.6

Hello,

It looks like cassandra recently got updated to v2.0.6 (I am using the cassandra::tarball recipe with the "package_name": "dsc20" attribute) and there are issues when starting the service with the provided configuration template:

  • first with the row_cache_provider option
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [row_cache_provider] from your cassandra.yaml
    at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:132)
    at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:95)
    at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:135)
    at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:111)
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:153)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:471)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:560)
Invalid yaml. Please remove properties [row_cache_provider] from your cassandra.yaml
Fatal configuration error; unable to start. See log for stacktrace.
  • secondly commitlog_sync_batch_window_in_ms
ERROR 12:19:42,554 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: commitlog_sync_period_in_ms specified, but commitlog_sync_batch_window_in_ms found.  Only specify commitlog_sync_period_in_ms when using periodic sync.
    at org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:170)
    at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:111)
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:153)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:471)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:560)
commitlog_sync_period_in_ms specified, but commitlog_sync_batch_window_in_ms found.  Only specify commitlog_sync_period_in_ms when using periodic sync.
Fatal configuration error; unable to start. See log for stacktrace.

E: The method driver /usr/lib/apt/methods/https could not be found.

On a fresh install of Debian 7.4, I get the following error with the datastax recipe :

E: The method driver /usr/lib/apt/methods/https could not be found.

This comes from the datastax repository, declared with "https://debian.datastax.com/...". I see two solutions : declare the repository with http (like in the documentation) or add a dependency to apt-transport-https.

The work-around is to install apt-transport-https (manually / with chef).

Make the yum repo creation a configurable option

The part where the yum datastax repo is created-is it possible to do this only if a node attribute is setup to explicitly specify that the yum repo needs to be created. That way for those of us who have the dse rpm's hosted in our private yum repo, we get to bypass this step

syntax error in repository.rb

Hello, I'm trying to install cassandra following the instruction here https://github.com/calebgroom/vagrant-cassandra and using the following vagrant box
https://dl.dropbox.com/u/14292474/vagrantboxes/precise64-ruby-1.9.3-p194.box

While executing vagrant up I get the following error:

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb
================================================================================


SyntaxError
-----------
compile error
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:108: syntax error, unexpected ':', expecting ')'
      repo_name: new_resource.repo_name,
                ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:109: syntax error, unexpected ':', expecting '='
      description: new_resource.description,
                  ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:110: syntax error, unexpected ':', expecting '='
      url: new_resource.url,
          ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:111: syntax error, unexpected ':', expecting '='
      mirrorlist: new_resource.mirrorlist,
                 ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:112: syntax error, unexpected ':', expecting '='
      key: new_resource.key,
          ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:113: syntax error, unexpected ':', expecting '='
      enabled: new_resource.enabled,
              ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:114: syntax error, unexpected ':', expecting '='
      type: new_resource.type,
           ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:115: syntax error, unexpected ':', expecting '='
      failovermethod: new_resource.failovermethod,
                     ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:116: syntax error, unexpected ':', expecting '='
      bootstrapurl: new_resource.bootstrapurl,
                   ^
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/providers/repository.rb:117: syntax error, unexpected ':', expecting '='
      includepkgs: new_resource.includepkgs,

The box has ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Thanks in advance
Andrea

repo_name is not longer supported by yum 3.x recipe

Yum 3.0.0 release removed repo_name support

-# name of the repo, used for .repo filename
-attribute :repo_name, kind_of: String, name_attribute: true
-attribute :description, kind_of: String # long description

But we are still using it here

I think we need some check like this, or only support Yum 3.x by remove repo_name

if Chef::Resource::YumRepository.respond_to?(:repo_name)

Consider adding git tags on released versions

Would you please consider adding git tags for released versions of this cookbook (e.g. "v2.2.0")?

This makes it much easier to understand what version of a cookbook is required when adding entries to a Berksfile or Cheffile.

Compare:

cookbook "cassandra", git: "git://github.com/michaelklishin/cassandra-chef-cookbook.git", ref: "7809857663c3e8bb2e1c869120b53923b9b662ea"

vs.

cookbook "cassandra", git: "git://github.com/michaelklishin/cassandra-chef-cookbook.git", ref: "v2.2.0"

Thanks!

Thrift cookbook fails to provision

[2014-10-03T20:06:32+00:00] ERROR: remote_file[/tmp/kitchen/cache/thrift-0.9.0.tar.gz] (thrift::default line 37) had an error: Net::HTTPServerException: 404 "Not Found"
[2014-10-03T20:06:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <default-ubuntu-1404>.
>>>>>> Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-solo --config /tmp/kitchen/solo.rb --json-attributes /tmp/kitchen/dna.json  --log_level info]
>>>>>> ----------------------

Basically the thrift cookbook you are including has a broken remote file fetch attempt, that no longer links to anything and is breaking this cookbooks build. Not sure what you can do about it, other than be aware it exists.

Xmx and Xms not set via :jvm:xmx :jvm:xms

The documentation describes the following options:

node[:cassandra][:jvm][:xms](default: 32) and node[:cassandra][:jvm][:xmx](default: 512) control JVM -Xms and -Xms flag values, in megabytes (no need to add the m suffix)

However, I cannot find any place that these settings are actually used within the recipe. I am able to control the Xmx via the :max_heap_size setting.

Chef 11.10 compatibility issue

Hello,

I've just tried to install Cassandra using your recipe. Unfortunately it does not compile using Chef 11.10.4.

Here's my environment:

  • Chef-Solo: 11.10.4
  • Vagrant: 1.6.3
  • Berkshelf: 3.1.4
  • Ubuntu ubuntu-14.04

This is the error message I get while runing vagrant provision:

==> default: ================================================================================
==> default: Recipe Compile Error in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra-node/recipes/default.rb
==> default: ================================================================================
==> default:
==> default:
==> default: ArgumentError
==> default: -------------
==> default: You must supply a name when declaring a default resource
==> default:
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra/recipes/datastax.rb:23:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra/recipes/default.rb:20:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra-node/recipes/cassandra.rb:9:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra-node/recipes/default.rb:9:in `from_file'
==> default:
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra/recipes/datastax.rb:
==> default:
==> default:  16:  # See the License for the specific language governing permissions and
==> default:  17:  # limitations under the License.
==> default:  18:  #
==> default:  19:
==> default:  20:  # This recipe relies on a PPA package and is Ubuntu/Debian specific. Please
==> default:  21:  # keep this in mind.
==> default:  22:
==> default:  23>> default[:cassandra][:conf_dir] = '/etc/cassandra/'
==> default:  24:
==> default:  25:  include_recipe "java"
==> default:  26:
==> default:  27:  Chef::Application.fatal!("attribute node['cassandra']['cluster_name'] not defined") unless node.cassandra.cluster_name
==> default:  28:
==> default:  29:  include_recipe "cassandra::user" if node.cassandra.setup_user
==> default:  30:
==> default:  31:  [node.cassandra.root_dir,
==> default:  32:    node.cassandra.log_dir,
==> default:
==> default:
==> default:
==> default: [2014-08-01T15:31:18+00:00] ERROR: Running exception handlers
==> default: [2014-08-01T15:31:18+00:00] ERROR: Exception handlers complete
==> default: [2014-08-01T15:31:18+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2014-08-01T15:31:18+00:00] ERROR: You must supply a name when declaring a default resource
==> default: [2014-08-01T15:31:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

Cassandra >= 2.0 requires Java 7

When installing Cassandra 2.0, need to make sure that Java 7 is installed even if the default for the java recipe is to install Java 6.

Cassandra cluster_name needs description in README

Including the cassandra::datastax cookbook requires you to set the cluster_name attribute or else it fails with an exception. However, this attribute isn't even mentioned as existing in the README. Should be added with a mention that it's required.

Cassandra datastax installation issue

Hi,
I am trying to provision my machine with with cassandra and the datastax enteprise. I am also use vagrant to create multiple machines.

Vagrant script

(https://github.com/dholbrook/vagrant-cassandra)

chef.add_recipe "cassandra::datastax"
chef.json = {
  :java =>  {
    'install_flavor' => 'oracle',
    'jdk_version' => '7',
    'oracle' => {
      'accept_oracle_download_terms' => true
    }
  },
  :cassandra => {
    'version' => CASSANDRA_VERSION,
    'dse' => {
        'credentials' => {
            'username' => 'username',
            'password' => 'password'
        }
    },
    'seeds' => SEEDS,
    'listen_address' => n['addr'],
    'broadcast_address' => n['addr'],
    'rpc_address' => '0.0.0.0',
    'vnodes' => VNODES,
    'cluster_name' => CLUSTER_NAME  
  }  
} 

Error

ERROR: template[/etc/cassandra/cassandra.yaml] (cassandra::datastax line 181) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/cassandra does not exist.

rhel/centos package version

version node[:cassandra][:version] would be nice in datastax.rb @105:

package "#{node[:cassandra][:package_name]}" do
  action :install
end

current workaround:

chef_gem 'chef-rewind'
require 'chef/rewind'
rewind "package[#{node[:cassandra][:package_name]}]" do
  action :install
  version node[:cassandra][:version]
end

Invalid yaml (native_transport_min_threads & native_transport_max_threads)

Getting an issue provisioning since the latest commit (b818e3c)

Commenting out native_transport_min_threads and native_transport_max_threads fixes the issue.

ERROR [main] 2014-12-03 16:29:36,574 DatabaseDescriptor.java (line 116) Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [native_transport_min_threads] from your cassandra.yaml
    at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:132)
    at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:95)
    at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:135)
    at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:111)
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:156)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)

Cassandra fails to restart after setting the cluster name

Hello there,

I've set up a small Cassandra Cluster using your cookbook. I'm using the default datastax installation method to install Cassandra 2. Unfortunately, I ran into a problem when setting a custom cluster name:

node.set[:cassandra][:cluster_name] = 'my-little-cassandra-cluster'
node.set[:cassandra][:start_native_transport] = true
...
include_recipe 'cassandra::default'

Here's my environment:

Chef: 11.10.4
Vagrant: 1.6.3 and Current Opsworks stack
Berkshelf: 3.1.4
Ubuntu ubuntu-14.04

When deploying Cassandra on my node, the installation works as expected. But when rebooting Cassandra to activate the changes (or with node[:cassandra][:notify_restart] enabled), Cassandra dies after the restart. The logs contain the following Stacktrace:

ERROR [main] 2014-08-08 11:12:56,619 CassandraDaemon.java (line 265) Fatal exception during initialization
org.apache.cassandra.exceptions.ConfigurationException: Saved cluster name Test Cluster != configured name hockey-telemetry-cassandra
        at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:564)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)

As far as I can tell the problem is caused by Cassandra being started automatically after installing the .deb-package. Therefore, the cluster-name is alrady set to "Test Cluster" and changing it results in the error above.

I've found a way to circumvent this problem, but it feels like a hack to me:

# Work around cassandra starting with the wrong cluster name
execute 'cqlsh' do
  command %(
  listen_address = `lsof -iTCP:#{node[:cassandra][:rpc_port]} -sTCP:LISTEN -n -F n | grep -oE "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"`
  cqlsh $listen_address -e "update system.local set cluster_name='#{node[:cassandra][:cluster_name]}' where key='local';"
  nodetool flush
  )

  not_if %(cqlsh #{node[:ipaddress]} -e 'select cluster_name from system.local' | grep #{node[:cassandra][:cluster_name]}$)

  action :run
end

Is there any way you can prevent Cassandra from starting before deploying the config file?

Cheers,
pfleidi

RFC: put all template values into attributes

The cassandra.yaml file is heavily templated and has many hard coded values in it. The config file is large, and has many possible values and combinations.

I don't want to submit a bunch of pull requests for these, and i don't care about the comments in the file either. (Others might care about these comments, we can put them into the config.rb attributes file if people wish.)

I am proposing that we do away with the keys, and comments in the erb template and instead generate the yaml from a hash in the attributes.

This way we can easily manage the hundred or so config values in attributes, and add additional settings that are not in the template that can be set.

What are peoples thoughts on this? I will get to work on a PR if people are in agreement.

Use of incorrect cookbook version format prevents berkshelf from being able to install the cookbook

Getting the following error while attempting to use berkshelf to install this cookbook. The reason why is the current version of the cookbook is 2.5.0.pre when really it should be 2.5.0-pre in order to conform with the Chef cookbook versioning standard (see this Berkshelf issue).

wasted:womply-kitchen brent$ berks
Resolving cookbook dependencies...
Fetching 'cassandra' from https://github.com/michaelklishin/cassandra-chef-cookbook.git (at master)
/Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/semverse-1.1.0/lib/semverse/version.rb:29:in `split': '2.5.0.pre' did not contain a valid version string: 'x.y.z' or 'x.y'. (Semverse::InvalidVersionFormat)
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/semverse-1.1.0/lib/semverse/version.rb:64:in `initialize'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/semverse-1.1.0/lib/semverse/version.rb:10:in `new'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/semverse-1.1.0/lib/semverse/version.rb:10:in `coerce'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/semverse-1.1.0/lib/semverse/constraint.rb:240:in `satisfies?'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/locations/base.rb:64:in `validate_cached!'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/locations/git.rb:67:in `install'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:179:in `block in download_locations'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:176:in `each'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:176:in `download_locations'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:149:in `install_from_universe'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:39:in `run'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:371:in `install'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:143:in `install'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:52:in `dispatch'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:27:in `execute!'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/gems/berkshelf-3.1.3/bin/berks:5:in `<top (required)>'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/bin/berks:23:in `load'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/bin/berks:23:in `<main>'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/bin/ruby_executable_hooks:15:in `eval'
        from /Users/brent/.rvm/gems/ruby-2.0.0-p451@womply-kitchen-gemset/bin/ruby_executable_hooks:15:in `<main>'

Default recipe wants `--force-yes` to install 1.2.9

This appears to be the error:
STDERR: E: There are problems and -y was used without --force-yes

[2013-10-22T21:26:52+00:00] DEBUG: package[cassandra] current version is 2.0.1
[2013-10-22T21:26:52+00:00] DEBUG: package[cassandra] candidate version is 2.0.1
[2013-10-22T21:26:52+00:00] DEBUG: Executing apt-get -q -y install cassandra=1.2.9
[2013-10-22T21:26:53+00:00] DEBUG: ---- Begin output of apt-get -q -y install cassandra=1.2.9 ----
[2013-10-22T21:26:53+00:00] DEBUG: STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
jsvc libcommons-daemon-java
Suggested packages:
java-virtual-machine
The following NEW packages will be installed:
jsvc libcommons-daemon-java
The following packages will be DOWNGRADED:
cassandra
0 upgraded, 2 newly installed, 1 downgraded, 0 to remove and 83 not upgraded.
Need to get 13.8 MB of archives.
After this operation, 87.0 kB disk space will be freed.
[2013-10-22T21:26:53+00:00] DEBUG: STDERR: E: There are problems and -y was used without --force-yes
[2013-10-22T21:26:53+00:00] DEBUG: ---- End output of apt-get -q -y install cassandra=1.2.9 ----
[2013-10-22T21:26:53+00:00] DEBUG: Ran apt-get -q -y install cassandra=1.2.9 returned 100

================================================================================
Error executing action install on resource 'package[cassandra]'

Chef::Exceptions::Exec


apt-get -q -y install cassandra=1.2.9 returned 100, expected 0
---- Begin output of apt-get -q -y install cassandra=1.2.9 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
jsvc libcommons-daemon-java
Suggested packages:
java-virtual-machine
The following NEW packages will be installed:
jsvc libcommons-daemon-java
The following packages will be DOWNGRADED:
cassandra
0 upgraded, 2 newly installed, 1 downgraded, 0 to remove and 83 not upgraded.
Need to get 13.8 MB of archives.
After this operation, 87.0 kB disk space will be freed.STDERR: E: There are problems and -y was used without --force-yes
---- End output of apt-get -q -y install cassandra=1.2.9 ----

Resource Declaration:


In /root/chef-solo/cookbooks-1/cassandra/recipes/datastax.rb

69:     package "cassandra" do
70:       action :install
71:       version node[:cassandra][:version]
72:     end
73:   end

Compiled Resource:


Declared in /root/chef-solo/cookbooks-1/cassandra/recipes/datastax.rb:69:in `from_file'

package("cassandra") do
action [:install]
retries 0
retry_delay 2
package_name "cassandra"
version "1.2.9"
cookbook_name :cassandra
recipe_name "datastax"
end

[2013-10-22T21:26:53+00:00] INFO: Running queued delayed notifications before re-raising exception
[2013-10-22T21:26:53+00:00] DEBUG: Re-raising exception: Chef::Exceptions::Exec - package[cassandra](cassandra::datastax line 69) had an error: Chef::Exceptions::Exec: apt-get -q -y install cassandra=1.2.9 returned 100, expected 0

cassandra rpm puts configs in soft linked directory for centos

And possibly other distros.
The import part of the rpm script install is this
alternatives --install /etc/cassandra/conf cassandra /etc/cassandra/default.conf/ 0

The cookbook installs the yaml file to /etc/cassandra/cassandra.yaml and the rpm init script look at

export CASSANDRA_CONF=/etc/cassandra/conf

[root@cass01 cassandra]# ls -sl /etc/cassandra/
total 48K
 12K -rw-r--r-- 1 cassandra cassandra 9.5K Aug  7 01:57 cassandra-env.sh
 32K -rw-r--r-- 1 cassandra cassandra  31K Aug  7 01:57 cassandra.yaml
   0 lrwxrwxrwx 1 root      root        27 Aug  7 01:54 conf -> /etc/alternatives/cassandra
4.0K drwxr-xr-x 2 cassandra cassandra 4.0K Aug  7 02:00 default.conf

rpm -q --scripts cassandra output

preinstall scriptlet (using /bin/sh):
getent group cassandra >/dev/null || groupadd -r cassandra
getent passwd cassandra >/dev/null || \
useradd -d /usr/share/cassandra -g cassandra -M -r cassandra
exit 0
postinstall scriptlet (using /bin/sh):
alternatives --install /etc/cassandra/conf cassandra /etc/cassandra/default.conf/ 0
# alternatives --install /etc/default/cassandra cassandra /etc/cassandra/default.conf/cassandra.default 0
cd /usr/share/cassandra/lib
grep "release 5" /etc/redhat-release > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
  # Put old snappy file in place for old Linux distros. Basically
  # rename the newer version out of the way.
  if [ -f snappy-java-1.0.5.jar ]; then
    if [ -f snappy-java-1.0.5.jar.backup ]; then
      /bin/rm -f snappy-java-1.0.5.jar.backup
    fi
    /bin/mv snappy-java-1.0.5.jar snappy-java-1.0.5.jar.backup
  fi
else
  # Move old version of snappy out of the way on modern Linux versions
  if [ -f snappy-java-1.0.5.jar ]; then
    if [ -f snappy-java-1.0.4.1.jar ]; then
      if [ -f snappy-java-1.0.4.1.jar.backup ]; then
        /bin/rm -f snappy-java-1.0.4.1.jar.backup
      fi
      /bin/mv snappy-java-1.0.4.1.jar snappy-java-1.0.4.1.jar.backup
    fi
  fi
fi
exit 0
preuninstall scriptlet (using /bin/sh):
# only delete alternative on removal, not upgrade
if [ "$1" = "0" ]; then
    alternatives --remove cassandra /etc/cassandra/default.conf/
fi
if [ "$1" = "0" ]; then
  # restore original snappy files so package management is happy on removal
  cd /usr/share/cassandra/lib
  if [ -f snappy-java-1.0.5.jar.backup ]; then
    if [ -f snappy-java-1.0.5.jar ]; then
      /bin/rm -f snappy-java-1.0.5.jar
    fi
    /bin/mv snappy-java-1.0.5.jar.backup snappy-java-1.0.5.jar
  fi
  if [ -f snappy-java-1.0.4.1.jar.backup ]; then
    if [ -f snappy-java-1.0.4.1.jar ]; then
      /bin/rm -f snappy-java-1.0.4.1.jar
    fi
    /bin/mv snappy-java-1.0.4.1.jar.backup snappy-java-1.0.4.1.jar
  fi
fi
exit 0

Incorrect yum release specified for 2.0.8 RPM

The yum RPM package for dsc20 has a release of 2 instead of 1 so it yum package installation fails.

[ec2-user@cassandra1 ~]$ yum info dsc20
Available Packages
Name        : dsc20
Arch        : noarch
Version     : 2.0.8
Release     : 2
Size        : 1.6 k
Repo        : datastax
Summary     : Meta RPM for installation of the DataStax DSC platform
URL         : http://www.datastax.com/products/community
License     : ASL 2.0
Description : DataStax Community Edition is a free packaged distribution of the Apache
            : Cassandra database.
            :
            : This package depends on the other components of DSC.

Invalid yaml when installing dsc v2.1.2

After installing using the default recipe the cassandra service fails to start. Upon closer inspection of the logs, it is throwing an exception.

My attributes:

default[:cassandra][:cluster_name] = 'ClusterName'
default[:cassandra][:version] = '2.1.2'
default[:cassandra][:package_name] = 'dsc21'
default[:cassandra][:setup_jamm] = true

Error:

Invalid yaml. Please remove properties [multithreaded_compaction, memtable_flush_queue_size, compaction_preheat_key_cache, in_memory_compaction_limit_in_mb] from your cassandra.yaml

Trace:

ERROR [main] 2014-11-19 04:45:53,433 DatabaseDescriptor.java:138 - Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [multithreaded_compaction, memtable_flush_queue_size, compaction_preheat_key_cache, in_memory_compaction_limit_in_mb] from your cassandra.yaml
        at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:162) ~[apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:115) ~[apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:84) ~[apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:158) ~[apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133) ~[apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:96) [apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:448) [apache-cassandra-2.1.2.jar:2.1.2]
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:537) [apache-cassandra-2.1.2.jar:2.1.2]

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.