Coder Social home page Coder Social logo

puppet-master-health-check's Introduction

Puppet Master Health Check for HAProxy

A simple xinetd based health check to monitor puppet masters for load balancers (HAProxy). For more information on setup and configuration please see my blog post Puppet Master Health Check for HAProxy. I'll only have basic instructions here.

Usage

Basic setup to change the HAProxy health check from the puppet port to a script that checks the actual status of the puppet master and can be enabled/disabled separately from puppet.

/etc/haproxy/haproxy.cfg

# Load balanced puppetmasters
listen puppetmaster_8140 10.0.0.100:8140
  mode tcp
  balance source
  hash-type map-based
  option httpchk

  server puppetmaster1 10.0.0.101:8140 check port 9200 inter 2000 rise 3 fall 3
  server puppetmaster1 10.0.0.102:8140 check port 9200 inter 2000 rise 3 fall 3

{% endhighlight %}

Xinetd Setup

Place puppetmastercheck xinetd config within /etc/xinet.d/. Place the puppetmastercheck.sh somewhere on your puppetmaster to match the location specified in the xinetd config.

Finally, to get xinetd working you need to create the service used by the server. Add this line to your /etc/services file.

puppetmastercheck 9200/tcp # puppetmastercheck

Configure Puppet

Next we need to configure puppet for our fancy pancy script. Edit /etc/puppet/auth.conf to allow access to the /status/ API URL. So add these lines to your auth.conf.

# Allow access for HAProxy puppetmastercheck
path /status
auth any
method find
allow *

Conclusion and Credits

Let me know either in the comments on the blog or open an issue here if you have any problems or recommendations. I'm not the sharpest tool in the shed so I'm sure there's a better way to do this!

The basis of the script and xinetd config was from the Percona Clustercheck by Olaf van Zandwijk. Thanks!

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.