diff --git a/REFERENCE.md b/REFERENCE.md new file mode 100644 index 0000000..bc2b30a --- /dev/null +++ b/REFERENCE.md @@ -0,0 +1,1869 @@ +# Reference + + +## Table of Contents + +**Classes** + +* [`cassandra`](#cassandra): A class for installing the Cassandra package and manipulate settings in the configuration file. +* [`cassandra::apache_repo`](#cassandraapache_repo): An optional class that will allow a suitable repository to be configured from which packages for Apache Cassandra can be downloaded. +* [`cassandra::datastax_agent`](#cassandradatastax_agent): A class for installing the DataStax Agent and to point it at an OpsCenter instance. +* [`cassandra::datastax_repo`](#cassandradatastax_repo): An optional class that will allow a suitable repository to be configured from which packages for DataStax Community can be downloaded. Chang +* [`cassandra::dse`](#cassandradse): A class for configuring DataStax Enterprise (DSE) specific settings. +* [`cassandra::firewall_ports`](#cassandrafirewall_ports): An optional class to configure incoming network ports on the host that are relevant to the Cassandra installation. If firewalls are being ma +* [`cassandra::java`](#cassandrajava): A class to install Java and JNA packages. +* [`cassandra::optutils`](#cassandraoptutils): A class to install the optional Cassandra tools package. +* [`cassandra::params`](#cassandraparams): This class is meant to be called from the locp-cassandra module. It sets variables according to platform. +* [`cassandra::schema`](#cassandraschema): A class to maintain the database schema. Please note that cqlsh expects Python 2.7 to be installed. This may be a problem of older distributions (CentOS 6 for example). +* [`cassandra::system::swapoff`](#cassandrasystemswapoff): Disable swap on the node as suggested at http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html +* [`cassandra::system::sysctl`](#cassandrasystemsysctl): Set Sysctl (kernel runtime parameters) as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.htm +* [`cassandra::system::transparent_hugepage`](#cassandrasystemtransparent_hugepage): Disable Transparant Huge Pages as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html. + +**Defined types** + +* [`cassandra::file`](#cassandrafile): A defined type for altering files relative to the configuration directory. +* [`cassandra::private::firewall_ports::rule`](#cassandraprivatefirewall_portsrule): A defined type to be used as a macro for setting host based firewall rules. This is not intended to be used by a user (who should use the AP +* [`cassandra::schema::cql_type`](#cassandraschemacql_type): Create or drop user defined data types within the schema. +* [`cassandra::schema::index`](#cassandraschemaindex): Create or drop indexes within the schema. +* [`cassandra::schema::keyspace`](#cassandraschemakeyspace): Create or drop keyspaces within the schema. +* [`cassandra::schema::permission`](#cassandraschemapermission): Grant or revoke permissions. To use this class, a suitable `authenticator` (e.g. PasswordAuthenticator) and `authorizer` (e.g. CassandraAutho +* [`cassandra::schema::table`](#cassandraschematable): Create or drop tables within the schema. +* [`cassandra::schema::user`](#cassandraschemauser): Create or drop users. To use this class, a suitable `authenticator` (e.g. PasswordAuthenticator) must be set in the Cassandra class. + +## Classes + +### cassandra + +A class for installing the Cassandra package and manipulate settings in the +configuration file. + +#### Parameters + +The following parameters are available in the `cassandra` class. + +##### `baseline_settings` + +Data type: `hash` + +If set, this is a baseline of settings that +are merged with the `settings` hash. The values of the `settings` +hash overriding the values in this hash. This is most useful when used +with hiera. + +Default value: {} + +##### `cassandra_2356_sleep_seconds` + +Data type: `boolean` + +This will provide a workaround for +[CASSANDRA-2356](https://issues.apache.org/jira/browse/CASSANDRA-2356) by +sleeping for the specifed number of seconds after an event involving the +Cassandra package. This option is silently ignored on the Red Hat family +of operating systems as this bug only affects Debian systems. + +Default value: 5 + +##### `cassandra_9822` + +Data type: `boolean` + +If set to true, this will apply a patch to the init +file for the Cassandra service as a workaround for +[CASSANDRA-9822](https://issues.apache.org/jira/browse/CASSANDRA-9822). +This this bug only affects Debian systems. + +Default value: `false` + +##### `cassandra_yaml_tmpl` + +Data type: `string` + +The path to the Puppet template for the +Cassandra configuration file. This allows the user to supply their own +customized template.` + +Default value: 'cassandra/cassandra.yaml.erb' + +##### `commitlog_directory` + +Data type: `string` + +The path to the commitlog directory. +If set, the directory will be managed as a Puppet resource. Do not +specify a value here and in the `settings` hash as they are mutually +exclusive. + +Default value: `undef` + +##### `commitlog_directory_mode` + +Data type: `string` + +The mode for the +`commitlog_directory` is ignored unless `commitlog_directory` is +specified. + +Default value: '0750' + +##### `manage_config_file` + +Data type: `Boolean` + +Whether or not to manage the cassandra configuration +file. + +Default value: `true` + +##### `config_file_mode` + +Data type: `string` + +The permissions mode of the cassandra configuration +file. + +Default value: '0644' + +##### `config_path` + +Data type: `string` + +The path to the cassandra configuration file. + +Default value: $::cassandra::params::config_path + +##### `data_file_directories` + +Data type: `array` + +The path(s) to the date directory or +directories. +If set, the directories will be managed as a Puppet resource. Do not +specify a value here and in the `settings` hash as they are mutually +exclusive. + +Default value: `undef` + +##### `data_file_directories_mode` + +Data type: `string` + +The mode for the +`data_file_directories` is ignored unless `data_file_directories` is +specified. + +Default value: '0750' + +##### `dc` + +Data type: `string` + +Sets the value for dc in *config_path*/*snitch_properties_file* +http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html +for more details. + +Default value: 'DC1' + +##### `dc_suffix` + +Data type: `string` + +Sets the value for dc_suffix in +*config_path*/*snitch_properties_file* see +http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html +for more details. If the value is *undef* then no change will be made to +the snitch properties file for this setting. + +Default value: `undef` + +##### `fail_on_non_supported_os` + +Data type: `boolean` + +A flag that dictates if the module should +fail if it is not RedHat or Debian. If you set this option to false then +you must also at least set the `config_path` attribute as well. + +Default value: `true` + +##### `hints_directory` + +Data type: `string` + +The path to the hints directory. +If set, the directory will be managed as a Puppet resource. Do not +specify a value here and in the `settings` hash as they are mutually +exclusive. Do not set this option in Cassandra versions before 3.0.0. + +Default value: `undef` + +##### `hints_directory_mode` + +Data type: `string` + +The mode for the +`hints_directory` is ignored unless `hints_directory` is +specified. + +Default value: '0750' + +##### `package_ensure` + +Data type: `present|latest|string` + +The status of the package specified in +**package_name**. Can be *present*, *latest* or a specific version +number. + +Default value: 'present' + +##### `package_name` + +Data type: `string` + +The name of the Cassandra package which must be available +from a repository. + +Default value: $::cassandra::params::cassandra_pkg + +##### `prefer_local` + +Data type: `boolean` + +Sets the value for prefer_local in +*config_path*/*snitch_properties_file* see +http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html +for more details. Valid values are true, false or *undef*. If the value +is *undef* then change will be made to the snitch properties file for +this setting. + +Default value: `undef` + +##### `rack` + +Data type: `string` + +Sets the value for rack in +*config_path*/*snitch_properties_file* see +http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html +for more details. + +Default value: 'RAC1' + +##### `rackdc_tmpl` + +Data type: `string` + +The template for creating the snitch properties file. + +Default value: 'cassandra/cassandra-rackdc.properties.erb' + +##### `saved_caches_directory` + +Data type: `string` + +The path to the saved caches directory. +If set, the directory will be managed as a Puppet resource. Do not +specify a value here and in the `settings` hash as they are mutually +exclusive. + +Default value: `undef` + +##### `saved_caches_directory_mode` + +Data type: `string` + +The mode for the +`saved_caches_directory` is ignored unless `saved_caches_directory` is +specified. + +Default value: '0750' + +##### `service_enable` + +Data type: `boolean` + +enable the Cassandra service to start at boot time. + +Default value: `true` + +##### `service_ensure` + +Data type: `string` + +Ensure the Cassandra service is running. Valid values +are running or stopped. + +Default value: `undef` + +##### `service_name` + +Data type: `string` + +The name of the service that runs the Cassandra software. + +Default value: 'cassandra' + +##### `service_provider` + +Data type: `string` + +The name of the provider that runs the service. +If left as *undef* then the OS family specific default will +be used, otherwise the specified value will be used instead. + +Default value: `undef` + +##### `service_refresh` + +Data type: `boolean` + +If set to true, changes to the Cassandra config file +or the data directories will ensure that Cassandra service is refreshed +after the changes. Setting this flag to false will disable this +behaviour, therefore allowing the changes to be made but allow the user +to control when the service is restarted. + +Default value: `true` + +##### `settings` + +Data type: `hash` + +A hash that is passed to `to_yaml` which dumps the results +to the Cassandra configuring file. The minimum required settings for +Cassandra 2.X are as follows: + +```puppet + { + 'authenticator' => 'PasswordAuthenticator', + 'cluster_name' => 'MyCassandraCluster', + 'commitlog_directory' => '/var/lib/cassandra/commitlog', + 'commitlog_sync' => 'periodic', + 'commitlog_sync_period_in_ms' => 10000, + 'data_file_directories' => ['/var/lib/cassandra/data'], + 'endpoint_snitch' => 'GossipingPropertyFileSnitch', + 'listen_address' => $::ipaddress, + 'partitioner' => 'org.apache.cassandra.dht.Murmur3Partitioner', + 'saved_caches_directory' => '/var/lib/cassandra/saved_caches', + 'seed_provider' => [ + { + 'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider', + 'parameters' => [ + { + 'seeds' => $::ipaddress, + }, + ], + }, + ], + 'start_native_transport' => true, + } +``` +For Cassandra 3.X you will also need to specify the `hints_directory` +attribute. + +Default value: {} + +##### `snitch_properties_file` + +Data type: `string` + +The name of the snitch properties file. The +full path name would be *config_path*/*snitch_properties_file*. + +Default value: 'cassandra-rackdc.properties' + +##### `systemctl` + +Data type: `string` + +The full path to the systemctl command. Only +needed when the package is installed. Will silently continue if the +executable does not exist. + +Default value: $::cassandra::params::systemctl + +### cassandra::apache_repo + +An optional class that will allow a suitable repository to be configured +from which packages for Apache Cassandra can be downloaded. + +#### Parameters + +The following parameters are available in the `cassandra::apache_repo` class. + +##### `descr` + +Data type: `string` + +On the Red Hat family, this is passed as the `descr` +attribute to a `yumrepo` resource. On the Debian family, it is passed as +the `comment` attribute to an `apt::source` resource. + +Default value: 'Repo for Apache Cassandra' + +##### `key_id` + +Data type: `string` + +On the Debian family, this is passed as the `id` +attribute to an `apt::key` resource. On the Red Hat family, it is +ignored. + +Default value: 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA' + +##### `key_url` + +Data type: `string` + +On the Debian family, this is passed as the +`source` attribute to an `apt::key` resource. On the Red Hat family, +it is set to the `gpgkey` attribute on the `yumrepo` resource. + +Default value: 'https://www.apache.org/dist/cassandra/KEYS' + +##### `pkg_url` + +Data type: `string` + +On the Red Hat family, leaving this as default will +set the `baseurl` on the `yumrepo` resource to +'http://www.apache.org/dist/cassandra/redhat' with whatever is set in the +'release' attribute appended. +On the Debian family, leaving this as the default +will set the `location` attribute on an `apt::source` to +'http://www.apache.org/dist/cassandra/debian'. + +Default value: `undef` + +##### `release` + +Data type: `string` + +On the Debian family, this is passed as the `release` +attribute to an `apt::source` resource. On the Red Hat family, it is the +major version number of Cassandra, without dot, and with an appended 'x' +(e.g. '311x') + +Default value: 'main' + +### cassandra::datastax_agent + +A class for installing the DataStax Agent and to point it at an OpsCenter +instance. + +#### Examples + +##### Set agent_alias to foobar, stomp_interface to localhost and ensure that async_pool_size is absent from the file. + +```puppet +class { 'cassandra::datastax_agent': + settings => { + 'agent_alias' => { + 'setting' => 'agent_alias', + 'value' => 'foobar', + }, + 'stomp_interface' => { + 'setting' => 'stomp_interface', + 'value' => 'localhost', + }, + 'async_pool_size' => { + 'ensure' => absent, + }, + }, +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::datastax_agent` class. + +##### `address_config_file` + +Data type: `Any` + +The full path to the address config file. + +Default value: '/var/lib/datastax-agent/conf/address.yaml' + +##### `defaults_file` + +Data type: `Any` + +The full path name to the file where `java_home` is set. + +Default value: '/etc/default/datastax-agent' + +##### `java_home` + +Data type: `Any` + +If the value of this variable is left as *undef*, no +action is taken. Otherwise the value is set as JAVA_HOME in +`defaults_file`. + +Default value: `undef` + +##### `package_ensure` + +Data type: `Any` + +Is passed to the package reference. Valid values are +**present** or a version number. + +Default value: 'present' + +##### `package_name` + +Data type: `Any` + +Is passed to the package reference. + +Default value: 'datastax-agent' + +##### `service_ensure` + +Data type: `Any` + +Is passed to the service reference. + +Default value: 'running' + +##### `service_enable` + +Data type: `Any` + +Is passed to the service reference. + +Default value: `true` + +##### `service_name` + +Data type: `Any` + +Is passed to the service reference. + +Default value: 'datastax-agent' + +##### `service_provider` + +Data type: `Any` + +The name of the provider that runs the service. +If left as *undef* then the OS family specific default will be used, +otherwise the specified value will be used instead. + +Default value: `undef` + +##### `settings` + +Data type: `Any` + +A hash that is passed to +[create_ini_settings] +(https://github.com/puppetlabs/puppetlabs-inifile#function-create_ini_settings) +with the following additional defaults: + +```puppet +{ + path => $address_config_file, + key_val_separator => ': ', + require => Package[$package_name], + notify => Service['datastax-agent'], +} +``` + +Default value: {} + +### cassandra::datastax_repo + +An optional class that will allow a suitable repository to be configured +from which packages for DataStax Community can be downloaded. Changing +the defaults will allow any Debian Apt or Red Hat Yum repository to be +configured. + +#### Parameters + +The following parameters are available in the `cassandra::datastax_repo` class. + +##### `descr` + +Data type: `string` + +On the Red Hat family, this is passed as the `descr` +attribute to a `yumrepo` resource. On the Debian family, it is passed as +the `comment` attribute to an `apt::source` resource. + +Default value: 'DataStax Repo for Apache Cassandra' + +##### `key_id` + +Data type: `string` + +On the Debian family, this is passed as the `id` +attribute to an `apt::key` resource. On the Red Hat family, it is +ignored. + +Default value: '7E41C00F85BFC1706C4FFFB3350200F2B999A372' + +##### `key_url` + +Data type: `string` + +On the Debian family, this is passed as the +`source` attribute to an `apt::key` resource. On the Red Hat family, +it is ignored. + +Default value: 'http://debian.datastax.com/debian/repo_key' + +##### `pkg_url` + +Data type: `string` + +If left as the default, this will set the `baseurl` +to 'http://rpm.datastax.com/community' on a `yumrepo` resource +on the Red Hat family. On the Debian family, leaving this as the default +will set the `location` attribute on an `apt::source` to +'http://debian.datastax.com/community'. + +Default value: `undef` + +##### `release` + +Data type: `string` + +On the Debian family, this is passed as the `release` +attribute to an `apt::source` resource. On the Red Hat family, it is +ignored. + +Default value: 'stable' + +### cassandra::dse + +A class for configuring DataStax Enterprise (DSE) specific settings. + +#### Examples + +##### Configure a cluster with LDAP authentication + +```puppet +class { 'cassandra::dse': + file_lines => { + 'Set HADOOP_LOG_DIR directory' => { + ensure => present, + path => '/etc/dse/dse-env.sh', + line => 'export HADOOP_LOG_DIR=/var/log/hadoop', + match => '^# export HADOOP_LOG_DIR=', + }, + 'Set DSE_HOME' => { + ensure => present, + path => '/etc/dse/dse-env.sh', + line => 'export DSE_HOME=/usr/share/dse', + match => '^#export DSE_HOME', + }, + }, + settings => { + ldap_options => { + server_host => localhost, + server_port => 389, + search_dn => 'cn=Admin', + search_password => secret, + use_ssl => false, + use_tls => false, + truststore_type => jks, + user_search_base => 'ou=users,dc=example,dc=com', + user_search_filter => '(uid={0})', + credentials_validity_in_ms => 0, + connection_pool => { + max_active => 8, + max_idle => 8, + } + } + } +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::dse` class. + +##### `config_file` + +Data type: `string` + +The full path to the DSE configuration file. + +Default value: '/etc/dse/dse.yaml' + +##### `config_file_mode` + +Data type: `string` + +The mode for the DSE configuration file. + +Default value: '0644' + +##### `dse_yaml_tmpl` + +Data type: `string` + +A path to a template for the `dse.yaml` file. + +Default value: 'cassandra/dse.yaml.erb' + +##### `file_lines` + +Data type: `hash` + +A hash of values that are passed to +`create_resources` as a `file_line` resource. + +Default value: `undef` + +##### `service_refresh` + +Data type: `boolean` + +Whether or not the Cassandra service +should be refreshed if the DSE configuration files are changed. + +Default value: `true` + +##### `settings` + +Data type: `hash` + +Unless this attribute is set to a hash (which is +then placed as YAML inside `dse.yaml`) then the `dse.yaml` is left +unchanged. + +Default value: `undef` + +### cassandra::firewall_ports + +An optional class to configure incoming network ports on the host that are +relevant to the Cassandra installation. If firewalls are being managed +already, simply do not include this module in your manifest. + +IMPORTANT: The full list of which ports should be configured is assessed at +evaluation time of the configuration. Therefore if one is to use this class, +it must be the final cassandra class included in the manifest. + +#### Parameters + +The following parameters are available in the `cassandra::firewall_ports` class. + +##### `client_ports` + +Data type: `array` + +Only has any effect if the `cassandra` class is defined on the node. +Allow these TCP ports to be opened for traffic coming from the client +subnets. + +Default value: [9042, 9160] + +##### `client_subnets` + +Data type: `array` + +Only has any effect if the `cassandra` class is defined on the node. +An array of the list of subnets that are to allowed connection to +cassandra::native_transport_port and cassandra::rpc_port. + +Default value: ['0.0.0.0/0'] + +##### `inter_node_ports` + +Data type: `array` + +Only has any effect if the `cassandra` class is defined on the node. +Allow these TCP ports to be opened for traffic between the Cassandra nodes. + +Default value: [7000, 7001, 7199] + +##### `inter_node_subnets` + +Data type: `array` + +Only has any effect if the `cassandra` class is defined on the node. +An array of the list of subnets that are to allowed connection to +`cassandra::storage_port`, `cassandra::ssl_storage_port` and port 7199 +for cassandra JMX monitoring. + +Default value: ['0.0.0.0/0'] + +##### `public_ports` + +Data type: `array` + +Allow these TCP ports to be opened for traffic +coming from public subnets the port specified in `$ssh_port` will be +appended to this list. + +Default value: [8888] + +##### `public_subnets` + +Data type: `array` + +An array of the list of subnets that are to allowed connection to +cassandra::firewall_ports::ssh_port. + +Default value: ['0.0.0.0/0'] + +##### `ssh_port` + +Data type: `integer` + +Which port does SSH operate on. + +Default value: 22 + +##### `opscenter_ports` + +Data type: `array` + +Only has any effect if the `cassandra::datastax_agent` is defined. +Allow these TCP ports to be opened for traffic coming to or from OpsCenter +appended to this list. + +Default value: [9042, 9160, 61620, 61621] + +##### `opscenter_subnets` + +Data type: `array` + +A list of subnets that are to be allowed connection to +port 61621 for nodes built with cassandra::datastax_agent. + +Default value: ['0.0.0.0/0'] + +### cassandra::java + +A class to install Java and JNA packages. + +#### Parameters + +The following parameters are available in the `cassandra::java` class. + +##### `aptkey` + +Data type: `hash` + +If supplied, this should be a hash of `apt::key` +resources that will be passed to the create_resources function. +This is ignored on non-Debian systems. + +Default value: `undef` + +##### `aptsource` + +Data type: `hash` + +If supplied, this should be a hash of +`apt::source` resources that will be passed to the create_resources +function. This is ignored on non-Red Hat` + +Default value: `undef` + +##### `jna_ensure` + +Data type: `string` + +Is passed to the package reference for the JNA +package. Valid values are `present` or a version number. + +Default value: present + +##### `jna_package_name` + +Data type: `string` + +The name of the JNA package. + +Default value: $::cassandra::params::jna_package_name + +##### `package_ensure` + +Data type: `string` + +Is passed to the package reference for the JRE/JDK +package. Valid values are `present` or a version number. + +Default value: present + +##### `package_name` + +Data type: `string` + +The name of the Java package to be installed. + +Default value: $::cassandra::params::java_package + +##### `yumrepo` + +Data type: `hash` + +If supplied, this should be a hash of *yumrepo* +resources that will be passed to the create_resources function. +This is ignored on non-Red Hat systems. + +Default value: `undef` + +### cassandra::optutils + +A class to install the optional Cassandra tools package. + +#### Parameters + +The following parameters are available in the `cassandra::optutils` class. + +##### `package_ensure` + +Data type: `string` + +Can be `present`, `latest` or a specific +version number. + +Default value: 'present' + +##### `package_name` + +Data type: `string` + +The name of the optional utilities package to +be installed. + +Default value: $::cassandra::params::optutils_package_name + +### cassandra::params + +This class is meant to be called from the locp-cassandra module. +It sets variables according to platform. + +### cassandra::schema + +A class to maintain the database schema. Please note that cqlsh expects Python 2.7 to be installed. This may be a problem of older distributions (CentOS 6 for example). + +#### Parameters + +The following parameters are available in the `cassandra::schema` class. + +##### `connection_tries` + +Data type: `integer` + +How many times do try to connect to +Cassandra. See also `connection_try_sleep`. + +Default value: 6 + +##### `connection_try_sleep` + +Data type: `integer` + +How much time to allow between the +number of tries specified in `connection_tries`. + +Default value: 30 + +##### `cql_types` + +Data type: `hash` + +Creates new `cassandra::schema::cql_type` resources. + +Default value: {} + +##### `cqlsh_additional_options` + +Data type: `string` + +Any additional options to be passed +to the `cqlsh` command. + +Default value: '' + +##### `cqlsh_client_config` + +Data type: `string` + +Set this to a file name +(e.g. '/root/.puppetcqlshrc') that will then be used to contain the +the credentials for connecting to Cassandra. This is a more secure option +than having the credentials appearing on the command line. This option +is only available in Cassandra >= 2.1. + +Default value: `undef` + +##### `cqlsh_client_tmpl` + +Data type: `string` + +The location of the template for configuring +the credentials for the cqlsh client. This is ignored unless +`cqlsh_client_config` is set. + +Default value: 'cassandra/cqlshrc.erb' + +##### `cqlsh_command` + +Data type: `string` + +The full path to the `cqlsh` command. + +Default value: '/usr/bin/cqlsh' + +##### `cqlsh_host` + +Data type: `string` + +The host for the `cqlsh` command to connect to. +See also `cqlsh_port`. + +Default value: 'localhost' + +##### `cqlsh_password` + +Data type: `string` + +If credentials are require for connecting, +specify the password here. See also `cqlsh_user`, `cqlsh_client_config`. + +Default value: `undef` + +##### `cqlsh_port` + +Data type: `integer` + +The host for the `cqlsh` command to connect to. +See also `cqlsh_host`. + +Default value: 9042 + +##### `cqlsh_user` + +Data type: `string` + +If credentials are required for connecting, +specify the password here. See also `cqlsh_password`, +`cqlsh_client_config` + +Default value: 'cassandra' + +##### `indexes` + +Data type: `hash` + +Creates new `cassandra::schema::index` resources. + +Default value: {} + +##### `keyspaces` + +Data type: `hash` + +Creates new `cassandra::schema::keyspace` resources. + +Default value: {} + +##### `permissions` + +Data type: `hash` + +Creates new `cassandra::schema::permission` +resources. + +Default value: {} + +##### `tables` + +Data type: `hash` + +Creates new `cassandra::schema::table` resources. + +Default value: {} + +##### `users` + +Data type: `hash` + +Creates new `cassandra::schema::user` resources. + +Default value: {} + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::system::swapoff + +Disable swap on the node as suggested at +http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html + +* **See also** +cassandra::params + +#### Parameters + +The following parameters are available in the `cassandra::system::swapoff` class. + +##### `device` + +Data type: `string` + +If provided a mount resource will be created to +ensure that the device is absent from /etc/fstab to permanently disable swap. + +Default value: `undef` + +##### `mount` + +Data type: `string` + +The name of the swap mount point. Ignored unless +`device` has been set. + +Default value: 'swap' + +##### `path` + +Data type: `string` + +The full path to the file to check if swap is enabled. + +Default value: '/proc/swaps' + +### cassandra::system::sysctl + +Set Sysctl (kernel runtime parameters) as suggested in +http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html + +If any of the values is set into the target file, the sysctl command will +be called with the provided file name as an argument. + +* **See also** +cassandra::params + +#### Examples + +##### Basic requirement + +```puppet +require cassandra::system::sysctl +``` + +#### Parameters + +The following parameters are available in the `cassandra::system::sysctl` class. + +##### `sysctl_args` + +Data type: `string` + +Passed to the `sysctl` command + +Default value: '-p' + +##### `sysctl_file` + +Data type: `string` + +Path to the file to insert the settings into. + +Default value: $cassandra::params::sysctl_file + +##### `net_core_optmem_max` + +Data type: `integer` + +The value to set for +net.core.optmem_max + +Default value: 40960 + +##### `net_core_rmem_default` + +Data type: `integer` + +The value to set for +net.core.rmem_default. + +Default value: 16777216 + +##### `net_core_rmem_max` + +Data type: `integer` + +The value to set for net_core_rmem_max. + +Default value: 16777216 + +##### `net_core_wmem_default` + +Data type: `integer` + +The value to set for +net.core.wmem_default. + +Default value: 16777216 + +##### `net_core_wmem_max` + +Data type: `integer` + +The value to set for net.core.wmem_max. + +Default value: 16777216 + +##### `net_ipv4_tcp_rmem` + +Data type: `string` + +The value to set for net.ipv4.tcp_rmem. + +Default value: $::cassandra::params::net_ipv4_tcp_rmem + +##### `net_ipv4_tcp_wmem` + +Data type: `string` + +The value to set for net.ipv4.tcp_wmem. + +Default value: $::cassandra::params::net_ipv4_tcp_wmem + +##### `vm_max_map_count` + +Data type: `integer` + +The value to set for vm.max_map_count. + +Default value: 1048575 + +### cassandra::system::transparent_hugepage + +Disable Transparant Huge Pages as suggested in +http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html. + +* **See also** +cassandra::params + +#### Parameters + +The following parameters are available in the `cassandra::system::transparent_hugepage` class. + +##### `path` + +Data type: `string` + +The full path to the file for checking/setting +if Transparent Hugepages is enabled. + +Default value: '/sys/kernel/mm/transparent_hugepage/defrag' + +## Defined types + +### cassandra::file + +A defined type for altering files relative to the configuration directory. + +#### Examples + +##### + +```puppet +if $::memorysize_mb < 24576.0 { + $max_heap_size_in_mb = floor($::memorysize_mb / 2) +} elsif $::memorysize_mb < 8192.0 { + $max_heap_size_in_mb = floor($::memorysize_mb / 4) +} else { + $max_heap_size_in_mb = 8192 +} + +$heap_new_size = $::processorcount * 100 + +cassandra::file { "Set Java/Cassandra max heap size to ${max_heap_size_in_mb}.": + file => 'cassandra-env.sh', + file_lines => { + 'MAX_HEAP_SIZE' => { + line => "MAX_HEAP_SIZE='${max_heap_size_in_mb}M'", + match => '^#?MAX_HEAP_SIZE=.*', + }, + } +} + +cassandra::file { "Set Java/Cassandra heap new size to ${heap_new_size}.": + file => 'cassandra-env.sh', + file_lines => { + 'HEAP_NEWSIZE' => { + line => "HEAP_NEWSIZE='${heap_new_size}M'", + match => '^#?HEAP_NEWSIZE=.*', + } + } +} +$tmpdir = '/var/lib/cassandra/tmp' + +file { $tmpdir: + ensure => directory, + owner => 'cassandra', + group => 'cassandra', +} + +cassandra::file { 'Set java.io.tmpdir': + file => 'jvm.options', + file_lines => { + 'java.io.tmpdir' => { + line => "-Djava.io.tmpdir=${tmpdir}", + }, + }, + require => File[$tmpdir], +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::file` defined type. + +##### `file` + +Data type: `string` + +The name of the file relative to the `config_path`. + +Default value: $title + +##### `config_path` + +Data type: `string` + +The path to the configuration directory. + +Default value: $::cassandra::config_path + +##### `file_lines` + +Data type: `string` + +If set, then the [create_resources] +(https://docs.puppet.com/puppet/latest/reference/function.html#createresources) +will be used to create an array of [file_line] +(https://forge.puppet.com/puppetlabs/stdlib#file_line) resources. + +Default value: `undef` + +##### `service_refresh` + +Data type: `boolean` + +Is the Cassandra service is to be notified +if the environment file is changed. + +Default value: `true` + +### cassandra::private::firewall_ports::rule + +A defined type to be used as a macro for setting host based firewall +rules. This is not intended to be used by a user (who should use the +API provided by cassandra::firewall_ports instead) but is documented +here for completeness. + +#### Parameters + +The following parameters are available in the `cassandra::private::firewall_ports::rule` defined type. + +##### `ports` + +Data type: `integer` + +The number(s) of the port(s) to be opened. + +### cassandra::schema::cql_type + +Create or drop user defined data types within the schema. + +#### Examples + +##### + +```puppet +cassandra::schema::cql_type { 'fullname': + keyspace => 'mykeyspace', + fields => { + 'fname' => 'text', + 'lname' => 'text', + }, +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::schema::cql_type` defined type. + +##### `keyspace` + +Data type: `string` + +The name of the keyspace that the data type is to be associated with. + +##### `ensure` + +Data type: `present|absent` + +ensure the data type is created, or is dropped. + +Default value: present + +##### `fields` + +Data type: `hash` + +A hash of the fields that will be components for the data type. + +Default value: {} + +##### `cql_type_name` + +Data type: `string` + +The name of the CQL type to be created. + +Default value: $title + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::schema::index + +Create or drop indexes within the schema. + +#### Parameters + +The following parameters are available in the `cassandra::schema::index` defined type. + +##### `ensure` + +Data type: `present|absent` + +Create or dro[ the index. + +Default value: present + +##### `class_name` + +Data type: `string` + +The name of the class to be associated with an +index when creating a custom index. + +Default value: `undef` + +##### `index` + +Data type: `string` + +The name of the index. Defaults to the name of the +resource. + +Default value: $title + +##### `keys` + +Data type: `string` + +The columns that the index is being created on. + +Default value: `undef` + +##### `keyspace` + +Data type: `string` + +The name the keyspace that the index is to be associated +with. + +##### `options` + +Data type: `string` + +Any options to be added to the index. + +Default value: `undef` + +##### `table` + +Data type: `string` + +The name of the table that the index is to be associated with. + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::schema::keyspace + +Create or drop keyspaces within the schema. + +#### Examples + +##### + +```puppet +$network_topology_strategy = { + keyspace_class => 'NetworkTopologyStrategy', + dc1 => 3, + dc2 => 2 +} +``` + +##### + +```puppet +cassandra::schema::keyspace { 'mykeyspace': + replication_map => { + keyspace_class => 'SimpleStrategy', + replication_factor => 1, + }, + durable_writes => false, +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::schema::keyspace` defined type. + +##### `ensure` + +Data type: `present|absent` + +Create or drop the keyspace. + +Default value: present + +##### `durable_writes` + +Data type: `boolean` + +When set to false, data written to the +keyspace bypasses the commit log. Be careful using this option +because you risk losing data. Set this attribute to false on a keyspace +using the SimpleStrategy. + +Default value: `true` + +##### `keyspace_name` + +Data type: `string` + +The name of the keyspace to be created. + +Default value: $title + +##### `replication_map` + +Data type: `hash` + +Needed if the keyspace is to be present. +Optional if it is to be absent. + +Default value: {} + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::schema::permission + +Grant or revoke permissions. +To use this class, a suitable `authenticator` (e.g. PasswordAuthenticator) +and `authorizer` (e.g. CassandraAuthorizer) must be set in the Cassandra +class. + +WARNING: Specifying keyspace 'ALL' and 'ALL' for permissions at the same +time is not currently supported by this module. + +#### Parameters + +The following parameters are available in the `cassandra::schema::permission` defined type. + +##### `user_name` + +Data type: `string` + +The name of the user who is to be granted or +revoked. + +##### `ensure` + +Data type: `present | absent` + +Set to present to grant a permission or +absent to revoke it. + +Default value: present + +##### `keyspace_name` + +Data type: `string` + +The name of the keyspace to grant/revoke the +permissions on. If set to 'ALL' then the permission will be applied to +all of the keyspaces. + +Default value: 'ALL' + +##### `permission_name` + +Data type: `string` + +Can be one of the following: + +* 'ALTER' - ALTER KEYSPACE, ALTER TABLE, CREATE INDEX, DROP INDEX. +* 'AUTHORIZE' - GRANT, REVOKE. +* 'CREATE' - CREATE KEYSPACE, CREATE TABLE. +* 'DROP' - DROP KEYSPACE, DROP TABLE. +* 'MODIFY' - INSERT, DELETE, UPDATE, TRUNCATE. +* 'SELECT' - SELECT. + +If the permission_name is set to 'ALL', this will set all of the specific +permissions listed. + +Default value: 'ALL' + +##### `table_name` + +Data type: `string` + +The name of a table within the specified +keyspace. If left unspecified, the procedure will be applied to all +tables within the keyspace. + +Default value: `undef` + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::schema::table + +Create or drop tables within the schema. + +#### Examples + +##### + +```puppet +cassandra::schema::table { 'users': + keyspace => 'mykeyspace', + columns => { + 'userid' => 'int', + 'fname' => 'text', + 'lname' => 'text', + 'PRIMARY KEY' => '(userid)', + }, +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::schema::table` defined type. + +##### `keyspace` + +Data type: `string` + +The name of the keyspace. + +##### `columns` + +Data type: `hash` + +A hash of the columns to be placed in the table. +Optional if the table is to be absent. + +Default value: {} + +##### `ensure` + +Data type: `present|absent` + +Ensure a keyspace is created or dropped. + +Default value: present + +##### `options` + +Data type: `array` + +Options to be added to the table creation. + +Default value: [] + +##### `table` + +Data type: `string` + +The name of the table. Defaults to the name of the +resource. + +Default value: $title + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + +### cassandra::schema::user + +Create or drop users. +To use this class, a suitable `authenticator` (e.g. PasswordAuthenticator) +must be set in the Cassandra class. + +#### Examples + +##### + +```puppet +cassandra::schema::user { 'akers': + password => 'Niner2', + superuser => true, +} + +cassandra::schema::user { 'lucan': + ensure => absent, +} +``` + +#### Parameters + +The following parameters are available in the `cassandra::schema::user` defined type. + +##### `ensure` + +Data type: `present | absent` + +Valid values can be **present** to +ensure a user is created, or **absent** to remove the user if it exists. + +Default value: present + +##### `password` + +Data type: `string` + +A password for the user. + +Default value: `undef` + +##### `superuser` + +Data type: `boolean` + +If the user is to be a super-user on the system. + +Default value: `false` + +##### `login` + +Data type: `boolean` + +Allows the role to log in. + +Default value: `true` + +##### `user_name` + +Data type: `string` + +The name of the user. + +Default value: $title + +##### `use_scl` + +Data type: `Boolean` + + + +Default value: $cassandra::params::use_scl + +##### `scl_name` + +Data type: `String[1]` + + + +Default value: $cassandra::params::scl_name + diff --git a/docs/_index.html b/docs/_index.html deleted file mode 100644 index c4ad788..0000000 --- a/docs/_index.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - Documentation by YARD 0.9.12 - - - - - - - - - - - - - - - - - - - -
- - -

