run.as 选项除了 Nifi 用户之外不起作用 [英] run.as option does not work other than Nifi user
问题描述
我想使用 ec2-user 而不是默认的 nifi 用户运行我的 NiFi 应用程序.我在 bootstrap.conf 中更改了 run.as=ec2-user 但它没有用.它不允许我启动 Nifi 应用程序在启动 nifi 服务时出现以下错误.
I want to run my NiFi application using ec2-user rather than default nifi user. I changed run.as=ec2-user in bootstrap.conf but it did not worked .It is not allowing me to start Nifi application getting following error while staring nifi service.
./nifi.sh start
nifi.sh: JAVA_HOME not set; results may vary
Java home:
NiFi home: /opt/nifi/current
Bootstrap Config File: /opt/nifi/current/conf/bootstrap.conf
User Runnug Nifi Application : sudo -u ec2-user
Error: Could not find or load main class org.apache.nifi.bootstrap.RunNiFi
有任何指向这个问题的指针吗?
Any pointer to this issue?
推荐答案
这很可能是文件权限问题,使用 nifi.sh install
安装服务不包括在内.所需权限的摘要包括:
This is most likely a file permission problem, which is not covered by installing the service with nifi.sh install
. A summary of the required permissions includes:
- 对 NIFI_HOME 目录中整个发行版的读取权限
- 对 NIFI_HOME 目录本身的写访问权限 - NiFi 将在运行时创建许多目录和文件,包括日志、工作、状态和各种存储库.
- 对
bin
目录的写访问 - 对
conf
目录的写访问 - 对
lib
目录和lib
目录中的所有文件的写访问权限
- Read access to the entire distribution in the NIFI_HOME directory
- Write access to the NIFI_HOME directory itself - NiFi will create a number of directories and files at runtime including logs, work, state, and various repositories.
- Write access to the
bin
directory - Write access to the
conf
directory - Write access to the
lib
directory, and to all of the files in thelib
directory
当然可以通过手动创建工作目录来缩小权限,并通过调整 NiFi 的设置来重新排列目录布局.但是上面的权限应该会让你开始.
It is certainly possible to narrow the permissions by creating the working directories manually, and by adjusting NiFi's settings to rearrange the directory layout. But the permissions above should get you started.
这篇关于run.as 选项除了 Nifi 用户之外不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!