Git Product home page Git Product logo

puppet-linuxptp's Introduction

linuxptp

Table of Contents

  1. Module Description
  2. Setup
  3. Usage
  4. Limitations
  5. Development

Module Description

The linuxptp module manages the Linux PTP Project software (http://linuxptp.sourceforge.net/), an implementation of the Precision Time Protocol.

Setup

What linuxptp affects

  • Installs the linuxptp package
  • Can configure one or multiple ptp4l instances
  • Can manage the ptp4l and phc2sys services, but best run with Supervisor

Setup Requirements

The linuxptp package can be found in a number of repositories, CentOS 6 has version 1.4. Personally I recommend at least version 1.6.

Beginning with linuxptp

The linuxptp package contains three binaries, ptp4l, phc2sys and timemaster. This module manages ptp4l and phc2sys only. ptp4l can be run as a PTP Ordinary or Boundary Clock, and phc2sys is used to synchronise one clock with another in a system.

The linuxptp software needs to heavily configured for your environment. A good starting point is the project page, then the man pages, and you'll need a reasonable understanding of PTP as well.

The module is designed to be friendly for running multiple ptp4l and phc2sys instances on the one box using a program like Supervisor. It does this by adding extra config and run directories so the instances don't step on each other.

You can use the normal services however you will need to take care of getting the right configuration file and arguments to the right daemons. In Red Hat land this is the /etc/sysconfig/ptp4l and /etc/sysconfig/phc2sys files, which this module does not manage.

I personally run the software instances with ajcrowe-supervisord, I have an example of this on a blog post.

Usage

Stop the standard linuxptp services, create a configuration file for a ptp4l instance, and run two supervisord programs, one for ptp4l and one to synchronise the eth0 clock to eth1:

class { 'linuxptp':
  ptp4l_service_ensure   => 'stopped',
  ptp4l_service_enable   => false,
  phc2sys_service_ensure => 'stopped',
  phc2sys_service_enable => false,
}
linuxptp::ptp4l { 'master-clock':
  interfaces => [ 'eth0', 'eth1' ],
}
supervisord::program { 'master-clock':
  command => '/usr/sbin/ptp4l -f /etc/ptp4l/master-clock.conf',
}
supervisord::program { 'clock-sync':
  command => '/usr/sbin/phc2sys -s eth0 -c eth1 -w -z /var/run/ptp4l/master-clock',
}

Multicast Time To Live (TTL)

By default ptp4l will multicast packets with a TTL of 1. Certain brands of firewall (eg: Fortinet) will not forward multicast with a TTL of 1, so you need to set it higher:

linuxptp::ptp4l { 'master-clock':
  interfaces => [ 'eth0' ],
  ptp_ttl    => 2,
}

Logging

By default the module uses rodjek-logrotate to rotate log files under /var/log/linuxptp. You can disable this like so:

class { 'linuxptp':
  manage_logrotate_rule => false,
}

Both ptp4l and phc2sys will take the -q (suppress syslog) and -m (write to stdout). You can then use supervisord's logging facilities to send output to the common log directory:

supervisord::program { 'clock-sync':
  command => '/usr/sbin/phc2sys -q -m -s eth0 -c eth1 -w -z /var/run/ptp4l/master-clock',
  stdout_logfile          => '/var/log/linuxptp/clock-sync.log',
  redirect_stderr         => true,
  stdout_logfile_maxbytes => 0,
  stdout_logfile_backups  => 0,
}

Limitations

The module is tested against CentOS 6. It should work in most other flavours, and I'm happy to accept pull requests for other distros.

Development

We will accept pull requests from GitHub.

puppet-linuxptp's People

Contributors

lukebigum avatar

Watchers

James Cloos avatar zshi avatar

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.