Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Location of Nifi Registry's provider.xml on Cloudera Manager

Location of Nifi Registry's provider.xml on Cloudera Manager

Hello everyone,

 

Does anybody know where I can configure a new flow persistence provider for Nifi Registry using Cloudera Manager? I tried the escape valve for staging/providers.xml, but I get a validation error if I enter the required value to integrate NiFi Registry with Git:

 

<flowPersistenceProvider>

<class>org.apache.nifi.registry.provider.flow.git.GitFlowPersistenceProvider</class>

<property name="Flow Storage Directory">{{nifi_registry_internal_dir}}/git/perso-recognition-nifi-flows</property>

<property name="Remote To Push">origin</property>

<property name="Remote Access User">paulvid</property>

<property name="Remote Access Password">[your_key]</property>

</flowPersistenceProvider>

 

I'm following this guide to configure Nifi Registry with Git: https://community.hortonworks.com/articles/222365/how-to-configure-git-for-nifi-registry-in-hdf-32.h... , but the xml configuration differs from Ambari to Cloudera Manager.

 

Thanks in advance.

1 REPLY 1

Re: Location of Nifi Registry's provider.xml on Cloudera Manager

I was able to make CM generate the correct providers.xml by using the properties below:

nifi_service.PNG

 

Which results on the following providers.xml:

 

 

[root@nifi1 399-nifiregistry-NIFI_REGISTRY_SERVER]# cat providers.xml

<providers>

    <flowPersistenceProvider>
    <class>org.apache.nifi.registry.provider.flow.FileSystemFlowPersistenceProvider</class>
    <property name="Flow Storage Directory">/var/lib/nifiregistry/flow_storage</property>

</flowPersistenceProvider>

    <flowPersistenceProvider>
    <class>org.apache.nifi.registry.provider.flow.git.GitFlowPersistenceProvider</class>
    <property name="Remote Access User">yyy</property>
    <property name="Flow Storage Directory">/var/lib/nifi-registry/git/nifi_registry_demo</property>
    <property name="Remote Access Password">xxx</property>
    <property name="Remote to Push">origin</property>

</flowPersistenceProvider>

 

But now I'm getting this error starting the Nifi service:

 

...

Caused by: org.apache.nifi.registry.provider.ProviderFactoryException: Unable to load the providers configuration file at: /run/cloudera-scm-agent/process/398-nifiregistry-NIFI_REGISTRY_SERVER/providers.xml
	at org.apache.nifi.registry.provider.StandardProviderFactory.initialize(StandardProviderFactory.java:112) ~[na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_192]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_192]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_192]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_192]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366) ~[na:na]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:309) ~[na:na]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[na:na]
	... 78 common frames omitted
Caused by: javax.xml.bind.UnmarshalException: null
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335) ~[na:1.8.0_192]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:563) ~[na:1.8.0_192]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:249) ~[na:1.8.0_192]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221) ~[na:1.8.0_192]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:276) ~[na:1.8.0_192]
	at org.apache.nifi.registry.provider.StandardProviderFactory.initialize(StandardProviderFactory.java:109) ~[na:na]
	... 85 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'flowPersistenceProvider'. One of '{eventHookProvider}' is expected.
...