Giter VIP home page Giter VIP logo

voxpupuli / puppet-kafka Goto Github PK

View Code? Open in Web Editor NEW
30.0 58.0 120.0 844 KB

The kafka module for managing the installation and configuration of Apache Kafka

Home Page: https://forge.puppet.com/puppet/kafka

License: MIT License

Ruby 43.59% Puppet 50.28% Shell 4.11% HTML 2.02%
linux-puppet-module puppet hacktoberfest centos-puppet-module debian-puppet-module redhat-puppet-module sles-puppet-module ubuntu-puppet-module

puppet-kafka's Introduction

Kafka module for Puppet

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs MIT License Donated by Liam Bennett

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with Kafka
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. 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.

Setup requirements

This module has the following dependencies:

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.11.0.3 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 1.1.0 with scala 2.12

We first install the binary package with:

  class { 'kafka':
    version => '1.1.0',
    scala_version => '2.12'
  }

Then we set a minimal Kafka broker configuration with:

  class { 'kafka::broker':
    config => {
      'broker.id'         => '0',
      'zookeeper.connect' => 'localhost:2181'
    }
  }

Reference

The reference documentation of this module is generated using puppetlabs/puppetlabs-strings.

Limitations

This module only supports Kafka >= 0.9.0.0.

This module is tested on the following platforms:

  • Debian 8
  • Debian 9
  • Debian 10
  • Ubuntu 16.04
  • Ubuntu 18.04
  • CentOS 7

It is tested with the OSS version of Puppet (>= 5.5) only.

Development

This module has grown over time based on a range of contributions from people using it. If you follow these contributing guidelines your patch will likely make it into a release a little more quickly.

Author

This module is maintained by Vox Pupuli. It was originally written and maintained by Liam Bennett.

puppet-kafka's People

Contributors

alexjfisher avatar bastelfreak avatar bbriggs avatar bjoernhaeuser avatar der-eismann avatar dhoppe avatar ekohl avatar eliranbz avatar elmendalerenda avatar fessyfoo avatar igalic avatar jacobmw avatar jhoblitt avatar jolivares avatar juniorsysadmin avatar jyaworski avatar knumor avatar liamjbennett avatar lionelcons avatar llowder avatar mike-petersen avatar nibalizer avatar pmbuko avatar ptodoran avatar seanmalloy avatar smortex avatar stack72 avatar themeier avatar travees avatar zilchms avatar

Stargazers

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

Watchers

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

puppet-kafka's Issues

Module user/group management should be optional

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: NA
  • Ruby: NA
  • Distribution: NA
  • Module version: 2/3

How to reproduce (e.g Puppet code you use)

Use the module as it's written

What are you seeing

The module assumes that it should be creating the kafka user and group - though it allows you to set the userid and groupid.

What behaviour did you expect instead

we like to manage the users and groups on the system ourselves through a separate process, which conflicts with the module trying to create the user. We would like to be able to choose whether the module manages the user/group or not. We'd like manage_user and manage_group options.

Output log

Any additional information you'd like to impart

init script is incompatible with chkconfig

This was run on a RHEL 6 machine.
The init file is not compatible with chkconfig:

Error: Could not enable kafka: Execution of '/sbin/chkconfig --add kafka' returned 1: service kafka does not support chkconfig
Error: /Stage[main]/Kafka::Broker::Service/Service[kafka]/ensure: change from stopped to running failed: Could not enable kafka: Execution of '/sbin/chkconfig --add kafka' returned 1: service kafka does not support chkconfig

Unable to use Alpha release with current content

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: N/A
  • Ruby: N/A
  • Distribution: CentOS
  • Module version: 3.0

How to reproduce (e.g Puppet code you use)

Call the kafka class with mirror_url set to a site that does not conform to the apache mirror standard

What are you seeing

