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.1 < 6.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-kafka', '4.0.0'
Learn more about managing modules with a PuppetfileDocumentation
Kafka module for Puppet
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with kafka
- 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
Overview
The kafka module for managing the installation and configuration of Apache Kafka
Module Description
The Kafka module for managing the installation and configuration of Apache Kafka: it's brokers, producers and consumers.
Setup
What kafka affects
Installs the Kafka package and creates a new service.
Beginning with Kafka
To successfully install Kafka using this module you need to have Apache Zookeeper already running at localhost:2181. You can specify another Zookeeper host:port configuration using the config hash of the kafka:broker class.
The default configuration installs Kafka 0.9.0.1 binaries with Scala 2.11
class { 'kafka': }
If you want a Kafka broker server that connects to zookeeper listening on port 2181:
class { 'kafka::broker':
config => { 'broker.id' => '0', 'zookeeper.connect' => 'localhost:2181' }
}
Usage
You can specify different Kafka binaries packages versions to install. Please take a look at the different Scala and Kafka versions combinations at the Apache Kafka Website
Installing Kafka version 0.9.0.1 with scala 2.11
We first install the binary package with:
class { 'kafka':
version => '0.9.0.1',
scala_version => '2.11'
}
Then we set a minimal Kafka broker configuration with:
class { 'kafka::broker':
config => { 'broker.id' => '0', 'zookeeper.connect' => 'localhost:2181' }
}
Classes and Defined Types
Class: kafka
One of the primary classes of the kafka module. This class will install the kafka binaries
Parameters within kafka
:
version
The version of kafka that should be installed.
scala_version
The scala version what kafka was built with.
install_dir
The directory to install kafka to.
mirror_url
The url where the kafka is downloaded from.
install_java
Install java if it's not already installed.
package_dir
The directory to install kafka.
package_name
Package name, when installing kafka from a package.
package_ensure
Package version (or 'present', 'absent', 'latest'), when installing kafka from a package.
group_id
Create kafka group with this ID
user_id
Create kafka user with this ID
user
User to install kafka as. Defaults to the kafka user.
group
Group to install kafka as. Defaults to the kafka group.
config_dir
Directory for kafka config files. Defaults to /opt/kafka/config.
log_dir
Directory for kafka log files. Defaults to /var/log/kafka.
Class: kafka::broker
One of the primary classes of the kafka module. This class will install a kafka broker.
Parameters within kafka::broker
:
version
The version of kafka that should be installed.
scala_version
The scala version what kafka was built with.
install_dir
The directory to install kafka to.
mirror_url
The url where the kafka is downloaded from.
config
A hash of the configuration options. All values are used in the
server.properties
file directly.
install_java
Install java if it's not already installed.
service_ensure
Sets the ensure state of the broker service to stopped or running.
service_install
Install the init.d service.
service_restart
Whether the configuration files should trigger a service restart
package_dir
The directory to install kafka.
Class: kafka::consumer
One of the primary classes of the kafka module. This class will install a kafka consumer.
Parameters within kafka::consumer
:
version
The version of kafka that should be installed.
scala_version
The scala version that kafka was built with.
install_dir
The directory to install kafka to.
mirror_url
The url where the kafka is downloaded from.
install_java
Install java if it's not already installed.
package_dir
The directory to install kafka.
Class: kafka::mirror
One of the primary classes of the kafka module. This class will install a kafka mirror.
Parameters within kafka::mirror
:
version
The version of kafka that should be installed.
scala_version
The scala version that kafka was built with.
install_dir
The directory to install kafka to.
mirror_url
The url where the kafka is downloaded from.
install_java
Install java if it's not already installed.
package_dir
The directory to install kafka.
Class: kafka::producer
One of the primary classes of the kafka module. This class will install a kafka producer.
Parameters within kafka::producer
:
version
The version of kafka that should be installed.
scala_version
The scala version that kafka was built with.
install_dir
The directory to install kafka to.
mirror_url
The url where the kafka is downloaded from.
install_java
Install java if it's not already installed.
package_dir
The directory to install kafka.
Define: kafka::topic
Defined type that creates Kafka topics.
Reference
Classes
Public Classes
kafka
: Guides the basic installation of kafka binarieskafka::broker
: Guides the basic installation of a kafka brokerkafka::consumer
: Guides the basic installation of a kafka consumerkafka::mirror
: Guides the basic installation of a kafka mirrorkafka::producer
: Guides the basic installation of a kafka producer
Private Classes
- [
kafka::broker::config
] Manages all the default configuration of the kafka broker application - [
kafka::broker::install
] Manages the installation of the kafka packages - [
kafka::broker::service
] Manages the kafka server service - [
kafka::consumer::config
] Manages all the default configuration of the kafka consumer application - [
kafka::consumer::install
] Manages the installation of the kafka packages - [
kafka::consumer::service
] Manages the kafka server service - [
kafka::mirror::config
] Manages all the default configuration of the kafka mirror application - [
kafka::mirror::install
] Manages the installation of the kafka packages - [
kafka::mirror::service
] Manages the kafka server service - [
kafka::producer::config
] Manages all the default configuration of the kafka producer application - [
kafka::producer::install
] Manages the installation of the kafka packages - [
kafka::producer::service
] Manages the kafka server service
Defined Types
kafka::topic
Create kafka topics
Limitations
This module is tested on the following platforms:
- CentOS 5
- CentOS 6
- Ubuntu 12.04
- Ubuntu 14.04
It is tested with the OSS version of Puppet (>= 4.7.0) only.
Development
Contributing
Please read CONTRIBUTING.md for full details on contributing to this project.
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v4.0.0 (2017-10-17)
Implemented enhancements:
- Adjust puppet version boundaries for puppet6 #209 (bastelfreak)
- Add support for TimeoutStopSec and ExecStop in the systemd unit file #207 (LionelCons)
- Higher allowed version for module java and lower for zookeeper #205 (hp197)
Closed issues:
- Kafka stopping should be configurable in the systemd unit file #206
Merged pull requests:
- release 3.2.0 #204 (bastelfreak)
v3.2.0 (2017-09-29)
Breaking changes:
- renamed kafka::broker::topic to kafka::topic and added a bin_dir param #189 (LionelCons)
- The ZooKeeper service is not required by default anymore #184 (LionelCons)
- Java is not installed by default anymore #181 (LionelCons)
Implemented enhancements:
- Added manage_user and manage_group parameters #185 (LionelCons)
Fixed bugs:
- Typo in init.erb #198
- Fixed typo in init.erb #199 (LionelCons)
- kafka::consumer now calls kafka::consumer::config #187 (LionelCons)
- kafka::mirror::service does not inherit from ::kafka::params anymore #177 (LionelCons)
Closed issues:
- There are parameter discrepancies amongst kafka::*::service #192
- There are parameter discrepancies between kafka::init and kafka::*::install #190
- The kafka::broker::topic defined type should rather be kafka::topic #188
- The consumer class does not call its config subclass #186
- The ZooKeeper service should not be required by default #183
- Java should not be installed by default #180
- include statements do not need quotes #178
- mirror/service.pp should not inherit from ::kafka::params #176
- Module user/group management should be optional #173
Merged pull requests:
- fix mirror maker with new consumer #203 (jacobmw)
- Update README.md #201 (confiq)
- enable possibility of system users for kafka #197 (Wayneoween)
- MirrorMaker service needed path to .properties files #196 (jacobmw)
- cleanup related to the service classes #193 (LionelCons)
- cleanup related to the install classes #191 (LionelCons)
- include statements do not need quotes #179 (LionelCons)
v3.1.0 (2017-07-19)
Implemented enhancements:
- handle the user, group, user_id and group_id parameters consistently #172 (LionelCons)
- the *.properties configuration files are now owned by root #166 (LionelCons)
- added a "bin_dir" parameter to configure where the Kafka scripts are #159 (LionelCons)
- Allow changing the LimitNOFILE parameter for systemd unit file #157 (jacobmw)
- add support to kafka::broker logs dir #148 (jolivares)
- Add log.message.format.version to broker params #142 (winks)
Fixed bugs:
- create $package_dir and $install_directory ony when needed #167 (LionelCons)
- fix wrong defaults for mirror/service.pp #164 (LionelCons)
- declared service dependencies: Kafka requires networking and syslog #162 (LionelCons)
- change ownership of the configuration directory #160 (LionelCons)
Closed issues:
- The user and group are hard-coded in the service templates #171
- The init script always requires the zookeeper service #168
- The configuration files should be owned by root #165
- mirror/service.pp gets some defaults from params.pp instead of mirror.pp #163
- The Systemd unit file should declare dependencies #161
- Centos 7 install #151
- systemd config should not contain dependencies on zookeeper #150
- The configuration directory should be owned by root #146
- The "bin" directory is not configurable #145
- Arbitrary shell variables cannot be set #144
- Package-based installation creates useless directories #143
Merged pull requests:
- Release 3.1.0 #175 (bastelfreak)
- added an $env parameter to control the environment passed to Kafka #170 (LionelCons)
- the init script now uses the service_requires_zookeeper parameter #169 (LionelCons)
- replace validate_* with datatypes #153 (bastelfreak)
- Add missing documentation #138 (seanmalloy)
- Add params to allow customizing user, group, and log_dir #137 (seanmalloy)
- release 3.0.0 #134 (bastelfreak)
v3.0.0 (2017-02-13)
Implemented enhancements:
Merged pull requests:
- release 2.3.0 #132 (bastelfreak)
v2.3.0 (2017-02-11)
Closed issues:
- broker.id should also be set in $logs_dir/meta.properties #117
Merged pull requests:
- allow using any mirror_url if it ends with tgz #126 (petetodo)
- Bump dependencies #125 (juniorsysadmin)
- release 2.2.0 #124 (bastelfreak)
- Mirror url custom port #121 (ellamdav)
v2.2.0 (2016-12-25)
Closed issues:
- master branch not tagged #120
- Incompatibility beetween $install_dir and $version params #98
- make a new release #72
Merged pull requests:
- Fix bounding of puppet version in metadata #116 (ghoneycutt)
- Fix puppet 4 versioncmp need for string #115 (mlambrichs)
- Update readme with the current Kafka & Scala versions #112 (atrepca)
- Add missing badges #111 (dhoppe)
- adding the port to the mirror URL #108 (petetodo)
- Make the systemd manifest configurable #105 (bjoernhaeuser)
v2.1.0 (2016-08-31)
Closed issues:
- Fix regexp for URL validation (or remove URL validation at all) #92
- systemv init: "$PID_FILE does not exist, process is not running" can be wrong #90
- kafka service should wait for zookeeper #81
- 'archive' module conflict #61
Merged pull requests:
- prepare release for 2.1.0 #102 (igalic)
- Document missing parameters #100 (igalic)
- Fix incompatibility beetween $install_dir and $version params #99 (igalic)
- Add support for MirrorMaker abort.on.send.failure #97 (SegFaultAX)
- fix init script to actually check status #96 (fessyfoo)
- Init fix #94 (igalic)
- Remove URL validation #93 (volkorny)
- [skip-ci]Small typo fix #88 (skade)
- remove trailing whitespace #86 (bastelfreak)
- init clean-up #82 (igalic)
- Sync metadata.json license to be same as LICENSE (MIT) #78 (juniorsysadmin)
- parameterized group-id and user-id for kafka #77 (MaltePaulsen)
- Removed dependency which is not valid with package installation #76 (Mike-Petersen)
- Allowing installation via package #74 (Mike-Petersen)
- Add support for optional default file with environment vars #35 (knumor)
v2.0.0 (2016-05-26)
Implemented enhancements:
- Upgrade to Kafka 0.9.0.0 #30
Closed issues:
- Fix parameter install_dir/install_directory #52
- Fix parameter package_dir #51
- kafka::mirror is critically broken #39
- stop trying to make fetch happen #31
- producer init template is missing #13
- Both "version" and "scala_version" are ignored within "kafka::broker" #9
- Readme states that "config" is available within the "kafka" class #8
- ability to set the service to disabled #3
Merged pull requests:
- Fix wrong syntax (default value for ssl.enabled.protocols) #70 (jolivares)
- Allow to set KAFKA_OPTS #69 (jolivares)
- add the jmx_opts and log4j_opts to the init scripts #67 (DjxDeaf)
- Removing broker gc opts #66 (bjoernhaeuser)
- add the ability to optimize all the different roles, not just the broker #65 (DjxDeaf)
- fix the mirror.unit template #62 (DjxDeaf)
- Adding support to KAFKA_HEAP_OPTS #59 (ortz)
- Support CentOS 7 #57 (bjoernhaeuser)
- Upgrade to Kafka 0.9.0.1. This should fix #30 #56 (dhoppe)
- Extend Beaker tests #55 (dhoppe)
- Fix parameter package_dir. This closes #51 #54 (dhoppe)
- Fix parameter install_dir/install_directory. This closes #52 #53 (dhoppe)
- Use module voxpupuli/archive instead of wget. This should fix #31 #50 (dhoppe)
- Submit service_name to cosumer::config and producer::config #49 (dhoppe)
- (#8) README: sync class parameter lists #48 (ffrank)
- Fix classes broker::consumer and broker::producer #46 (dhoppe)
- Pin rake to avoid rubocop/rake 11 incompatibility #45 (roidelapluie)
- Add missing dependency #44 (dhoppe)
- Fix indentation of class parameters #43 (dhoppe)
- Fix several issues regarding mirror, producer and RSpec tests #41 (dhoppe)
- Fix empty PID file creation on failed daemon start #40 (dhoppe)
- Mirror num_streams num_producers max_heap params #37 (travees)
- Widen output to find the kafka string when getting PID #34 (knumor)
- Support CentOS 7 #23 (bjoernhaeuser)
- attempt to fix #3 (allow to configure service manually) #12 (feniix)
v1.0.3 (2016-01-22)
Closed issues:
- Puppet forge module outdated: ArgumentError: Could not find declared class java #27
- Puppetforge module outdated: The init script leaves pidfile if there's an error when starting #26
- Ubuntu 12.04/14.04 LTS Compatibility Broken #24
- kafka starting as a root user #17
- init script is incompatible with chkconfig #5
Merged pull requests:
v1.0.2 (2015-12-11)
Closed issues:
- Missing dependency on puppetlabs-java #19
Merged pull requests:
- Update module to version 1.0.2 #28 (dhoppe)
- README changes with an example of use. #20 (GabrielNicolasAvellaneda)
- Added missing dependency on puppetlabs-java #18 (GabrielNicolasAvellaneda)
- Update init.erb #16 (VuokkoVuorinnen)
- Make wget installation optional #15 (danieldreier)
- Make beaker run on centos #7 (bjoernhaeuser)
v1.0.1 (2015-03-24)
Merged pull requests:
- Moar file descriptors! (quoting https://github.com/stack72\) #1 (pablete)
v1.0.0 (2014-10-10)
v0.2.1 (2014-06-02)
v0.2.0 (2014-06-02)
v0.1.0 (2014-05-28)
* This Change Log was automatically generated by github_changelog_generator
Dependencies
- puppet/archive (>= 1.0.0 < 3.0.0)
- puppetlabs/java (>= 1.4.2 < 3.0.0)
- puppetlabs/stdlib (>= 4.13.1 < 5.0.0)
- deric/zookeeper (>= 0.5.1 < 1.0.0)
- camptocamp/systemd (>= 0.4.0 < 2.0.0)
Copyright (c) 2014 OpenTable, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.