系统小窝欢迎您

当前位置:系统小窝 > 系统教程 > Linux教程 >

在RedHat上安装Fluentd的步骤

时间:2021-04-10    来源:大神到    人气:

Fluentd作为一个日志收集系统,其用户还是非常大的,可是安装Fluentd的步骤非常繁琐,许多人在安装的时候就遇到了难题,下面小编就给大家介绍下RedHat安装Fluentd的方法。

下载fluentd安装包并解压

tar zxvf fluentd-0.10.6.tar.gz

cd fluentd-0.10.6

。/configure

make

切换到root账号

make install

提示如下

rake aborted!

Unable to determine name from existing gemspec. Use :name =》 lsquo;gemnamersquo; in #install_tasks to manually set it.

/usr/local/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:30:in `initializelsquo;

/usr/local/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:14:in `newrsquo;

/usr/local/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:14:in `install_taskslsquo;

/home/aircom/fluentd-0.10.6/Rakefile:6:in `《top (required)》rsquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:2373:in `loadlsquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefilersquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefilelsquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handlingrsquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefilelsquo;

/usr/local/lib/fluent/ruby/lib/ruby/1.9.1/rake.rb:1991:in `runrsquo;

-e:1:in `《main》lsquo;

make: *** [install] Error 1

安装ruby

rz ruby-1.9.3-p0.tar.gz

tar zxvf ruby-1.9.3-p0.tar.gz

cd ruby-1.9.3-p0

。/configure

make

make install

验证ruby

[root@Server201 ruby-1.9.3-p0]# ruby -v

得到提示信息

ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

执行安装

gem install fluentd

提示如下,不必理会,等待安装,稍等一会儿(视网络情况)可看到安装进度。

/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `《top (required)》rsquo;:

It seems your ruby installation is missing psych (for YAML output)。

To eliminate this warning, please install libyaml and reinstall your ruby.

命令执行完之后

执行fluentd --setup

提示Installed /etc/fluent/fluent.conf.

执行fluentd -c fluent.conf -vv

 

输出

2012-09-27 17:45:16 +0800: fluent/supervisor.rb:153:supervise: starting fluentd-0.10.26

2012-09-27 17:45:16 +0800: fluent/supervisor.rb:235:read_config: reading config file path=;fluent.conf;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered buffer plugin lsquo;filersquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered buffer plugin lsquo;memoryrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;debug_agentrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;execrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;forwardrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;gc_statrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;httprsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;object_spacersquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;statusrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;tcprsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;unixrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;syslogrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered input plugin lsquo;tailrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;copyrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;execrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;exec_filterrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;filersquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;forwardrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;nullrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;roundrobinrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;stdoutrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;tcprsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;unixrsquo;

2012-09-27 17:45:16 +0800: fluent/plugin.rb:89:register_impl: registered output plugin lsquo;testrsquo;

2012-09-27 17:45:16 +0800: fluent/engine.rb:65:block in configure: adding source type=;forward;

2012-09-27 17:45:16 +0800: fluent/engine.rb:65:block in configure: adding source type=;http;

2012-09-27 17:45:16 +0800: fluent/engine.rb:81:block in configure: adding match pattern=;debug.**; type=;stdout;

2012-09-27 17:45:16 +0800: plugin/in_forward.rb:61:listen: listening fluent socket on 0.0.0.0:24224

2012-09-27 17:45:16 +0800: plugin/in_http.rb:74:start: listening http on 0.0.0.0:8888

验证监听端口

netstat -na | grep 88

tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN

tcp 0 0 127.0.0.1:48241 127.0.0.1:8888 TIME_WAIT

udp 0 0 :::58872 :::*

unix 2 [ ] DGRAM 9880

unix 2 [ ] DGRAM 8859

unix 2 [ ] DGRAM 8846

unix 2 [ ] DGRAM 8806

发送数据验证

echo lsquo;{;json;:;message;}rsquo;|fluent-cat debug.test

得到输出

2012-09-27 17:45:32 +0800: plugin/in_forward.rb:140:initialize: accepted fluent socket object_id=95324080

2012-09-27 17:45:32 +0800 debug.test: {;json;:;message;}

2012-09-27 17:45:32 +0800: plugin/in_forward.rb:181:on_close: closed fluent socket object_id=95324080

至此安装全部完成。

上面就是RedHat安装Fluentd的介绍了,安装的时候需要联网,采用的是在线安装,当然你也可以先安装ruby,不影响Fluentd的安装。

相关文章

  • RedHat系统下fdisk命令不能使用全部分区怎么处理?

    RedHat系统下fdisk命令不能使用全部分区怎么处理?

    RedHat是非常流行的一款Linux系统,RedHat包括其他Linux系统都可以用fdisk命令对磁盘进行重新分区。某些情况下fdisk命令无法使用全部的分区,这是怎么回事呢...
    2021-04-09 03.04.22
  • 如何在rhel6.3上安装配置Apache

    如何在rhel6.3上安装配置Apache

    rhel是Red Hat公司的Linux系统,而yum则是在其系统下的shell前端软件包管理器,下面小编要给大家介绍的是rhel6.3如何使用yum安装Apache,一起来学习下吧。...
    2021-04-09 08.04.49
  • RedHat如何安装log4cxx日志库

    RedHat如何安装log4cxx日志库

    log4cxx日志库是一种动态库,用于记录c++的日志,那么RedHat系统下要如何安装log4cxx日志库呢?下面小编就给大家介绍下RedHat安装log4cxx日志库的步骤,感兴趣...
    2021-04-09 08.04.04
  • RedHat6.5网卡常见问题及解决方法

    RedHat6.5网卡常见问题及解决方法

    RedHat是运用广泛的Linux系统,在RedHat6.5的版本中,在联网的时候经常会遇到一些网卡问题,下面小编给大家整理了RedHat6.5网卡常见的问题及解决方法,希望...
    2021-04-09 08.04.59
  • RedHat/CentOS 7通过nmcli命令管理网络的步骤

    RedHat/CentOS 7通过nmcli命令管理网络的步骤

    Red Hat Enterprise Linux 7 和CentOS 7 的网络管理实际上是对NetworkManager的管理,可通过nmcli命令进行控制,下面小编就给大家介绍下RedHat/CentOS 7通过nmcli命令管理网...
    2015-06-10 03.06.15

发表评论

验证码: 看不清?点击更换

注:网友评论仅供其表达个人看法,并不代表本站立场。