The new Alpha release is published to a non-standard apache site (ex: http://home.apache.org/~ijuma/kafka-0.11.0.0-rc1/), which does not follow the URL pattern that is hard coded in the init.pp module:

$package_url = "${mirror_url}/kafka/${version}/${basefilename}"

The pattern used in the alpha release is

${mirror_url}/${basefilename}

example: http://home.apache.org/~ijuma/kafka-0.11.0.0-rc1/kafka_2.11-0.11.0.0.tgz

The package_url variable is constructed within the class, and not available to change through the call or through hiera. I can set $mirror_url:

kafka::mirror_url: 'http://home.apache.org/~ijuma/kafka-0.11.0.0-rc1/'

But that just changes the first part of the site URL

What behaviour did you expect instead

It would be nice to be able to pass a full package name through to the class, to handle non-standard URL patterns

Output log

Error: Execution of '/bin/curl http://mirrors.ukfast.co.uk/sites/ftp.apache.org/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz -o /tmp/kafka_2.11-0.11.0.0.tgz_20170622-15515-1iph1fb -fsSL --max-redirs 5' returned 22: curl: (22) The requested URL returned error: 404 Not Found Error: /Stage[main]/Kafka/Archive[/var/tmp/kafka/kafka_2.11-0.11.0.0.tgz]/ensure: change from absent to present failed: Execution of '/bin/curl http://mirrors.ukfast.co.uk/sites/ftp.apache.org/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz -o /tmp/kafka_2.11-0.11.0.0.tgz_20170622-15515-1iph1fb -fsSL --max-redirs 5' returned 22: curl: (22) The requested URL returned error: 404 Not Found

Any additional information you'd like to impart

broker.id should also be set in $logs_dir/meta.properties

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: any
  • Ruby: any
  • Distribution: any
  • Module version: <= 2.1.0

What are you seeing

When kafka::broker::config's broker.id changes that change is not reflected in $log_dir's meta.properties. This causes kafka startup to fail (see below)

What behaviour did you expect instead

Dynamic environments are… well… dynamic. An integer such as a broker.id can easily be changed for any number of reasons. Our module should enable and support this.

Output log

[2016-11-18 13:25:28,078] INFO Logs loading complete. (kafka.log.LogManager)
[2016-11-18 13:25:28,130] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2016-11-18 13:25:28,131] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2016-11-18 13:25:28,138] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentBrokerIdException: Configured broker.id 3 doesn't match stored broker.id 1 in meta.properties. If you moved your data, make sure your configured broker.id matches. If you intend to create a new broker, you should remove all data in your data directories (log.dirs).
        at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:648)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:187)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37)
        at kafka.Kafka$.main(Kafka.scala:67)
        at kafka.Kafka.main(Kafka.scala)
[2016-11-18 13:25:28,140] INFO shutting down (kafka.server.KafkaServer)

Any additional information you'd like to impart

I don't know how to guarantee the uniqueness of this number across a cluster, since in puppet we have no easy way to know who's part of a cluster.

Zookeeper would be a way? maybe??

Upgrade to Kafka 0.9.0.0

Kafka released a new version 0.9.0.0, can the puppet module be updated to be used with Kafka 0.9.0.0

kafka starting as a root user

Hi,

When the script to run kafka launches, kafka is ran as root. This is not recommended. Better to run kafka as a "kafka" process.

The consumer class does not call its config subclass

Just compare manifests/producer.pp:

  class { '::kafka::producer::install': }
  -> class { '::kafka::producer::config': }
  -> class { '::kafka::producer::service': }
  -> Class['kafka::producer']

with manifests/consumer.pp:

  class { '::kafka::consumer::install': }
  -> class { '::kafka::consumer::service': }
  -> Class['kafka::consumer']

Fix parameter install_dir/install_directory

The parameter install_dir and install_directory is not working as expected. If you override the version of Kafka or Scala, the parameter install_dir will still have the value /opt/kafka-2.10-0.8.2.1.

make a new release

the last release is quiet old and a lot happened, we should do another release. @dhoppe you know the module very good, could you do that?

There are parameter discrepancies amongst kafka::*::service

The service related subclasses have parameter discrepancies.

For instance kafka::consumer::config has service_name while kafka::broker::config does not. Worse, kafka::consumer::service does not have service_name!

Conversely, kafka::broker::service has service_install and service_ensure that the other kafka::*::service classes do not have.

Service handling should be unified.

systemd config should not contain dependencies on zookeeper

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4
  • Distribution: all systems using systemd
  • Module version: 3.0.0

How to reproduce

this is the module default behavior

the problem

In a cluster environment, the current contents of templates/unit.erb:

Wants=zookeeper.service
After=zookeeper.service
Requires=zookeeper.service

