【问题标题】:Apache NiFi TLS failed to startApache NiFi TLS 无法启动
【发布时间】:2020-06-25 11:37:17
【问题描述】:

我已尝试安装 NiFi 工具包以启用 TLS。我按照here 给出的说明进行操作。

我按照步骤操作,使用localhost 和主机作为sachith,但是当我尝试再次启动 NiFi 时,出现以下错误。

引导配置文件:/home/sachith/nifi-1.9.2/conf/bootstrap.conf 16:59:23,949 |-ch.qos.logback.classic.LoggerContext [默认] 中的信息- 找不到资源 [logback-test.xml] 16:59:23,950 |-INFO in ch.qos.logback.classic.LoggerContext [默认] - 找不到 资源 [logback.groovy] 16:59:23,950 |-INFO in ch.qos.logback.classic.LoggerContext[default] - 找到资源 [logback.xml] 在 [文件:/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/conf/logback.xml] 16:59:24,032 |-信息在 ch.qos.logback.classic.joran.action.ConfigurationAction - 调试 属性未设置 16:59:24,046 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - 将扫描 对于变化 [文件:/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/conf/logback.xml] 16:59:24,046 |-信息在 ch.qos.logback.classic.joran.action.ConfigurationAction - 设置 ReconfigureOnChangeTask 扫描周期为 30 秒 16:59:24,049 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - 添加 LoggerContextListener 类型 [ch.qos.logback.classic.jul.LevelChangePropagator] 到对象堆栈 16:59:24,062 |-信息在 ch.qos.logback.classic.jul.LevelChangePropagator@48140564 - 将 Logger[ROOT] 上的 DEBUG 级别传播到 JUL 框架上 16:59:24,062 |-信息在 ch.qos.logback.classic.joran.action.LoggerContextListenerAction - 启动 LoggerContextListener 16:59:24,062 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - 即将实例化 [ch.qos.logback.core.rolling.RollingFileAppender] 类型的附加程序 16:59:24,067 |-ch.qos.logback.core.joran.action.AppenderAction 中的信息

  • 将附加程序命名为 [APP_FILE] 16:59:24,084 |-c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@93122545 中的信息 - 存档 每个文件将限制为 [100 MB]。 16:59:24,127 |-信息在 c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@93122545 - 否 压缩将使用 16:59:24,128 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@93122545 - 将使用 模式 /home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/logs/nifi-app_%d{yyyy-MM-dd_HH}.%i.log 对于活动文件 16:59:24,131 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7c30a502 - 日期 模式是来自文件名模式的“yyyy-MM-dd_HH” '/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/logs/nifi-app_%d{yyyy-MM-dd_HH}.%i.log'。

nifi-app.log

2020-06-26 09:27:50,296 INFO [main] org.eclipse.jetty.server.Server Started @186210ms
2020-06-26 09:27:50,297 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtAuthenticationProvider' defined in class path resource [nifi-web-security-context.xml]: Cannot resolve reference to bean 'authorizer' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizer': FactoryBean threw exception on object creation; nested exception is org.apache.nifi.authorization.exception.AuthorizerCreationException: Unable to locate configured Access Policy Provider: file-access-policy-provider
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:666)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1269)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

编辑:在安迪最初的回答之后。

我的authorizers.xml

<accessPolicyProvider>
      <identifier>file-access-policy-provider</identifier>
        <class>org.apache.nifi.authorization.FileAccessPolicyProvider</class>
        <property name="User Group Provider">file-user-group-provider</property>
        <property name="Authorizations File">./conf/authorizations.xml</property>
        <property name="Initial Admin Identity">CN=sachith, OU=NiFi</property>
        <property name="Legacy Authorized Users File"></property>
        <property name="Node Identity 1"></property>
    <property name="Node Group"></property> 
</accessPolicyProvider>
 <userGroupProvider>
        <identifier>file-user-group-provider</identifier>
        <class>org.apache.nifi.authorization.FileUserGroupProvider</class>
        <property name="Users File">./conf/users.xml</property>
        <property name="Legacy Authorized Users File"></property>
        <property name="Initial User Identity 1">CN=sachith, OU=NiFi</property>
</userGroupProvider>

【问题讨论】:

  • 这里没有显示错误,请从 nifi-app.log 中查找错误

标签: ssl apache-nifi


【解决方案1】:

您还没有提供完整的日志输出,所以这里可能还有其他问题,但看起来问题是nested exception is org.apache.nifi.authorization.exception.AuthorizerCreationException: Unable to locate configured Access Policy Provider: file-access-policy-provider。您是否提供了定义FileAccessPolicyProviderauthorizers.xml 文件?

具体查看您链接到的演练指南的第 7 步。

【讨论】:

    猜你喜欢
    • 2019-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-23
    • 2021-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多