hazelcast
Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'jjuarez-hazelcast', '0.6.2'
Learn more about managing modules with a PuppetfileDocumentation
hazelcast
Table of Contents
- Description
- Setup - The basics of getting started with hazelcast
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The aim of this module is quite simple, to help you with the instalation and setup of a hazelcast server or cluster
Setup
A minimal setup using the default parameter values would be something like this:
class { '::hazelcast': }
or better using the include clause in this form:
include '::hazelcast'
Setup examples
Be aware about the exit code that hazelcast use, it's not 0, it's 143, so after a service stop the systemd stayed as failed, anyway after the 0.6.1 version ofthe module this allows you to configure this detail in the systemd unit, and also the time to wait during a restart operation.
Example of these custom configurations
hazelcast::config_dir: '/etc/hazelcast'
hazelcast::version: '3.9.4'
hazelcast::service_ensure: 'running'
hazelcast::service_successful_exit_status: 143 # This is the default value
hazelcast::service_restart_timeout: 30 # This is the default value, 30 seconds
hazelcast::manage_user: true
hazelcast::user: 'hazelcast'
hazelcast::group: 'hazelcast'
hazelcast::download_url: 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p='
hazelcast::java: '/usr/lib/jvm/jre1.8.0'
hazelcast::java_options: '-Xss256k -Xms64m -Xmx128m -XX:+UseG1GC -Dsome.awesome.superkey=value'
hazelcast::group_name: 'hzuser'
hazelcast::group_password: 'supersecret'
hazelcast::cluster_discovery: 'multicast'
Cluster discovery
TCP
Here you can see a more complex setup for a cluster of three members doing the discovery by TCP
class { '::hazelcast':
root_dir => '/opt',
config_dir => '/etc/hazelcast',
version => '3.9.4',
service_ensure => 'running',
manage_user => true,
user => 'hazelcast',
group => 'hazelcast',
download_url => 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p=',
java => '/usr/lib/jvm/jre1.8.0/bin/java',
java_options => '-Xss256k -Xms64m -Xmx128m -XX:+UseG1GC -Dsome.awesome.superkey=value',
group_name => 'hzuser',
group_password => 'supersecret',
cluster_discovery => 'tcp',
cluster_members => [
'192.168.0.23',
'192.168.0.24',
'192.168.0.25'
],
}
Of course we recommend you to configure the module always using hiera, this is more reliable and flexible depending of your hierarchy, you can view the previous example here:
---
hazelcast::root_dir: '/opt'
hazelcast::config_dir: '/etc/hazelcast'
hazelcast::version: '3.9.4'
hazelcast::service_ensure: 'running'
hazelcast::manage_user: true
hazelcast::user: 'hazelcast'
hazelcast::group: 'hazelcast'
hazelcast::download_url: 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p='
hazelcast::java: '/usr/lib/jvm/jre1.8.0'
hazelcast::java_options: '-Xss256k -Xms64m -Xmx128m -XX:+UseG1GC -Dsome.awesome.superkey=value'
hazelcast::group_name: 'hzuser'
hazelcast::group_password: 'supersecret'
hazelcast::cluster_discovery: 'tcp'
hazelcast::cluster_members:
- '192.168.0.23'
- '192.168.0.24'
- '192.168.0.25'
Multicast
---
hazelcast::root_dir: '/opt'
hazelcast::config_dir: '/etc/hazelcast'
hazelcast::version: '3.9.4'
hazelcast::service_ensure: 'running'
hazelcast::manage_user: true
hazelcast::user: 'hazelcast'
hazelcast::group: 'hazelcast'
hazelcast::download_url: 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p='
hazelcast::java: '/usr/lib/jvm/jre1.8.0'
hazelcast::java_options: '-Dfoo=bar'
hazelcast::group_name: 'hzuser'
hazelcast::group_password: 'supersecret'
hazelcast::cluster_discovery: 'multicast'
AWS
To a complete description of the method of discovery I encorage you to take a look to the Hazelcast documentation, which is available here these are the parameters:
Parameter | Description | Required | default |
---|---|---|---|
access_key | The AWS access key id | yes | |
secret_key | The AWS secret Key | yes | |
region | The AWS region | no | us-west-1 |
host_header | The Amazon host header domain | no | amazonaws.com |
sg_name | The identificator of a security group which allow access to the cluster instances | no | - |
tag_key | The key of the tag to filter the ec2 instances | yes | - |
tag_value | The value of the tag key to filter the ec2 instances | yes | - |
---
hazelcast::root_dir: '/opt'
hazelcast::config_dir: '/etc/hazelcast'
hazelcast::version: '3.9.4'
hazelcast::service_ensure: 'running'
hazelcast::manage_user: true
hazelcast::user: 'hazelcast'
hazelcast::group: 'hazelcast'
hazelcast::download_url: 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p='
hazelcast::java: '/usr/lib/jvm/jre1.8.0'
hazelcast::java_options: '-Dfoo=bar'
hazelcast::group_name: 'hzuser'
hazelcast::group_password: 'supersecret'
hazelcast::cluster_discovery: 'aws'
hazelcast::cluster_discovery_aws:
access_key: XXXX
secret_key: XXXX
region: eu-west-1
host_header: amazonaws.com
security_group_name: sg-XXXXX
tag_key: hz_cluster
tag_value: development
Custom TTLs
Another example of configuration but this one focused on the custom TTL configuration would be like this one, and remember you can add as many TTL configuratio as you need
---
hazelcast::version: '3.9.4'
hazelcast::download_url: 'http://download.hazelcast.com/download.jsp?version=3.9.4&type=tar&p='
hazelcast::java: '/usr/lib/jvm/jre1.8.0'
hazelcast::group_name: 'hzuser'
hazelcast::group_password: 'supersecret'
hazelcast::cluster_discovery: 'multicast'
hazelcast::time_to_live_seconds: 10
hazelcast::custom_ttls:
-
name: my_map
seconds: 10
max_size_policy: 10
max_size_value: 15
eviction_policy: LRU
- name: another_map
seconds: 35
max_size_policy: 250
max_size_value: 15
eviction_policy: LFU
Beginning with hazelcast
You have to take a look to the awesome documentation of the Hazelcast project here
Usage
I think to use the module have to be pretty easy, just add it to your Puppetfile, import the class in your profile class and configure it with hiera. The module deploy a small CLI util to check the status of the cluster, this is deployed among the hazelcast package, for example, (with root_dir=/opt and version=3.9.4) it will be deployed in:
/opt/hazelcast/bin/hazelcast-cli.sh
with the appropriate configuration file to fit the cluster deployed, this file is located in (with config_dir=/etc/hazelcast)
/etc/hazelcast/hazelcast-client.xml
Reference
You can take a look to the awesome documentation of the Hazelcast project here
Limitations
The module supports only OS distributions based on systemd, as you might know:
- Debian Stretch
- Debian Jessie
- Red-Hat
- CentOS 7
- Ubuntu: 16.04, 18.04, 18.10
- Archlinux
Cluster discovery mechanims supported:
- TCP
- Multicast
- AWS: EC2 tags and Security group
Development
Please feel free to send me your ideas in the form of pull requests, and fill me an issue if you discover one
Changelog
All notable changes to this project will be documented in this file.
Release 0.6.2
Features
- Fixes the issue with the bad dependency between the hazelcast user and group
Release 0.6.1
Features
- Makes configuration some custom parameters of the hazelcast servers using systemd as init system, allows you to configure a custom sucessfull exit code and the time to wait during the restart operations of the service
## Bugfixes
- Solves the fault status of the systemd unit after an stop operation, because hazelcast use to exist with an exit code different than 0, amazing
Release 0.6.0
Features
- Makes optional the installation of the client console stuff
- New approach with the systemd, avoiding the use of additional files to store enviroment variables, you can read more about this subject here
## Bugfixes
- Solves an issue related with the service subscription
Release 0.5.2
Features
## Bugfixes
- Solves an issue related with the systemd unit file permissions
Release 0.5.1
Features
## Bugfixes
- Solves mainly some documentation isssues
Release 0.5.0
Features
-
Adds support for a bunch of Linux distribution which support systemd as init, AYMK:
-
Ubuntu 16.04, 18.04, 18.10
-
Archlinux 4
-
Increases the test coverage
## Bugfixes
Release 0.4.1
Features
- No functional additions, only documentation issues solved
## Bugfixes
Release 0.4.0
Features
- Adds the simples example possible to the documentation
- Adds AWS discovery capabilities
## Bugfixes
- Doc: Solves a small issue in the README.md file
Release 0.3.2
Features
- Adds the capability of configure the cluster discovery with multicast
- Adds some new configuration examples
## Bugfixes
- Solves some issues with the module URLs in the metadata.json file
- Solves some errors in the documentation of the module
Release 0.3.1
### Features
- Add the capability to configure a management center
Bugfixes
Release 0.2.11
Features
Now the module supports the configuration of these parameters:
- time-to-live-seconds, to configure a general TTL, and avoid the 'infinite' policy
- A set of specific TTL
Release 0.2.10
Features
Bugfixes
- The relation of dependency between the service resource and the file for the systemd unit was wrong and this provoked the fail of the puppet catalogs
## Release 0.2.9
Features
Bugfixes
## Release 0.2.8
Features
Bugfixes
## Release 0.2.7
Features
Bugfixes
## Release 0.2.6
Features
- Changes in the URL of the repository, now with the puppet prefix
- Support for the CentOS 7 release (easy-peasy)
Bugfixes
- Look over the documentation
Release 0.2.5
Features
Bugfixes
- The parameters of the module follow the cluster group configuration parameter names, like group.name and group.password, instead of user and password
Release 0.2.4
Features
- Include the support for a small CLI tool that may help you to conect with your cluster and do some tests, the client configuration needed to connect with the cluster is automatically provided too by the module
- Better naming for the hazelcast cluster groups variable names
- Avoid the use of the (damned) exec resource
Release 0.2.3
### Features
There're not features in this release, I'm just to adjust the java environment to the minimun required
### Bugfixes
- The systemd unit needs an absolute name for the java executable
Release 0.2.2 [Deleted]
### Features
### Bugfixes
## Release 0.2.1
Features
This version does not add new features per se, but adds some new interesting interfaces that brings to the module the path to grow
Bugfixes
- Solves this issue https://gitlab.com/homeWiFi-devops/hazelcast/issues/1
Release 0.2.0
### Features
You can call this the first release of the module, it includes the next features:
- Supports (only) the TCP discovery mechanism, but this is the begining
- Solves the issue with the logging configuration of the process
Bugfixes
Release 0.1.1
Features
Bugfixes
- A shilly issue related with the module metadata.json file
Release 0.1.0
Features
Implements only the basics to support the process up and running
Bugfixes
Known Issues
Dependencies
- puppetlabs/stdlib (>=4.0.0 < 5.1.0)
- puppet/archive (>=3.0.0 < 4.0.0)