set a too strong dependencie between kafka and zookeeper. Ideally, one should be able to run kafka without having zookeeper installed on the same machine. There should be 2 separate clusters:

  • one for kafka
  • one for zookeeper

The current setup forces the user to setup a zookeeper service on the kafka machines , even if he uses another cluster for that.

In addition, the problem is also that even if the user installs both zookeeper and kakfa on the same machines, in this way he cannot upgrade zookeeper one machine after the other, without killing also the kafka service each time. In high available environments, or where the replication factor for a partition is equal to the number of machines, this might cause the kafka cluster to run in degraded mode.

suggested way of doing it

I suggest to put this dependency at least optional, something like:

with_local_zookeeper => true,
or
depends_on_zookeeper => true

which might be true by default if you do not want to break the current setup` .

Therefore, the user should be able to set:

with_local_zookeeper => false,
or
depends_on_zookeeper => false

and solve the high-availability issue.

'archive' module conflict

Hi,

We are trying to use this module (and contributed some changes on the way) but we are now facing a serious issue, which prevent us from using it as the 'archive' module being used it by you (and is a great module) but we (and many modules) are using the popular camptocamp/archive module such as kibana4, grafana, etc.

thought it was worth sharing and see hear your thoughts about it

Thanks
Eliran

producer init template is missing

Error: Could not find template 'kafka/producer.init.erb' at /modules/kafka/manifests/producer/service.pp:23 on node localhost
Error: Could not find template 'kafka/producer.init.erb' at /modules/kafka/manifests/producer/service.pp:23 on node localhost

Both "version" and "scala_version" are ignored within "kafka::broker"

class { 'kafka::broker':
  version => '0.8.2.1',
  scala_version => '2.10',
  install_java => true
}

Instead of 2.10 there's 2.8.0 and instead of 0.8.2.1 there's 0.8.1.1:

...
Notice: /Stage[main]/Kafka/File[/var/log/kafka]/ensure: created
Notice: /Stage[main]/Kafka/File[/opt/kafka-2.8.0-0.8.1.1]/ensure: created
Notice: /Stage[main]/Kafka/File[/opt/kafka]/ensure: created
...

Package-based installation creates useless directories

When specifying a $package_name, init.pp still creates the useless directories $package_dir, and $install_directory as well as the /opt/kafka symlink.

All of these definitions are useless in an rpm based installation and should be moved inside the if $package_name == undef block.

mirror/service.pp gets some defaults from params.pp instead of mirror.pp

mirror/service.pp contains:

  $service_requires_zookeeper   = $kafka::mirror::service_requires_zookeeper,
  $consumer_config              = $kafka::params::consumer_config,
  $producer_config              = $kafka::params::producer_config,
  $num_streams                  = $kafka::mirror::num_streams,
  $num_producers                = $kafka::mirror::num_producers,
  $abort_on_send_failure        = $kafka::mirror::abort_on_send_failure,
  $whitelist                    = $kafka::mirror::whitelist,
  $blacklist                    = $kafka::mirror::blacklist,
  $max_heap                     = $kafka::mirror::max_heap,
  $config_dir                   = $kafka::params::config_dir,
  Stdlib::Absolutepath $bin_dir = $kafka::params::bin_dir,

All the parameters should have defaults coming from mirror.pp and not params.pp.

The init script always requires the zookeeper service

The init script is created from:

# Provides:          <%- @service_name -%>
# Required-Start:    zookeeper
# Required-Stop:

So zookeeper is always required.

As contrast, the Systemd unit file uses the service_requires_zookeeper variable via:

<%- if @service_requires_zookeeper -%>
Wants=zookeeper.service
After=network.target syslog.target zookeeper.service
Requires=zookeeper.service
<%- else -%>
After=network.target syslog.target
<%- end -%>

Incompatibility beetween $install_dir and $version params

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.7
  • Ruby: 2.0.0
  • Distribution: CentOs7
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

  class { '::kafka' :
    install_java => false,
    version      => '0.10.0.1',
    install_dir  => '/mydir/kafka'
  }

What are you seeing

Install directory is /opt/kafka-2.11-0.10.0.1

What behaviour did you expect instead

Install directory should be /mydir/kafka

Output log

Any additional information you'd like to impart

I think the bug comes from this piece of code (from init.pp):

if $version != $kafka::params::version {
    $install_directory = "/opt/kafka-${scala_version}-${version}"
  } elsif $scala_version != $kafka::params::scala_version {
    $install_directory = "/opt/kafka-${scala_version}-${version}"
  } else {
    $install_directory = $install_dir
  }

include statements do not need quotes

The include statements we use do not use quotes except in one place:

$ grep -r include *
manifests/broker/service.pp:      include ::systemd
manifests/consumer/service.pp:    include ::systemd
manifests/mirror/service.pp:    include ::systemd
manifests/init.pp:    include '::archive'

We should be consistent and never use quotes.

Centos 7 install

Puppet version 3.8.7.
puppet-kafka 2.1.0.

I'm having trouble getting this to work on a centos 7 server. It seems as though it tries and fails to start the service. I've used this same code on our ubuntu 14 servers and it works perfectly. I've also tried using puppet-kafka 3.0.0 but it has the same result.

Heres the code I'm using:

# install zookeeper
	if($::osfamily == 'Debian'){
		class { 'zookeeper':
        install_java => false,
        servers => [
          "$::ipaddress"
        ]

		}
	}
	elsif($::osfamily == 'RedHat'){
	    class { 'zookeeper':
		repo => 'cloudera',
		cdhver => '5',
		initialize_datastore => true,
        require => Exec['remove-ai-folders'],
        install_java => false,
		service_provider => 'systemd',
        servers => [
          "$::ipaddress"
        ]

		}
	}

    #intall kafka
    class{ 'kafka':
        require => Class["zookeeper"],
        version => '0.10.1.0',
        install_java => false,
        scala_version => '2.11'
    }

    class {'kafka::broker':
        require => Class['kafka'],
        install_java => false,
        service_ensure => 'running',
        service_install => true,
		version => '0.10.1.0',
		scala_version => '2.11',
        config => {
            'broker.id' => '0',
            'zookeeper.connect' => "$::ipaddress:2181",
            'inter.broker.protocol.version' => '0.10.1.0',
			'log.retention.minutes' => 5,
        }
    }

As you can see I have to get zookeeper through cloudera first. I have checked and the zookeeper service is running. Here are the errors I'm getting.

2017-05-31 17:00:23 +0000 Puppet (notice): Compiled catalog for ip-10-1-1-30 in environment production in 0.80 seconds
2017-05-31 17:00:24 +0000 Puppet (err): Could not start Service[kafka]: Execution of '/bin/systemctl start kafka' returned 5: Failed to start kafka.service: Unit not found.
2017-05-31 17:00:24 +0000 /Stage[main]/Kafka::Broker::Service/Service[kafka]/ensure (err): change from stopped to running failed: Could not start Service[kafka]: Execution of '/bin/systemctl start kafka' returned 5: Failed to start kafka.service: Unit not found.

I've also tried setting mirror_url but it doesn't seem to have any effect. Does anyone have any insight in how to get this to work with Centos 7? Does it have anything to do with the fact that I installed zookeeper through the cloudera repo?

Thanks for any help

The kafka::broker::topic defined type should rather be kafka::topic

The module only has one defined type, used to manage topics: kafka::broker::topic.

However, this code has nothing in common with kafka::broker. It is generic and could equally well be used along with brokers, producers or consumers.

So this defined type should rather be named kafka::topic.

Note also that the manifests/broker/topic.pp file has incorrect documentation as it contains:

# This private class is meant to be called from `kafka::broker`.

It is not a (private) class and it is not called from kafka::broker.

systemv init created log files are not being rotated

on a systemv platform the log files created by our init scripts are only ever written to but never rotated. Additionally, a restart will cause the existing file to be overwritten.

There are a couple of ways to solve this:

  • add a logrotate entry
  • use logger(1) — that way we're systemd compatible
  • don't redirect stdout/stderr — instead change the log4j.rootLogger=INFO, stdout

all of those come with advantages/drawbacks:

  • the first option adds a potential dependency on a third-party module
  • the second option is most simple
  • the last point seems most sensible

If we go with the last, we should add a symlink between /var/log/kafka and /opt/kafka/logs — for compatibility.

kafka::mirror is critically broken

The kafka::mirror class calls kafka::mirror::config which has a $consumer_config parameter that defaults to the $kafka::params::consumer_config_defaults variable located in kafak::params. This variable is a single level deep hash that contains Kafka application specific configuration properties.

But, in kafka::mirror::config on line 25 (https://github.com/voxpupuli/puppet-kafka/blob/master/manifests/mirror/config.pp#L25), that same consumer config hash is passed to the Puppet create_resources() command, which only accepts very specific hash of Puppet resource parameters. See: https://docs.puppetlabs.com/puppet/latest/reference/function.html#createresources

Line 25 can't work and couldn't have ever worked in any recent Puppet version. Is the mirror code only experimental and should not be used?

ability to set the service to disabled

Hi,

have you thought of adding the ability to decide if the service for the 'kafka::broker' is enabled or disabled? that way we could use a different system / custom script (i.e. upstart / systemd ) to manage the service for the broker if we wanted to.

The configuration directory should be owned by root

The current code contains:

  file { $config_dir:
    ensure => directory,
    owner  => 'kafka',
    group  => 'kafka',
  }

Since Kafka does not need to write to the configuration directory, it should be owned by root, just like all the other configuration directories (/etc and below).

Support for an offline/file based mirror

This is just a suggestion (as my puppet knowledge is quite limited).

It might be useful to add in the ability to use a puppet file server URI as a mirror instead of assuming an online mirror, as in some installs there will not be a connection available to the internet.

I've currently tried to add alter the code to support this by:

Removing the validate_re call and replacing it with a variable called $mirror_type that determines if a mirror is a HTTP URL (suitable for the current wget based download) or a file based URI (like puppet://my-module/ or /vagrant/deps):

  $mirror_type = $mirror_url ? {
    /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ => 'http',
    default                                                          => 'file',
  }

Then altering the install logic to use a File resource instead of the Exec resource when pointing at a file based mirror:

  if $mirror_type == 'http' {

    if ! defined(Package['wget']) {
      package {'wget':
        ensure => present,
      }
    }

    notify { "Downloading Kafka via http mirror ${package_url}": }->

    exec { 'download-kafka-package':
      command => "wget -O ${package_dir}/${basefilename} ${package_url} 2> /dev/null",
      path    => ['/usr/bin', '/bin'],
      creates => "${package_dir}/${basefilename}",
      require => [ File[$package_dir], Package['wget'] ],
    }

    $required_get_step = Exec['download-kafka-package']

  } else {

    notify { "Downloading Kafka via file mirror ${package_url}": }->

    file { 'get-kafka-package':
      source  => $package_url,
      path    => "${package_dir}/${basefilename}",
      owner   => 'kafka',
      group   => 'kafka',
      require => [ File[$package_dir], User['kafka'] ],
    }

    $required_get_step = File['get-kafka-package']
  }

  exec { 'untar-file-kafka-package':
    command => "tar xfvz ${package_dir}/${basefilename} -C ${install_directory} --strip-components=1",
    creates => "${install_directory}/LICENSE",
    alias   => 'untar-kafka',
    require => [ $required_get_step, File['kafka-app-dir'] ],
    user    => 'kafka',
    path    => ['/bin', '/usr/bin', '/usr/sbin'],
  }

If you're interested I can create a pull request later this week to illustrate this better?

master branch not tagged

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.5.0
  • Ruby: ruby 2.2.4p230
  • Distribution: centos
  • Module version: 2.1.0

How to reproduce (e.g Puppet code you use)

class { 'kafka::broker':
service_requires_zookeeper => false,
config => { 'broker.id' => fqdn_rand(50), 'zookeeper.connect' => "$zookeeper_ip" }
}

What are you seeing

error

What behaviour did you expect instead

no error

Output log

Any additional information you'd like to impart

i see that your branch master doesn't tagged yet, latest tag is 2.1.0 doesn't include parameter service_requires_zookeeper in broker.pp. Would be nice if master branch also tagged, so the others can include it in Puppetfile. Thanks

Enable customized log4j.properties files

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: current
  • Ruby: current
  • Distribution: current
  • Module version: current

How to reproduce (e.g Puppet code you use)

Let Kafka run for several days.

What are you seeing

Logfiles are rotated but never deleted. Even logrotate does not work in this case.

What behaviour did you expect instead

Possibility to configure the logfiles retention in this puppet module

Output log

n/a

systemv init: "$PID_FILE does not exist, process is not running" can be wrong

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: any
  • Ruby: any
  • Distribution: Debian/Ubuntu
  • Module version: v2.0.0

How to reproduce (e.g Puppet code you use)

¯(°_o)/¯

What are you seeing

when kafka died a horrible death (unclean shutdown? kill -9?) it can happen that the pid file isn't cleaned up properly. So, even though it's running, our init script says it's not, and doesn't even attempt to stop it

What behaviour did you expect instead

same as systemd…

Any additional information you'd like to impart

this is my fault, sorry

Arbitrary shell variables cannot be set

With a systemd based OS, some environment variables can be set via Puppet parameters. They are:
KAFKA_HEAP_OPTS, KAFKA_LOG4J_OPTS, KAFKA_JMX_OPTS and KAFKA_OPTS.

However, one may need to set other variables used in kafka-run-class.sh like LOG_DIR or JAVA.

unit.erb could be extended but this would be quite messy since there are many variables that could be set.

Another approach would be to use EnvironmentFile instead of Environment in unit.erb and allow the user to specify the content of this "environment file".

Systemd

Hi there,

I was just about to give you all the stuff for systemd that I'd just created, but see that in the last 9 hours you have pushed your own stuff. Just a couple of things from my playing with your module.

To your systemd template you probably want to add:
Environment=LOG_DIR=/var/log/kafka
As other wise its going to default to . (thats buried in kafka_run_class.sh)

In class kafka::broker::service, before you create the systemd template you probably want to add:

    if $kafka::broker::install_dir == '' {
        $install_directory = "/opt/kafka-${kafka::broker::scala_version}-${kafka::broker::version}"
    } else {
        $install_directory = $kafka::broker::install_dir
    }

Which is what you do in the installer. And then change the execstart and execstop to:

ExecStart=<%= @install_directory %>/bin/kafka-server-start.sh <%= @install_directory %>/config/server.properties
ExecStop=<%= @install_directory %>/bin/kafka-server-stop.sh

Otherwise if the user changes the install location (like I did) it will all still work. Hope that helps.

Really like your module. Keep up the excellent work.
Thanks.
Paul.

kafka service should wait for zookeeper

When building a new server with kafka (and zookeeper) we see that kafka doesn't come up until after restarting zookeeper — and then starting kafka.

We'd expect new servers to simply provision and have a running and functioning kafka broker.

Perhaps as a first step towards improvement we should specify depends in the systemd unit / systemv init script.?

The "bin" directory is not configurable

Several files (mainly init.erb and unit.erb) assume that the Kafka directory holding the scripts is /opt/kafka/bin.

Just like the configuration directory is configurable (via config_dir), the bin directory should also be configurable via an ad-hoc parameter.

Kafka 0.10.0.1 fails to start, inter.broker.protocol.version is set 0.8.2.2

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.7.2
  • Ruby: 2.3.1p112
  • Distribution: Ubuntu 16.04.1 LTS
  • Module version: 2.1.0

How to reproduce (e.g Puppet code you use)

class { '::kafka::broker':
  version => '0.10.0.1',
}

What are you seeing

Kafka fails to start with:

[2016-11-01 14:39:17,668] FATAL  (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: log.message.format.version 0.10.0-IV1 cannot be used when inter.broker.protocol.version is set to 0.8.2.2

What behaviour did you expect instead

Kafka process should start successfully.

Output log

Pasted above.

Any additional information you'd like to impart

This is caused by inter.broker.protocol.version being set to 0.8.2.2 in params.pp on this line. Can go around it by setting the desired version in the ::kafka::broker class, but a better alternative is to set 'inter.broker.protocol.version' => $version, in params.pp.

Fix regexp for URL validation (or remove URL validation at all)

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.8.5
  • Ruby: ruby 1.9.3p484
  • Distribution: Ubuntu 14.04
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

$mirror_url          = 'http://10.109.5.2:8080/plugins/kafka-0.1/repositories/ubuntu'

class { 'kafka':
  version       => $kafka_version,
  scala_version => '2.11',
  mirror_url    => $mirror_url,
}

Output log

http://10.109.5.2:8080/plugins/kafka-0.1/repositories/ubuntu is not a valid url at /etc/fuel/plugins/kafka-0.1/puppet/modules/kafka/manifests/init.pp:49

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.