Coder Social home page Coder Social logo

nevesenin / logjam-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skaes/logjam-tools

0.0 3.0 0.0 962 KB

command line tools and daemons for logjam

License: GNU General Public License v3.0

Makefile 0.92% Shell 3.96% M4 1.84% C 92.88% Objective-C 0.40%

logjam-tools's Introduction

Logjam Tools

A collection of programs and daemons to build the server side infrastructure for logjam (see https://github.com/skaes/logjam_app).

Coverity Scan Build Status

Currently the following programs are provided:

logjam-device

A daemon which offers a ZeroMQ PULL socket endpoint for applications to connect to and a ZeroMQ SUB socket for forwarding. It optionally subscribes to a RabbitMQ server to collect application messages from there and republishes them on the PUB socket. It can compress the log stream on the fly to reduce network traffic, although compressing it at the producer is preferable. You can run as many of those devices as needed to scale the logging infrastructure.

logjam-importer

A multithreaded daemon using CZMQ's actor framework which has replaced all of the ruby importer code in logjam. It's much less resource intensive than the ruby code and a lot faster.

logjam-httpd

A daemon which takes frontend performance data via HTTP GET requests and publishes it on a ZeroMQ PUB socket for the importer to pick up.

logjam-graylog-forwarder

A daemon which subscribes to PUB sockets of logjam-devices and forwards GELF messages to a graylog GELF socket endpoint.

logjam-dump

A utility program to capture messages sent from a logjam device and log them to disk.

logjam-replay

A utility program to replay messages captured by logjam-dump. Useful in determining maximum system throughput. Mimics a logjam-device.

logjam-pubsub-bridge

A utility program which subscribes to a logjam-device PUB socket, decompresses and forwards messages to a PUSH socket. Only to be used when writing the decompression logic is to cmplex for a consumer.

logjam-logger

A utility program which reads lines from stdin and publishes them on a PUB socket, optionally using a given topic.

logjam-tail

A utility program which connects to a logjam-logger PUB socket and displays lines matching an optional list of topics on stdout.

Default ports

This is the list of ports to which various programs bind, along with the ZeroMQ socket types behind the ports.

9604

A ZeroMQ BROKER socket for which implements the server side of the logjam producer protocol (logjam-device, logjam-importer). See producer_protocol.

9605

A ZeroMQ PUSH socket to which logjam messages can be sent (logjam-device, logjam-importer).

9606

A ZeroMQ PUB socket on which logjam messages are published (logjam-device). Messages sent over this socket follow the logjam consumer protocol. See consumer_protocol.

9607

A ZeroMQ PUB socket on which live stream messages are published (logjam-importer).

9608 (8080)

A websocket which listens for connects from logjam livestream clients running in browsers (livestream server, currently in ruby, see https://githum.com/skaes/logjam-core).

9609

A ZeroMQ PUSH socket for graylog to connect to (logjam-graylog-forwarder).

Dependencies

  • librabbitmq (0.7.0)
  • libzmq (4.1.4)
  • libczmq (3.0.2)
  • mongo-c-driver (1.3.5)
  • libbson (included in mongo-c-driver as a submodule)
  • json-c (0.12 patched)
  • libsnappy (1.1.3)

Installation

Ubuntu packages

Ubuntu packages are available from .

The are two types of packages available: logjam-tools will install in /opt/logjam/, logjam-tools-usr-local in /usr/local. The tools package uses very recent and sometimes patched libraries. Installing in /usr/local might cause problems with other applications. In this case, use -opt-logjam packages. However, you will need to set some enviroment variables to make use of the libararies provided by logjam: Set ZMQ_LIB_PATH to /opt/logjam/lib in order to use libzmqfrom ffi-rzmq, add /opt/logjam/lib/pkgconfig to PKG_CONFIG_PATH and /opt/logjam/bin to PATH.

Installation instructions how to add the package cloud apt repository can be found here.

The final step is then apt-get install logjam-tools.

Currently, 12.04 LTS and 14.04 LTS are supported.

From source

Start by cloning the repository:

git clone git://github.com/skaes/logjam-tools.git
cd logjam-tools

Then, run ./bin/install-libs to install all dependecies in /usr/local.

If you want to install everything into a separate hierarchy, you can use the --prefix argument like so:

./bin/install-libs --prefix=/opt/logjam

Or install them manually:

Finally

sh autogen.sh
make
sudo make install

The generated ./configure script will try to use pkg-config to find the required libraries. If pkg-config is not installed, it assumes the headers and libraries are installed under /opt/logjam, /usr/local or /opt/local. If they're somewhere else, you can specify --with-opt-dir=dir1:dir2:dir3 as argument to sh autogen.sh (or ./configure).

autogen.sh accepts the usual configure arguments, such as --prefix. Thus, if you have installed the libraries under /opt/logjam, and want to install the logjam tools in the same place, run sh autogen.sh --prefix=/opt/logjam

If you want to get rid of the installed software, run

sudo make uninstall
./bin/install-libs uninstall

Profiling with gperftools

Install Google perftools on your machine (https://code.google.com/p/gperftools/).

Set environment variable CPUPROFILE to the name of the profile data file you want to use. Reconfigure and recompile everything:

CPUPROFILE=logjam.prof sh autogen.sh
make clean
make

Then invoke the command you want to profile. For example:

CPUPROFILE=logjam.prof ./logjam-device -c logjam.conf
pprof --web ./logjam-device logjam.prof

On Ubuntu, you will likely need to add LD_PRELOAD=<path to libprofile.so> to make this work.

License

GPL v3. See LICENSE.txt.

logjam-tools's People

Contributors

skaes avatar boosty avatar

Watchers

Merten Falk avatar James Cloos avatar  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.