nerve

This puppet module installs and configures Nerve as part of Airbnbs SmartStack
Kyle Anderson

Kyle Anderson

KyleAnderson

8,827 downloads

5,277 latest version

3.9 quality score

Version information

  • 0.0.6 (latest)
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Jul 3rd 2019

Start using this module

Documentation

KyleAnderson/nerve — version 0.0.6 Jul 3rd 2019

#nerve Build Status

##Overview

This puppet module installs and configures Nerve as part of Airbnb's SmartStack.

It allows you to dynamically register services in Zookeeper. See also Puppet-Synapse to configure the Synapse side of SmartStack: a local HAproxy that allows your services to find other services registered in zookeeper, by only needing to connect to localhost.

##Installation

puppet module install KyleAnderson/nerve
# Or librarian-puppet, r10k, whatever

##Usage

Default settings ensure present, and use system packages:

include nerve

Use gem install:

class { 'nerve': 
  package_provider => 'gem'
}

Use system packages, latest, but not running:

class { 'nerve':
  package_ensure => 'latest',
  service_ensure => 'stopped',
}

See init.pp or params.pp for more fields you can override. You can do things like:

  • instance_id (defaults to $::fqdn)
  • config_file (defaults to /etc/nerve/nerve.conf.json)
  • config_dir (defaults to /etc/nerve/conf.d/)
  • etc.

Registering Services

These are the defaults (Everything optional except for port):

nerve::register { 'service1':
  port           => '3000',
  target         => '/etc/nerve/conf.d/service1.json',
  host           => '127.0.0.1',
  zk_hosts       => ["localhost:2181"],
  zk_path        => "/nerve/services/service1",
  check_interval => '2',
  checks         => [
    {
      'type' => 'http',
      'uri'  => '/health',
      'timeout' => '0.2',
      'rise'    => '3',
      'fall'    => '2'
    }
  ],
}

zk_hosts is an array of strings. Checks is an array of hashes.

##Limitations

The OS support assumes that rubygem-nerve is available or gem install nerve is functioning. (depending on the provider you specify)

##Development Open an issue or fork and open a Pull Request