mozilla

Installing

Binaries

hekad releases are available on the Mozilla Services website. Binaries are available for Linux and OSX, with packages for Debian and RPM based distributions.

From Source (*nix)

hekad requires a Go work environment to be setup for the binary to be built. This task has been automated in the heka build repository. To create a working hekad binary for your platform you’ll need to install some prerequisites. Many of these are standard on modern linux distributions and OSX.

Prerequisites:

  • cmake 2.8 or greater
  • make
  • gcc
  • g++
  • git
  • go 1.1 or greater (1.1.1 recommended)
  • python 2.6 or greater
  • patch
  • mercurial
  1. Check out the heka build repository:

    git clone https://github.com/mozilla-services/heka-build.git
    
  2. Run make in the heka-build directory (builds the current release (master branch); if you have go installed in a non-standard location, you may need to set the GOROOT environment variable):

    cd heka-build
    make
    

You will now have a hekad binary in the heka-build/bin directory.

  1. (Optional) Run the tests to ensure a functioning hekad:

    make test
    
  2. (Optional) If you want to build the latest code in development, run make dev to switch to the dev branch and then run make. If you need to revert back to the master branch at some point run make undev.

From Source (Windows)

Prerequisites (manual setup):

  1. From a Git shell check out the heka build repository:

    git clone https://github.com/mozilla-services/heka-build.git
    
  2. From a MinGW shell run build.bat in the heka-build directory:

    cd heka-build
    build
    
  3. (Optional) Run the tests to ensure a functioning hekad:

    mingw32-make test
    

You will now have a hekad binary in the release/heka-0_2_0_w(32|64)/bin directory.

Building hekad with External Plugins

It is possible to extend hekad by writing input, decoder, filter, or output plugins in Go (see Extending Heka). Because Go only supports static linking of Go code, your plugins must be included with and registered into Heka at compile time. heka build supports the use of a {heka-build- root}/etc/plugin_packages.json file to specify which packages you’d like to include in your build. The JSON should be an object with a single plugin_packages attribute, with the value an array of package paths. For example:

{"plugin_packages": ["github.com/mozilla-services/heka-mozsvc-plugins"]}

would cause the github.com/mozilla-services/heka-mozsvc-plugins package to be imported into hekad when you run make. By adding an init() function in your package you can make calls into pipeline.RegisterPlugin to register your plugins with Heka’s configuration system.

Creating RPM/Deb Packages

Installing packages on a system is generally the easiest way to deploy hekad. These packages can be easily created after following the above From Source directions:

  1. Install fpm:

    gem install fpm
    

2. Run make debs (or rpms) to build the appropriate package (in the heka-build directory):

make debs

The packages will be in the debs or rpms directory.

Note

You will need rpmbuild installed to build the rpms.