Forge Home

riak

Deploy a Riak Cluster

11,101 downloads

9,518 latest version

4.5 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.1.1 (latest)
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Mar 23rd 2015
This version is compatible with:
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'cornellio-riak', '1.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add cornellio-riak
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install cornellio-riak --version 1.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

cornellio/riak — version 1.1.1 Mar 23rd 2015

Riak

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage
  5. Reference
  6. Limitations
  7. Development
  8. Contributors

Overview

Riak is a high performance, distributed key/value data store released by Basho.

This module deploys a Riak cluster on Red Hat distributions. Since it's designed to automate the setup of an entire cluster it can be applied to multiple hosts and will handle the operations necessary to create the cluster, including plan, commit and join. The module uses your existing yum repos to install Riak and Erlang and Linux will be tuned for performance as recommended by Basho.

The module has been tested on RHEL/CentOS 6.4 using riak-1.4.8 and erlang-rebar-2.1.0. Compatible with Puppet 2.7 or higher.

The Riak packages need to be available in your existing yum repos.

Module Description

The class parameter cluster_join_node defines the host that all members of the cluster will join. All hosts that join this node will automatically be members of the same cluster. If this node has not yet been provisioned when Puppet runs on other nodes, the cluster join operation will silently fail. The cluster join will succeed on the next Puppet run as long as the Riak daemon is running on the cluster_join_node.

Multiple Puppet runs may be necessary to bring all nodes into the cluster. If you ensure Riak has been provisioned on the host cited by cluster_join_node before the other nodes, everything should work after one Puppet run.

Setup

Package Repositories

As to avoid external dependencies, this module is designed to use internal yum repos, therefore ensure the following packages are available in your configured yum repos.

  • riak-1.4.8
  • erlang-rebar-2.1.0

Name Resolution

Working name resolution is required. Ensure that each host can resolve itself and the host that's specified by the cluster_join_node parameter.

What Riak affects

These packages will be Installed:

  • riak-1.4.8
  • erlang-rebar-2.1.0

Performance optimizations are made as recommended by Basho:

  • Sets Linux kernel parameters and tunes ulimits as required
  • Swap disk is disabled
  • Filesystem mount options are added to improve I/O
  • The Linux I/O scheduler (elevator) is changed from CFQ to Deadline for the 3 first serial block devices detected, e.g. /dev/sda, /dev/sdb and /dev/sdc.

Usage

To create a 5 node cluster with a ring size of 256 where all nodes join riak01.domain.local:

While not strictly necessary, you may want to provision Riak on riak01.domain.local before the other nodes so it will be ready to accept members as they join the cluster.

Create a node definition like so:

node /^riak0[1-5]\.domain\.local$/  {
    class { 'riak':
        cluster_join_node  => 'riak01.domain.local',
        ring_creation_size => '256',
    }
}

Parameters

cluster_join_node

The node to join when creating the cluster. All nodes that you wish to make into a cluster should use the same value for this. The system you select is arbitrary and can be any host that will become part of the cluster.

Kernel Tuning Parameters

Increasing max file handles via sysctl and ulimits

sysctl_fs_file_max default: 65536

ulimits_nofile_soft default: 16000

ulimits_nofile_hard default: 20000

ring_creation_size

The number of partitions that make up your Riak cluster. Must be a multipel of 2. Check cluster capacity planning docs for details. default: 128

riak_api_pb_backlog

Maximum length to which the queue of pending connections may grow. default: 64

riak_search

To enable Search functionality set this 'true'. Not recommended on production systems. default: false

riak_sysmon_process_limit

Sysmon process limit. default: 30

riak_control_enabled

Whether to enable the Riak control GUI default: false

riak_control_username

Username for Riak control default: admin

riak_control_password

Password for Riak control default: pass

Reference

Limitations

  • Only supported on RHEL 6 distros
  • If the system cited by cluster_join_node does not yet have Riak running when a host attempts to join the cluster, the cluster join operation will silently fail.
  • The Linux I/O scheduler is only tuned on the 3 first serial block devices detected; needs to be more generalized

Development

Visit the repo on Github

Contact

Pete Cornell / @9Dreamer / https://github.com/Cornellio