系统小窝欢迎您

电脑公司 深度技术
当前位置:系统小窝 > 系统教程 > 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 Linux 5无法使用ifconfig怎么办?

    RedHat Linux 5无法使用ifconfig怎么办?

    ifconfig是Linux显示网络设备的命令,能够设置网络设备的状态,但在RedHat Linux 5系统中,有时会遇到ifconfig命令无法使用的情况,下面小编就给大家介绍下R...
    2015-02-06 06.02.45
  • RedHat软件源提示Unable to read consumer identity怎么办?

    RedHat软件源提示Unable to read consumer identity怎么办?

    不少用户在安装完RedHat系统后,安装软件源时出现了错误提示,即“Unable to read consumer identity”,这是什么原因导致的呢?又该如何解决,下面小编就给大...
    2015-03-02 08.03.10
  • 在RedHat中配置KVM网络的步骤

    在RedHat中配置KVM网络的步骤

    KVM是一款虚拟机,在RedHat系统上安装KVM后,需要对KVM进行网络配置,具体该如何操作呢?下面小编就给大家介绍下RedHat配置KVM网络的方法,感兴趣的朋友不...
    2015-03-06 05.03.37
  • RedHat下载安装JDK的方法

    RedHat下载安装JDK的方法

    在RedHat系统中,因为编程的需要,要在系统上安装JDK,因为需要使用命令安装,所以不少人不知道要如何安装,下面小编就给大家介绍下RedHat下载安装JDK的...
    2015-03-11 05.03.12
  • 在RedHat上安装yum的步骤

    在RedHat上安装yum的步骤

    yum是shell前端软件包管理器,是Linux下用来下载安装应用的软件,那么在RedHat系统中,yum要如何安装使用呢?下面小编将针对yum在RedHat中的安装给大家做个详...
    2015-03-23 05.03.55

发表评论

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

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