无法运行Logstash配置文件(权限被拒绝) [英] Unable to run logstash config file (permission denied)

查看:1992
本文介绍了无法运行Logstash配置文件(权限被拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的配置文件存储在

/etc/logstash/ 

我运行了命令

$ /etc/logstash -f /etc/logstash/logstash.conf

以root用户身份.

但是,他们告诉我,当我尝试这样做时,权限被拒绝.有什么办法解决这个问题?

However, they told me that permission denied when I tried to do that. Is there any way to solve this?

推荐答案

如上所述,您需要运行/opt/logstash/bin/logstash -f /etc/logstash/logstash.conf而不是/etc/logstash -f /etc/logstash/logstash.conf.

As said, you need to run /opt/logstash/bin/logstash -f /etc/logstash/logstash.conf instead of /etc/logstash -f /etc/logstash/logstash.conf.

这是由Linux系统的默认目录结构引起的,logstash用于将其放入文件. Wikipedia :文件系统层次结构标准

This is caused by the default directory structure of your Linux system which logstash uses to put its files in. Wikipedia: Filesystem Hierarchy Standard

/opt 代表optional,并包含不属于默认linux发行版的第三方软件包.因此,logstash将其二进制文件和一些依赖项放在那里(例如jRuby的东西).在这里,您可以找到logstash程序/opt/logstash/bin/logstash或插件管理器/opt/logstash/bin/plugin.

/opt stands for optional and contains third party packages which are not part of the default linux distribution. Therefore logstash puts its binaries and some dependencies there (e.g. jRuby stuff). Here you can find the logstash program /opt/logstash/bin/logstash or the plugin manager /opt/logstash/bin/plugin.

/etc 表示et cetera,通常用于配置文件(例如logstash使用它).

/etc means et cetera and is often used for configuration files (like logstash uses it).

logstash也使用其他系统文件夹.例如/var/log/logstash,您可以在其中找到logstash自己的日志.因此,当您运行logstash安装(在Ubuntu中可能使用apt-getdpkg)时,它将所有需要的文件放入与您的操作系统的目录结构相对应的文件夹中.

There are also other system folders which are used by logstash. For example /var/log/logstash where you can find logstash's own logs. So, when you run the logstash installation (in Ubuntu perhaps with apt-get or dpkg) it puts all the needed files in folders corresponding to the directory structure of your OS.

如您所见,您不能运行/etc/logstash -f /etc/logstash/logstash.conf,因为/etc/logstash不是可执行文件,而是目录.

As you see, you cannot run /etc/logstash -f /etc/logstash/logstash.conf because /etc/logstash is not an executable but a directory.

但是,如果您在命令提示符下运行logstash,则还可以为配置文件指定其他路径(例如/opt/logstash/bin/logstash -f /home/user/logstash.conf).如果将其作为服务运行,则无法提供配置文件的路径.然后,logstash的默认行为是在/etc/logstash/

However, if you run logstash in a command prompt you may also specify other paths for your config file (e.g. /opt/logstash/bin/logstash -f /home/user/logstash.conf). If you run it as a service you cannot provide a path to your config file. Then the default behaviour of logstash is to look for config files in /etc/logstash/

这篇关于无法运行Logstash配置文件(权限被拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