Sha256: 340ff2a46ca239898280efc3e727c28dd0c6daa9f138dc40efc3162b390c8372
Contents?: true
Size: 1.72 KB
Versions: 3
Compression:
Stored size: 1.72 KB
Contents
# -*- mode: org; auto-fill-mode -*- #+TITLE: Setting up Fluentd #+startup: showeverything * Introduction The following will setup and configure ~fluentd~ on a node. * Setup :setup: Fluentd can be installed either as a package from treasure data or just as a gem. In this example, we only install as a gem: # Fails because of permissions #+begin_src sh :shebang #!/bin/bash gem list | grep fluentd fluentd_installed=$? if [ $fluentd_installed -ne 0 ]; then echo "Installing fluentd..."; gem install fluentd fi gem list | grep fluent-logger fluentd_logger_installed=$? if [ $fluentd_logger_installed -ne 0 ]; then echo "Installing fluent-logger for Ruby..."; gem install fluent-logger fi #+end_src * Configuration :config: Set Fluentd to listen on the ~fluentd_port~ port and to write logs to ~fluentd_filepath~. #+begin_src conf :tangle fluentd.conf <source> type forward port 4224 </source> <match **> type file path here.log flush_interval 0s </match> #+end_src # A script to daemonize the process could be written here, as well as # any /etc/default/* required settings... * Flusher Send some logs: #+begin_src ruby :shebang #!/usr/local/bin/ruby require 'fluent-logger' sleep 2 # Wait for fluentd to start at the beginning Fluent::Logger::FluentLogger.open(nil, :host => 'localhost', :port => 4224) 100.times do |n| Fluent::Logger.post("myapp.access", {"agent"=>"foo - #{n}"}) sleep 0.1 end #+end_src * Tailer And yet another process which will be tailing the file that we are sending logs too: #+begin_src sh :shebang #!/bin/bash tail -f here.* #+end_src * Start which was configured here :start: #+begin_src bash :shebang #!/bin/bash fluentd -c fluentd.conf -vvv #+end_src
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
org-converge-0.0.5 | examples/fluentd/setup.org |
org-converge-0.0.4 | examples/fluentd/setup.org |
org-converge-0.0.3 | examples/fluentd/setup.org |