Documentation by YARD 0.9.12

-
-

Alphabetic Index

- -

Puppet Class Listing A-Z

- - - - - - -
- - - - -
- - -

Defined Type Listing A-Z

- - - - - - -
- - - - -
- - - - - -

File Listing

- - -
- - -
- -
- - - -
- - \ No newline at end of file diff --git a/docs/css/common.css b/docs/css/common.css deleted file mode 100644 index d28b093..0000000 --- a/docs/css/common.css +++ /dev/null @@ -1,8 +0,0 @@ -/* Ensure the search bar doesn't overlap with links */ -.fixed_header { - padding-bottom: 25px; -} - -#full_list { - padding-top: 15px; -} diff --git a/docs/css/full_list.css b/docs/css/full_list.css deleted file mode 100644 index fa35982..0000000 --- a/docs/css/full_list.css +++ /dev/null @@ -1,58 +0,0 @@ -body { - margin: 0; - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; - height: 101%; - overflow-x: hidden; - background: #fafafa; -} - -h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } -.clear { clear: both; } -.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } -#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } -#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } -#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } -#full_list ul { padding: 0; } -#full_list li { padding: 0; margin: 0; list-style: none; } -#full_list li .item { padding: 5px 5px 5px 12px; } -#noresults { padding: 7px 12px; background: #fff; } -#content.insearch #noresults { margin-left: 7px; } -li.collapsed ul { display: none; } -li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } -li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } -li { color: #888; cursor: pointer; } -li.deprecated { text-decoration: line-through; font-style: italic; } -li.odd { background: #f0f0f0; } -li.even { background: #fafafa; } -.item:hover { background: #ddd; } -li small:before { content: "("; } -li small:after { content: ")"; } -li small.search_info { display: none; } -a, a:visited { text-decoration: none; color: #05a; } -li.clicked > .item { background: #05a; color: #ccc; } -li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } -li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } -li.collapsed.clicked a.toggle { background-position: top right; } -#search input { border: 1px solid #bbb; border-radius: 3px; } -#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } -#full_list_nav a, #nav a:visited { color: #358; } -#full_list_nav a:hover { background: transparent; color: #5af; } -#full_list_nav span:after { content: ' | '; } -#full_list_nav span:last-child:after { content: ''; } - -#content h1 { margin-top: 0; } -li { white-space: nowrap; cursor: normal; } -li small { display: block; font-size: 0.8em; } -li small:before { content: ""; } -li small:after { content: ""; } -li small.search_info { display: none; } -#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } -#content.insearch #search { background-position: center right; } -#search input { width: 110px; } - -#full_list.insearch ul { display: block; } -#full_list.insearch .item { display: none; } -#full_list.insearch .found { display: block; padding-left: 11px !important; } -#full_list.insearch li a.toggle { display: none; } -#full_list.insearch li small.search_info { display: block; } diff --git a/docs/css/style.css b/docs/css/style.css deleted file mode 100644 index 57e8f9d..0000000 --- a/docs/css/style.css +++ /dev/null @@ -1,499 +0,0 @@ -html { - width: 100%; - height: 100%; -} -body { - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; - width: 100%; - margin: 0; - padding: 0; - display: flex; - display: -webkit-flex; - display: -ms-flexbox; -} - -#nav { - position: relative; - width: 100%; - height: 100%; - border: 0; - border-right: 1px dotted #eee; - overflow: auto; -} -.nav_wrap { - margin: 0; - padding: 0; - width: 20%; - height: 100%; - position: relative; - display: flex; - display: -webkit-flex; - display: -ms-flexbox; - flex-shrink: 0; - -webkit-flex-shrink: 0; - -ms-flex: 1 0; -} -#resizer { - position: absolute; - right: -5px; - top: 0; - width: 10px; - height: 100%; - cursor: col-resize; - z-index: 9999; -} -#main { - flex: 5 1; - -webkit-flex: 5 1; - -ms-flex: 5 1; - outline: none; - position: relative; - background: #fff; - padding: 1.2em; - padding-top: 0.2em; -} - -@media (max-width: 920px) { - .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } - #resizer { display: none; } - #nav { - z-index: 9999; - background: #fff; - display: none; - position: absolute; - top: 40px; - right: 12px; - width: 500px; - max-width: 80%; - height: 80%; - overflow-y: scroll; - border: 1px solid #999; - border-collapse: collapse; - box-shadow: -7px 5px 25px #aaa; - border-radius: 2px; - } -} - -@media (min-width: 920px) { - body { height: 100%; overflow: hidden; } - #main { height: 100%; overflow: auto; } - #search { display: none; } -} - -#main img { max-width: 100%; } -h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } -h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } -h1.title { margin-bottom: 10px; } -h1.alphaindex { margin-top: 0; font-size: 22px; } -h2 { - padding: 0; - padding-bottom: 3px; - border-bottom: 1px #aaa solid; - font-size: 1.4em; - margin: 1.8em 0 0.5em; - position: relative; -} -h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } -h2 small a { - display: block; - height: 20px; - border: 1px solid #aaa; - border-bottom: 0; - border-top-left-radius: 5px; - background: #f8f8f8; - position: relative; - padding: 2px 7px; -} -.clear { clear: both; } -.inline { display: inline; } -.inline p:first-child { display: inline; } -.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } -.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { - color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; - border-radius: 4px; -} -.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } -.docstring h1 { font-size: 1.2em; } -.docstring h2 { font-size: 1.1em; } -.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } -.summary_desc .object_link a, .docstring .object_link a { - font-family: monospace; font-size: 1.05em; - color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; - border-radius: 4px; -} -.rdoc-term { padding-right: 25px; font-weight: bold; } -.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } -.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { - padding: 0px; background: inherit; color: inherit; border-radius: inherit; -} - -/* style for */ -#filecontents table, .docstring table { border-collapse: collapse; } -#filecontents table th, #filecontents table td, -.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } -#filecontents table tr:nth-child(odd), -.docstring table tr:nth-child(odd) { background: #eee; } -#filecontents table tr:nth-child(even), -.docstring table tr:nth-child(even) { background: #fff; } -#filecontents table th, .docstring table th { background: #fff; } - -/* style for
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Node NameIP Address
node0 (seed 1)110.82.155.0
node1110.82.155.1
node2110.82.155.2
node3 (seed 2)110.82.156.3
node4110.82.156.4
node5110.82.156.5
- -

Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual -nodes (vnodes). The name of the cluster is MyCassandraCluster. Also, -while building the initial cluster, we are setting the auto_bootstrap -to false.

