Skip to content

Puppet module to manage the nerve side of Airbnb's SmartStack

License

Notifications You must be signed in to change notification settings

S2Games/puppet-nerve

 
 

Repository files navigation

#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',
  service_hosts  => ["localhost:2181"],
  service_path   => "/nerve/services/service1",
  service_type   => 'zookeeper',
  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)

TODO: More init script stuff (more than upstart) and rspec-system tests.

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

About

Puppet module to manage the nerve side of Airbnb's SmartStack

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Ruby 55.1%
  • Puppet 44.9%