我在Ubuntu上运行logstash-1.4.1
并收到以下错误:
failed to open /home/Desktop/Input/2014-10-02/abc.log: Permission denied - /home/Desktop/Input/2014-10-02/abc.log {:level=>:warn, :file=>"filewatch/tail.rb", :line=>"107"}
背景: 我将日志的目录结构从远程服务器复制到本地计算机。现在,在我复制的目录结构上运行本地计算机上的logstash时,会发生此错误。
当我检查文件的权限时,它显示两个读写。
有什么想法吗?
正如我现在检查了logstash控制台一样,很明显,logstash 打开某些文件,之后权限被拒绝开始直到结束。
CONSOLE:
_open_file: /home/Desktop/Input/2014-10-11/abc.log: opening {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"98"}
/home/Desktop/Input/2014-10-11/abc.log: initial create, no sincedb, **seeking to beginning** of file {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"133"}
_open_file: /home/Desktop/Input/2014-10-21/abc.log: opening {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"98"}
/home/Desktop/Input/2014-10-21/abc.log: initial create, no sincedb, **seeking to beginning** of file {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"133"}
_open_file: /home/Desktop/Input/2014-11-04/abc.log: opening {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"98"}
failed to open /home/Desktop/Input/2014-11-04/abc.log: **Permission denied** - /home/Desktop/Input/2014-11-04/abc.log {:level=>:warn, :file=>"filewatch/tail.rb", :line=>"107"}
_open_file: /home/Desktop/Input/2014-10-10/abc.log: opening {:level=>:debug, :file=>"filewatch/tail.rb", :line=>"98"}
failed to open /home/Desktop/Input/2014-10-10/abc.log: **Permission denied** - /home/Desktop/Input/2014-10-10/abc.log {:level=>:warn, :file=>"filewatch/tail.rb", :line=>"107"}
是否因为某些限制可能会打开文件数,因为logstash打开文件直到达到限制,之后会给出权限拒绝错误?
我提供权限的文件的权限被拒绝错误:
ls -l ./Input/2014-11-04/abc.log
-rw-rw-r-- 1 userA userA 0 Nov 12 09:56 ./Input/2014-11-04/abc.log
ls -ld ./Input/2014-11-04
drwxrwxr-x 3 userA userA 4096 Nov 12 09:56 ./Input/2014-11-04
ls -l /home/Desktop/Input/2014-10-10/abc.log
-rw-rw-r-- 1 userA userA 0 Nov 12 09:56 /home/userA/Desktop/Input/2014-10-10/abc.log
ls -ld /home/Desktop/Input/2014-10-10
drwxrwxr-x 2 userA userA 4096 Nov 12 09:56 /home/Desktop/Input/2014-10-10
修改
使用userA
运行Logstash。
详细文件权限:
ls -ld /home/
drwxr-xr-x 3 root root 4096 Aug 27 2013 /home/
ls -ld /home/Desktop/
drwxr-xr-x 7 userA userA 4096 Nov 12 12:45 /home/Desktop/
ls -ld /home/Desktop/Input/
drwxrwxr-x 47 userA userA 4096 Nov 12 10:50 /home/Desktop/Input/
ls -l /home/Desktop/Input/abc.log
-rw-rw-r-- 1 userA userA 0 Nov 12 09:56 /home/Desktop/Input/abc.log