- -

In this initial example, we are going to expand the example by:

- - - -
node /^node\d+$/ {
-  class { 'cassandra::datastax_repo':
-    before => Class['cassandra']
-  }
-
-  class { 'cassandra::java':
-    before => Class['cassandra']
-  }
-
-  class { 'cassandra':
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
- -

The default value for the num_tokens is already 256, but it is -included in the example for clarity. Do not forget to either -set auto_bootstrap to true or not set the attribute at all -after initializing the cluster.

- -

Create a Cluster in Multiple Data Centers

- -

To continue with the examples provided by DataStax, we look at the example -for a cluster across multiple data centers -http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initMultipleDS.html.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Node NameIP AddressData CenterRack
node0 (seed 1)10.168.66.41DC1RAC1
node110.176.43.66DC1RAC1
node210.168.247.41DC1RAC1
node3 (seed 2)10.176.170.59DC2RAC1
node410.169.61.170DC2RAC1
node510.169.30.138DC2RAC1
- -

For the sake of simplicity, we will confine this example to the nodes:

- -
node /^node[012]$/ {
-  class { 'cassandra':
-    dc             => 'DC1',
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
-node /^node[345]$/ {
-  class { 'cassandra':
-    dc             => 'DC2',
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
- -

We don't need to specify the rack name (with the rack attribute) as RAC1 is -the default value. Again, do not forget to either set auto_bootstrap to -true or not set the attribute at all after initializing the cluster.

- -

DataStax Enterprise

- -

After configuring the relevant repository, the following snippet works on -CentOS 7 to install DSE Cassandra 4.7.0, set the HADOOP_LOG_DIR, set the -DSE_HOME and configure DataStax Enterprise to use LDAP for authentication:

- -
class { 'cassandra::datastax_repo':
-  descr   => 'DataStax Repo for DataStax Enterprise',
-  pkg_url => 'https://username:password@rpm.datastax.com/enterprise',
-  before  => Class['cassandra'],
-}
-
-class { 'cassandra':
-  cluster_name    => 'MyCassandraCluster',
-  config_path     => '/etc/dse/cassandra',
-  package_ensure  => '4.7.0-1',
-  package_name    => 'dse-full',
-  service_name    => 'dse',
-  ...
-}
-
-class { 'cassandra::dse':
-  file_lines => {
-    'Set HADOOP_LOG_DIR directory' => {
-      ensure => present,
-      path   => '/etc/dse/dse-env.sh',
-      line   => 'export HADOOP_LOG_DIR=/var/log/hadoop',
-      match  => '^# export HADOOP_LOG_DIR=<log_dir>',
-    },
-    'Set DSE_HOME'                 => {
-      ensure => present,
-      path   => '/etc/dse/dse-env.sh',
-      line   => 'export DSE_HOME=/usr/share/dse',
-      match  => '^#export DSE_HOME',
-    },
-  },
-  settings   => {
-    ldap_options => {
-      server_host                => localhost,
-      server_port                => 389,
-      search_dn                  => 'cn=Admin',
-      search_password            => secret,
-      use_ssl                    => false,
-      use_tls                    => false,
-      truststore_type            => jks,
-      user_search_base           => 'ou=users,dc=example,dc=com',
-      user_search_filter         => '(uid={0})',
-      credentials_validity_in_ms => 0,
-      connection_pool            => {
-        max_active => 8,
-        max_idle   => 8,
-      }
-    }
-  }
-}
-
- -

Apache Cassandra

- -

DataStax announced in late October 2016 that it was no longer supporting -the community edition of Cassandra or DSC as it was known (see -[Take a bow Planet -Cassandra](http://www.datastax.com/2016/10/take-a-bow-planet-cassandra) -for details). However, the following snippet of code running on Ubuntu -14.04 worked fine without having to change any of the ::cassandra class -settings:

- -
require cassandra::java
-include cassandra::optutils
-
-class { 'cassandra::apache_repo':
-  release => '310x',
-  before  => Class['cassandra', 'cassandra::optutils'],
-}
-
-class { 'cassandra':
-  ...
-}
-
- -

Reference

- -

The reference documentation is generated using the -puppet-strings tool. To see -all of it, please go to -http://voxpupuli.github.io/puppet-cassandra.

- -

Limitations

- - - -

Development

- -

Contributions will be gratefully accepted. Please go to the project page, -fork the project, make your changes locally and then raise a pull request. -Details on how to do this are available at -https://guides.github.com/activities/contributing-to-open-source.

- -

Please also see the -CONTRIBUTING.md -page for project specific requirements.

- -

Additional Contributers

- -

For a list of contributers see -CONTRIBUTING.md -and https://github.com/voxpupuli/puppet-cassandra/graphs/contributors

- - - - - - - \ No newline at end of file diff --git a/docs/frames.html b/docs/frames.html deleted file mode 100644 index 42ca6b6..0000000 --- a/docs/frames.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Documentation by YARD 0.9.12 - - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index b0e91fc..0000000 --- a/docs/index.html +++ /dev/null @@ -1,824 +0,0 @@ - - - - - - - File: README - - — Documentation by YARD 0.9.12 - - - - - - - - - - - - - - - - - - - -
- - -

Cassandra

- -

Build Status

- -

Table of Contents

- -
    -
  1. Overview
  2. -
  3. Setup - The basics of getting started with Cassandra - -
  4. -
  5. Usage - Configuration options and additional functionality - -
  6. -
  7. Reference
  8. -
  9. Limitations - OS compatibility, etc.
  10. -
  11. Development
  12. -
- -

Overview

- -

A Puppet module to install and manage Cassandra, DataStax Agent & OpsCenter

- -

Setup

- -

What Cassandra affects

- -

What the Cassandra class affects

- -
    -
  • Installs the Cassandra package (default cassandra22 on Red Hat and -cassandra on Debian).
  • -
  • Configures settings in ${config_path}/cassandra.yaml.
  • -
  • On CentOS 7 if the init service provider is used, then cassandra -is added as a system service.
  • -
  • Optionally ensures that the Cassandra service is enabled and running.
  • -
  • On Debian systems: - -
      -
    • Optionally replace /etc/init.d/cassandra with a workaround for -CASSANDRA-9822.
    • -
  • -
- -

What the cassandra::datastax_agent class affects

- -
    -
  • Optionally installs the DataStax agent.
  • -
  • Optionally sets JAVA_HOME in /etc/default/datastax-agent.
  • -
- -

What the cassandra::datastax_repo class affects

- -
    -
  • Optionally configures a Yum repository to install the Cassandra packages -from (on Red Hat).
  • -
  • Optionally configures an Apt repository to install the Cassandra packages -from (on Debian).
  • -
- -

What the cassandra::dse class affects

- -
    -
  • Optionally configures files in the /etc/dse directory if one is using -DataStax Enterprise.
  • -
- -

What the cassandra::firewall_ports class affects

- -
    -
  • Optionally configures the firewall for the Cassandra related network -ports.
  • -
- -

What the cassandra::java class affects

- -
    -
  • Optionally installs a JRE/JDK package (e.g. java-1.7.0-openjdk) and the -Java Native Access (JNA).
  • -
- -

What the cassandra::optutils class affects

- -
    -
  • Optionally installs the Cassandra support tools (e.g. cassandra22-tools).
  • -
- -

Upgrading

- -

We follow SemVer Versioning and an update of the major -release (i.e. from 1.Y.Z to 2.Y.Z) will indicate a significant change -to the API which will most probably require a change to your manifest.

- -

Changes in 2.0.0

- -

This is a major change to the API and you will more than likely need to -change your manifest to accomodate these changes.

- -

The service_ensure attribute of the cassandra class now defaults to -undef, users who do want to manage service status in Puppet can still set -it to true. If leaving the value at the default and setting -service_refresh and service_enable to false will mean that the -user and not Puppet running will control the running state of -Cassandra. This currently works OK on the Red Hat family, but -has issues on Debian due to -CASSANDRA-2356 -during an initial install or package upgrade.

- -

All the functionality relating to OpsCenter has been divested to the -locp/opscenter module on -Puppet Forge.

- -

It should also be noted that the module no longer creates directories for -the data, commitlog, saved_caches and for Cassandra 3 the hints -directory. These resources will now need to be defined in your -manifest/profile.

- -

For a list of features that have been deprecated in this release, please see -https://github.com/voxpupuli/puppet-cassandra/wiki/Deprecations

- -

For details on migrating from the version 1.X.X attributes to the settings -hash, see -(https://github.com/voxpupuli/puppet-cassandra/wiki/Suggested-Baseline-Settings)

- -

Please also see the notes for 2.0.0 in the -CHANGELOG.

- -

Changes in 1.19.0

- -

The hints_directory documentation will cause a change in the cassandra.yaml -file regardless of the value you set it to. If you do not wish this to -result in a refesh of the Cassandra service, please set service_refresh to -false.

- -

Changes in 1.9.2

- -

Now that Cassandra 3 is available from the DataStax repositories, there is -a problem (especially on Debian) with the operating system package manager -attempting to install Cassandra 3. This can be mitigated against using -something similar to the code in this modules acceptance test. Please note -that the default Cassandra package name has now been changed from 'dsc'. See -the documentation for cassandra::package_name below for details.

- -
 if $::osfamily == 'RedHat' {
-   $version = '2.2.4-1'
- } else {
-   $version = '2.2.4'
- }
-
- class { 'cassandra':
-   package_ensure => $version,
- }
-
- -

Changes in 1.8.0

- -

A somewhat embarrassing correction to the spelling of the -cassandra::fail_on_non_suppoted_os to cassandra::fail_on_non_supported_os.

- -

Issues when Upgrading to 1.4.0

- -

Unfortunately both releases 1.3.7 and 1.4.0 have subsequently been found to -call a refresh service even when no changes had been made to the underlying -configuration. In release 1.8.0 (somewhat belatedly) the service_refresh -flag has been introduced to mitigate against similar problems.

- -

Issues When Upgrading to 1.3.7

- -
    -
  • Please see the notes for 1.4.0.
  • -
- -

Changes in 1.0.0

- -
    -
  • cassandra::cassandra_package_ensure has been renamed to -cassandra::package_ensure.
  • -
  • cassandra::cassandra_package_name has been renamed to -cassandra::package_name.
  • -
- -

Changes in 0.4.0

- -

There is now a cassandra::datastax_agent class, therefore:

- -
    -
  • cassandra::datastax_agent_package_ensure has now been replaced with -cassandra::datastax_agent::package_ensure.
  • -
  • cassandra::datastax_agent_service_enable has now been replaced with -cassandra::datastax_agent::service_enable.
  • -
  • cassandra::datastax_agent_service_ensure has now been replaced with -cassandra::datastax_agent::service_ensure.
  • -
  • cassandra::datastax_agent_package_name has now been replaced with -cassandra::datastax_agent::package_name.
  • -
  • cassandra::datastax_agent_service_name has now been replaced with -cassandra::datastax_agent::service_name.
  • -
- -

Likewise now there is a new class for handling the installation of Java:

- -
    -
  • cassandra::java_package_ensure has now been replaced with -cassandra::java::ensure.
  • -
  • cassandra::java_package_name has now been replaced with -cassandra::java::package_name.
  • -
- -

Also there is now a class for installing the optional utilities:

- -
    -
  • cassandra::cassandra_opt_package_ensure has now been replaced with -cassandra::optutils:ensure.
  • -
  • cassandra::cassandra_opt_package_name has now been replaced with -cassandra::optutils:package_name.
  • -
- -

Changes in 0.3.0

- -
    -
  • cassandra_opt_package_ensure changed from 'present' to undef.

  • -
  • The manage_service option has been replaced with service_enable and -service_ensure.

  • -
- -

Beginning with Cassandra

- -

Create a Cassandra 2.X cluster called MyCassandraCluster which uses the -GossipingPropertyFileSnitch and password authentication. In this very -basic example the node itself becomes a seed for the cluster and the -credentials will default to a user called cassandra with a password -called of cassandra.

- -
# Cassandra pre-requisites
-include cassandra::datastax_repo
-include cassandra::java
-
-class { 'cassandra':
-  settings => {
-    'authenticator'               => 'PasswordAuthenticator',
-    'cluster_name'                => 'MyCassandraCluster',
-    'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-    'commitlog_sync'              => 'periodic',
-    'commitlog_sync_period_in_ms' => 10000,
-    'data_file_directories'       => ['/var/lib/cassandra/data'],
-    'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-    'listen_address'              => $::ipaddress,
-    'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-    'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-    'seed_provider'               => [
-      {
-        'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-        'parameters' => [
-          {
-            'seeds' => $::ipaddress,
-          },
-        ],
-      },
-    ],
-    'start_native_transport'      => true,
-  },
-  require  => Class['cassandra::datastax_repo', 'cassandra::java'],
-}
-
- -

However, PLEASE note that this is the ABSOLUTE MINIMUM configuration -to get Cassandra up and running but will probably give you a rather badly -configured node. Please see -Suggested Baseline Settings -for details on making your configuration a lot more robust.

- -

For this code to run with version 3.X of Cassandra, the hints_directory will -also need to be specified:

- -
...
-
-class { 'cassandra':
-  settings => {
-    ...
-    'hints_directory'             => '/var/lib/cassandra/hints',
-    ...
-  },
-  require  => Class['cassandra::datastax_repo', 'cassandra::java'],
-}
-
- -

Hiera

- -

In your top level node classification (usually common.yaml), add the -settings hash and all the tweaks you want all the clusters to use:

- -
cassandra::baseline_settings:
-  authenticator: AllowAllAuthenticator
-  authorizer: AllowAllAuthorizer
-  auto_bootstrap: true
-  auto_snapshot: true
-  ...
-
- -

Then, in the individual node classification add the parts which define -the cluster:

- -
cassandra::settings:
-  cluster_name: developer playground cassandra cluster
-cassandra::dc: Onsite1
-cassandra::rack: RAC1
-cassandra::package_ensure: 3.0.5-1
-cassandra::package_name: cassandra30
-
- -

Usage

- -

Setup a keyspace and users

- -

We assume that authentication has been enabled for the cassandra -cluster and we are connecting with the default user name and password -('cassandra/cassandra').

- -

In this example, we create a keyspace (mykeyspace) with a table called -'users' and an index called 'users_lname_idx'.

- -

We also add three users (to Cassandra, not the mykeyspace.users -table) called spillman, akers and boone while ensuring that a user -called lucan is absent.

- -
class { 'cassandra':
-  ...
-}
-
-class { 'cassandra::schema':
-  cqlsh_password => 'cassandra',
-  cqlsh_user     => 'cassandra',
-  cqlsh_host     => $::ipaddress,
-  indexes        => {
-    'users_lname_idx' => {
-      table    => 'users',
-      keys     => 'lname',
-      keyspace => 'mykeyspace',
-    },
-  },
-  keyspaces      => {
-    'mykeyspace' => {
-      durable_writes  => false,
-      replication_map => {
-        keyspace_class     => 'SimpleStrategy',
-        replication_factor => 1,
-      },
-    }
-  },
-  permissions    => {
-    'Grant select permissions to spillman to all keyspaces' => {
-      permission_name => 'SELECT',
-      user_name       => 'spillman',
-    },
-    'Grant modify to to keyspace mykeyspace to akers'       => {
-      keyspace_name   => 'mykeyspace',
-      permission_name => 'MODIFY',
-      user_name       => 'akers',
-    },
-    'Grant alter permissions to mykeyspace to boone'        => {
-      keyspace_name   => 'mykeyspace',
-      permission_name => 'ALTER',
-      user_name       => 'boone',
-    },
-    'Grant ALL permissions to mykeyspace.users to gbennet'  => {
-      keyspace_name   => 'mykeyspace',
-      permission_name => 'ALTER',
-      table_name      => 'users',
-      user_name       => 'gbennet',
-    },
-  },
-  tables         => {
-    'users' => {
-      columns  => {
-        user_id       => 'int',
-        fname         => 'text',
-        lname         => 'text',
-        'PRIMARY KEY' => '(user_id)',
-      },
-      keyspace => 'mykeyspace',
-    },
-  },
-  users          => {
-    'spillman' => {
-      password => 'Niner27',
-    },
-    'akers'    => {
-      password  => 'Niner2',
-      superuser => true,
-    },
-    'boone'    => {
-      password => 'Niner75',
-    },
-    'gbennet'  => {
-      'password' => 'foobar',
-    },
-    'lucan'    => {
-      'ensure' => absent
-    },
-  },
-}
-
- -

Create a Cluster in a Single Data Center

- -

In the DataStax documentation Initializing a multiple node cluster (single -data center) -http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initSingleDS.html -there is a basic example of a six node cluster with two seeds to be created in -a single data center spanning two racks. The nodes in the cluster are:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Node NameIP Address
node0 (seed 1)110.82.155.0
node1110.82.155.1
node2110.82.155.2
node3 (seed 2)110.82.156.3
node4110.82.156.4
node5110.82.156.5
- -

Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual -nodes (vnodes). The name of the cluster is MyCassandraCluster. Also, -while building the initial cluster, we are setting the auto_bootstrap -to false.

- -

In this initial example, we are going to expand the example by:

- -
    -
  • Ensuring that the software is installed via the DataStax Community -repository by including cassandra::datastax_repo. This needs to be -executed before the Cassandra package is installed.
  • -
  • That a suitable Java Runtime environment (JRE) is installed with Java Native -Access (JNA) by including cassandra::java. This need to be executed -before the Cassandra service is started.
  • -
- -
node /^node\d+$/ {
-  class { 'cassandra::datastax_repo':
-    before => Class['cassandra']
-  }
-
-  class { 'cassandra::java':
-    before => Class['cassandra']
-  }
-
-  class { 'cassandra':
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
- -

The default value for the num_tokens is already 256, but it is -included in the example for clarity. Do not forget to either -set auto_bootstrap to true or not set the attribute at all -after initializing the cluster.

- -

Create a Cluster in Multiple Data Centers

- -

To continue with the examples provided by DataStax, we look at the example -for a cluster across multiple data centers -http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initMultipleDS.html.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Node NameIP AddressData CenterRack
node0 (seed 1)10.168.66.41DC1RAC1
node110.176.43.66DC1RAC1
node210.168.247.41DC1RAC1
node3 (seed 2)10.176.170.59DC2RAC1
node410.169.61.170DC2RAC1
node510.169.30.138DC2RAC1
- -

For the sake of simplicity, we will confine this example to the nodes:

- -
node /^node[012]$/ {
-  class { 'cassandra':
-    dc             => 'DC1',
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
-node /^node[345]$/ {
-  class { 'cassandra':
-    dc             => 'DC2',
-    settings       => {
-      'authenticator'               => 'AllowAllAuthenticator',
-      'auto_bootstrap'              => false,
-      'cluster_name'                => 'MyCassandraCluster',
-      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
-      'commitlog_sync'              => 'periodic',
-      'commitlog_sync_period_in_ms' => 10000,
-      'data_file_directories'       => ['/var/lib/cassandra/data'],
-      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
-      'hints_directory'             => '/var/lib/cassandra/hints',
-      'listen_interface'            => 'eth1',
-      'num_tokens'                  => 256,
-      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
-      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
-      'seed_provider'               => [
-        {
-          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
-          'parameters' => [
-            {
-              'seeds' => '110.82.155.0,110.82.156.3',
-            },
-          ],
-        },
-      ],
-      'start_native_transport'      => true,
-    },
-  }
-}
-
- -

We don't need to specify the rack name (with the rack attribute) as RAC1 is -the default value. Again, do not forget to either set auto_bootstrap to -true or not set the attribute at all after initializing the cluster.

- -

DataStax Enterprise

- -

After configuring the relevant repository, the following snippet works on -CentOS 7 to install DSE Cassandra 4.7.0, set the HADOOP_LOG_DIR, set the -DSE_HOME and configure DataStax Enterprise to use LDAP for authentication:

- -
class { 'cassandra::datastax_repo':
-  descr   => 'DataStax Repo for DataStax Enterprise',
-  pkg_url => 'https://username:password@rpm.datastax.com/enterprise',
-  before  => Class['cassandra'],
-}
-
-class { 'cassandra':
-  cluster_name    => 'MyCassandraCluster',
-  config_path     => '/etc/dse/cassandra',
-  package_ensure  => '4.7.0-1',
-  package_name    => 'dse-full',
-  service_name    => 'dse',
-  ...
-}
-
-class { 'cassandra::dse':
-  file_lines => {
-    'Set HADOOP_LOG_DIR directory' => {
-      ensure => present,
-      path   => '/etc/dse/dse-env.sh',
-      line   => 'export HADOOP_LOG_DIR=/var/log/hadoop',
-      match  => '^# export HADOOP_LOG_DIR=<log_dir>',
-    },
-    'Set DSE_HOME'                 => {
-      ensure => present,
-      path   => '/etc/dse/dse-env.sh',
-      line   => 'export DSE_HOME=/usr/share/dse',
-      match  => '^#export DSE_HOME',
-    },
-  },
-  settings   => {
-    ldap_options => {
-      server_host                => localhost,
-      server_port                => 389,
-      search_dn                  => 'cn=Admin',
-      search_password            => secret,
-      use_ssl                    => false,
-      use_tls                    => false,
-      truststore_type            => jks,
-      user_search_base           => 'ou=users,dc=example,dc=com',
-      user_search_filter         => '(uid={0})',
-      credentials_validity_in_ms => 0,
-      connection_pool            => {
-        max_active => 8,
-        max_idle   => 8,
-      }
-    }
-  }
-}
-
- -

Apache Cassandra

- -

DataStax announced in late October 2016 that it was no longer supporting -the community edition of Cassandra or DSC as it was known (see -[Take a bow Planet -Cassandra](http://www.datastax.com/2016/10/take-a-bow-planet-cassandra) -for details). However, the following snippet of code running on Ubuntu -14.04 worked fine without having to change any of the ::cassandra class -settings:

- -
require cassandra::java
-include cassandra::optutils
-
-class { 'cassandra::apache_repo':
-  release => '310x',
-  before  => Class['cassandra', 'cassandra::optutils'],
-}
-
-class { 'cassandra':
-  ...
-}
-
- -

Reference

- -

The reference documentation is generated using the -puppet-strings tool. To see -all of it, please go to -http://voxpupuli.github.io/puppet-cassandra.

- -

Limitations

- -
    -
  • When using a Ruby version before 1.9.0, the contents of the Cassandra -configuration file may change order of elements due to a problem with -to_yaml in earlier versions of Ruby.
  • -
  • When creating key spaces, indexes, cql_types and users the settings will only -be used to create a new resource if it does not currently exist. If a change -is made to the Puppet manifest but the resource already exits, this change -will not be reflected.
  • -
  • At the moment the cassandra::system::transparent_hugepage does not -persist between reboots.
  • -
  • Acceptance for Debian 7 are confined to Cassandra 2.1 and 2.2. There is -a conflict between the GLIBC on Debian 7 and the newer releases of Cassandra -3.X.
  • -
- -

Development

- -

Contributions will be gratefully accepted. Please go to the project page, -fork the project, make your changes locally and then raise a pull request. -Details on how to do this are available at -https://guides.github.com/activities/contributing-to-open-source.

- -

Please also see the -CONTRIBUTING.md -page for project specific requirements.

- -

Additional Contributers

- -

For a list of contributers see -CONTRIBUTING.md -and https://github.com/voxpupuli/puppet-cassandra/graphs/contributors

-
- - - -
- - \ No newline at end of file diff --git a/docs/js/app.js b/docs/js/app.js deleted file mode 100644 index b9f2120..0000000 --- a/docs/js/app.js +++ /dev/null @@ -1,248 +0,0 @@ -(function() { - -var localStorage = {}, sessionStorage = {}; -try { localStorage = window.localStorage; } catch (e) { } -try { sessionStorage = window.sessionStorage; } catch (e) { } - -function createSourceLinks() { - $('.method_details_list .source_code'). - before("[View source]"); - $('.toggleSource').toggle(function() { - $(this).parent().nextAll('.source_code').slideDown(100); - $(this).text("Hide source"); - }, - function() { - $(this).parent().nextAll('.source_code').slideUp(100); - $(this).text("View source"); - }); -} - -function createDefineLinks() { - var tHeight = 0; - $('.defines').after(" more..."); - $('.toggleDefines').toggle(function() { - tHeight = $(this).parent().prev().height(); - $(this).prev().css('display', 'inline'); - $(this).parent().prev().height($(this).parent().height()); - $(this).text("(less)"); - }, - function() { - $(this).prev().hide(); - $(this).parent().prev().height(tHeight); - $(this).text("more..."); - }); -} - -function createFullTreeLinks() { - var tHeight = 0; - $('.inheritanceTree').toggle(function() { - tHeight = $(this).parent().prev().height(); - $(this).parent().toggleClass('showAll'); - $(this).text("(hide)"); - $(this).parent().prev().height($(this).parent().height()); - }, - function() { - $(this).parent().toggleClass('showAll'); - $(this).parent().prev().height(tHeight); - $(this).text("show all"); - }); -} - -function searchFrameButtons() { - $('.full_list_link').click(function() { - toggleSearchFrame(this, $(this).attr('href')); - return false; - }); - window.addEventListener('message', function(e) { - if (e.data === 'navEscape') { - $('#nav').slideUp(100); - $('#search a').removeClass('active inactive'); - $(window).focus(); - } - }); - - $(window).resize(function() { - if ($('#search:visible').length === 0) { - $('#nav').removeAttr('style'); - $('#search a').removeClass('active inactive'); - $(window).focus(); - } - }); -} - -function toggleSearchFrame(id, link) { - var frame = $('#nav'); - $('#search a').removeClass('active').addClass('inactive'); - if (frame.attr('src') === link && frame.css('display') !== "none") { - frame.slideUp(100); - $('#search a').removeClass('active inactive'); - } - else { - $(id).addClass('active').removeClass('inactive'); - if (frame.attr('src') !== link) frame.attr('src', link); - frame.slideDown(100); - } -} - -function linkSummaries() { - $('.summary_signature').click(function() { - document.location = $(this).find('a').attr('href'); - }); -} - -function summaryToggle() { - $('.summary_toggle').click(function(e) { - e.preventDefault(); - localStorage.summaryCollapsed = $(this).text(); - $('.summary_toggle').each(function() { - $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); - var next = $(this).parent().parent().nextAll('ul.summary').first(); - if (next.hasClass('compact')) { - next.toggle(); - next.nextAll('ul.summary').first().toggle(); - } - else if (next.hasClass('summary')) { - var list = $('