Install by Ruby Gem

Installing Fluentd using Ruby Gem

  1. Install Ruby Interpreter.

Install Ruby >= 2.4 on your local environment. In addition, install ruby-dev package via Package Manager to build native extension gems.

  1. Install Fluentd Gem.

Fetch and install the fluentd Ruby gem using the following gem command:

$ gem install fluentd --no-doc
  1. Run the following commands to verify the Fluentd installation.
$ fluentd --setup ./fluent
$ fluentd -c ./fluent/fluent.conf -vv &
$ echo '{"json":"message"}' | fluent-cat debug.test

The second command starts Fluentd as a daemon. If you want to stop its daemon, you can use $ pkill -f fluentd. The last command sends Fluentd a message '{"json":"message"}' with a debug.test tag. If the installation is successful, Fluentd will output the following message:

2011-07-10 16:49:50 +0900 debug.test: {"json":"message"}

It is highly recommended to set up ntpd on the node to prevent invalid timestamps in your logs.

For large deployments, you must use jemalloc to avoid memory fragmentation. This is already included in the rpm and deb packages.

The Fluentd gem does not come with /etc/init.d/ scripts. You should use Process Management tools such as:

  • daemontools
  • runit
  • supervisord
  • upstart
  • systemd

You must now install the SixthSense log monitoring agent. For more informaiton, see Installing Log Monitoring agents.