Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Latest commit

 

History

History
85 lines (63 loc) · 2.96 KB

README.md

File metadata and controls

85 lines (63 loc) · 2.96 KB

Setup

$ git submodule update --init
$ make

Erlang version

Tested on Erlang R13B04

EUnit tests

prereq: start a local redis server on the default port 6379

$ bin/test

Run

Development

$ bin/console

Production

*note: assumes Ubuntu/Upstart for start/stop commands

$ [start|stop|restart] logplex
$ bin/connect ('ctrl-g q' to exit)

Environment Variables

  • LOGPLEX_COOKIE - Erlang cookie, important for multiple node grid (not required)
  • LOGPLEX_CONFIG_REDIS_URL - config data redis url (default: redis://127.0.0.1:6379)
  • HTTP_PORT - http port (default: 80)
  • LOGPLEX_AUTH_KEY - api http header 'Authorization' == LOGPLEX_AUTH_KEY (required)
  • LOCAL_IP - ip to register with other logplex nodes (default: 127.0.0.1)
  • LOGPLEX_WORKERS - number of workers pulling from queue (default: 10)
  • LOGPLEX_DRAIN_WRITERS - number of writers pulling from buffer and writing to drains (default: 100)
  • LOGPLEX_REDIS_WRITERS - number of writers pulling from buffer and writing to redis (default: 100)
  • LOGPLEX_READERS - number of readers pulling from read queue (default: 100)
  • LOGPLEX_QUEUE_LENGTH - max length of read queue (default: 2000)
  • LOGPLEX_DRAIN_BUFFER_LENGTH - max length of drain write buffer (default: 2000)
  • LOGPLEX_REDIS_BUFFER_LENGTH - max length of redis write buffer (default: 2000)
  • LOGPLEX_READ_QUEUE_LENGTH - max length of read queue (default: 2000)

Sharding

Add new log redis url to config redis shard key:

sadd redis:shard:urls redis://password@hostname:6379/

Redis Keys

ch:336:data (hash)
drain:57:data (hash)
tok:t.abcdefghijklmnopqrstuvwxyz:data (hash)
ch:17:spool (list)
/sessions/09743165504ecc6c4db21cbb0083c030 (string)
drain_index (counter)
channel_index (counter)
healthcheck (counter)
node:heroku.com:10.100.0.1 (string)
redis:shard:urls (set)

License

Copyright (c) 2010 Jacob Vorreuter jacob.vorreuter@gmail.com

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.