Support Questions

Find answers, ask questions, and share your expertise

MiNiFi not connecting to Nifi

avatar
Expert Contributor

Hi, im trying to set up a connection between MiNiFi running on a Pi to a NiFi server. But there doesnt seem to be a connection. The yaml file on MiNiFi is;

Flow Controller:
  name: listen-MiNiFi
  comment: ''
Core Properties:
  flow controller graceful shutdown period: 10 sec
  flow service write delay interval: 500 ms
  administrative yield duration: 30 sec
  bored yield duration: 10 millis
  max concurrent threads: 1
FlowFile Repository:
  partitions: 256
  checkpoint interval: 2 mins
  always sync: false
  Swap:
    threshold: 20000
    in period: 5 sec
    in threads: 1
    out period: 5 sec
    out threads: 4
Content Repository:
  content claim max appendable size: 10 MB
  content claim max flow files: 100
  always sync: false
Provenance Repository:
  provenance rollover time: 1 min
Component Status Repository:
  buffer size: 1440
  snapshot frequency: 1 min
Security Properties:
  keystore: ''
  keystore type: ''
  keystore password: ''
  key password: ''
  truststore: ''
  truststore type: ''
  truststore password: ''
  ssl protocol: ''
  Sensitive Props:
    key:
    algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
    provider: BC
Processors:
- name: GetFile
  class: org.apache.nifi.processors.standard.GetFile
  max concurrent tasks: 1
  scheduling strategy: TIMER_DRIVEN
  scheduling period: 0 sec
  penalization period: 30 sec
  yield period: 1 sec
  run duration nanos: 0
  auto-terminated relationships list: []
  Properties:
    Batch Size: '10'
    File Filter: '[^\.].*'
    Ignore Hidden Files: 'true'
    Input Directory: /home/test
    Keep Source File: 'false'
    Maximum File Age:
    Maximum File Size:
    Minimum File Age: 0 sec
    Minimum File Size: 0 B
    Path Filter:
    Polling Interval: 0 sec
    Recurse Subdirectories: 'true'
Connections:
- name: GetFile/success/ab7ff1f6-0158-1000-0000-000011753a27
  source name: GetFile
  source relationship name: success
  destination name: ab7ff1f6-0158-1000-0000-000011753a27
  max work queue size: 10000
  max work queue data size: 1 GB
  flowfile expiration: 0 sec
  queue prioritizer class: ''
Remote Processing Groups:
- name: http://master.hadoop.com:9090/nifi
  url: http://master.hadoop.com:9090/nifi
  comment: ''
  timeout: 30 sec
  yield period: 10 sec
  Input Ports:
  - id: ab7ff1f6-0158-1000-0000-000011753a27
    name: list-for-MiNiFi
    comment: ''
    max concurrent tasks: 1
    use compression: false
  - id: aaffbdc5-0158-1000-0000-00006f35ed0c
    name: listen-for-MiniFi
    comment: ''
    max concurrent tasks: 1
    use compression: false
Am i missing something?  have set the nifi remote input socket port to 10000
  
1 ACCEPTED SOLUTION

avatar
Expert Contributor

i started again and created another template using a generateflowfile and a remote processor group and still the same. below is a copy of the new yml file on MiNiFi

Flow Controller:
  name: flowfile
  comment: ''
Core Properties:
  flow controller graceful shutdown period: 10 sec
  flow service write delay interval: 500 ms
  administrative yield duration: 30 sec
  bored yield duration: 10 millis
  max concurrent threads: 1
FlowFile Repository:
  partitions: 256
  checkpoint interval: 2 mins
  always sync: false
  Swap:
    threshold: 20000
    in period: 5 sec
    in threads: 1
    out period: 5 sec
    out threads: 4
Content Repository:
  content claim max appendable size: 10 MB
  content claim max flow files: 100
  always sync: false
Provenance Repository:
  provenance rollover time: 1 min
Component Status Repository:
  buffer size: 1440
  snapshot frequency: 1 min
Security Properties:
  keystore: ''
  keystore type: ''
  keystore password: ''
  key password: ''
  truststore: ''
  truststore type: ''
  truststore password: ''
  ssl protocol: ''
  Sensitive Props:
    key:
    algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
    provider: BC
Processors:
- name: GenerateFlowFile
  class: org.apache.nifi.processors.standard.GenerateFlowFile
  max concurrent tasks: 1
  scheduling strategy: TIMER_DRIVEN
  scheduling period: 0 sec
  penalization period: 30 sec
  yield period: 1 sec
  run duration nanos: 0
  auto-terminated relationships list: []
  Properties:
    Batch Size: '1'
    Data Format: Binary
    File Size: 100 MB
    Unique FlowFiles: 'false'
Connections:
- name: GenerateFlowFile/success/da4b4c07-0158-1000-0000-00004ed4df3c
  source name: GenerateFlowFile
  source relationship name: success
  destination name: da4b4c07-0158-1000-0000-00004ed4df3c
  max work queue size: 10000
  max work queue data size: 1 GB
  flowfile expiration: 0 sec
  queue prioritizer class: ''
Remote Processing Groups:
- name: http://192.168.1.99:9090/nifi
  url: http://192.168.1.99:9090/nifi
  comment: ''
  timeout: 30 sec
  yield period: 10 sec
  Input Ports:
  - id: da4b4c07-0158-1000-0000-00004ed4df3c
    name: minifi
    comment: ''
    max concurrent tasks: 1
    use compression: false


Here are the last few lines from the log file after i run bin/minifi.sh start

 0 Swap Files in 39 milliseconds (Stop-the-world time = 7 milliseconds, Clear Edit Logs time = 9 millis), max Transaction ID -1
2016-12-07 18:13:54,677 INFO [pool-72-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2016-12-07 18:13:54,971 INFO [pool-72-thread-1] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@11d0bbc checkpointed with 0 Records and 0 Swap Files in 293 milliseconds (Stop-the-world time = 108 milliseconds, Clear Edit Logs time = 72 millis), max Transaction ID -1
2016-12-07 18:13:54,972 INFO [pool-72-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 294 milliseconds
2016-12-07 18:15:25,997 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@1ec2968 checkpointed with 0 Records and 0 Swap Files in 39 milliseconds (Stop-the-world time = 7 milliseconds, Clear Edit Logs time = 9 millis), max Transaction ID -1
2016-12-07 18:15:54,973 INFO [pool-72-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2016-12-07 18:15:55,326 INFO [pool-72-thread-1] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@11d0bbc checkpointed with 0 Records and 0 Swap Files in 352 milliseconds (Stop-the-world time = 167 milliseconds, Clear Edit Logs time = 73 millis), max Transaction ID -1
2016-12-07 18:15:55,327 INFO [pool-72-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 353 milliseconds


View solution in original post

16 REPLIES 16

avatar
Master Guru

Make sure you have permissions and you can run that file independently.

Make sure you are running that flow converted to config.yml on the RPI.

I like to wrap my Python in a shell script like

python3 /home/pi/WeatherStation.py

make sure MInIFi user has permissions.

avatar

@Timothy Spann

How to check permissions and verify whether flow is running on Rpi?

I am seeing this kind of logs in minifi-app.log:-

"2018-03-09 13:00:01,454 WARN [NiFi Site-to-Site Connection Pool Maintenance] o.apache.nifi.remote.client.PeerSelector Could not communicate with 192.168.2.3:9999 to determine which nodes exist in the remote NiFi cluster, due to java.net.ConnectException: Connection refused 2018-03-09 13:00:01,475 WARN [NiFi Site-to-Site Connection Pool Maintenance] o.apache.nifi.remote.client.PeerSelector org.apache.nifi.remote.client.PeerSelector@cf5b60 Unable to refresh Remote Group's peers due to Unable to communicate with remote NiFi cluster in order to determine which nodes exist in the remote cluster 2018-03-09 13:00:01,742 INFO [Remote Process Group 96072a53-f650-44b7-9987-2a99e1c4f3c2: http://192.168.2.3:8090/nifi Thread-1] org.apache.http.impl.execchain.RetryExec I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://192.168.2.3:8090: The target server failed to respond 2018-03-09 13:00:01,744 INFO [Remote Process Group 96072a53-f650-44b7-9987-2a99e1c4f3c2: http://192.168.2.3:8090/nifi Thread-1] org.apache.http.impl.execchain.RetryExec Retrying request to {}->http://192.168.2.3:8090 2018-03-09 13:00:01,747 INFO [Timer-Driven Process Thread-2] org.apache.http.impl.execchain.RetryExec I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://192.168.2.3:8090: The target server failed to respond 2018-03-09 13:00:01,747 INFO [Timer-Driven Process Thread-2] org.apache.http.impl.execchain.RetryExec Retrying request to {}->http://192.168.2.3:8090"

avatar
Master Guru

There you go, MiniFi is not able to connect to NiFi .

ConnectException: Connection refuse

is this the correct server 192.168.2.3

is that the correct IP and port?

do you have NiFi setup to receive remote?

what is the url you access NiFi with?

https://community.hortonworks.com/articles/88473/site-to-site-communication-between-secured-https-a....

With NiFi 1.5 you can only have one domain or IP to point to.

Make sure you follow the setup directions here:

https://nifi.apache.org/minifi/getting-started.html

Configuring NiFi to Receive Data

First, check that $NIFI_HOME/conf/nifi.properties has a Site to Site input socket port specified:

# Site to Site properties
nifi.remote.input.host=
nifi.remote.input.secure=false
nifi.remote.input.socket.port=1026
nifi.remote.input.http.enabled=true
nifi.remote.input.http.transaction.ttl=30 sec

Restart NiFi so changes take effect.

https://community.hortonworks.com/articles/56341/getting-started-with-minifi.html

avatar

Even with the correcr server i.e. 10.0.75.1, I am getting the same error. What's the problem?

avatar

I am not able to ping from Raspberry Pi to Hortanworks Server from laptop but vice-versa is possible.

avatar
Master Guru

if you can't ping, then networking is setup wrong on RPI. Home networking often has issues and blocks to stop this. You must make sure you have open ports and no firewalls blocking. Also make sure you really know the correct IP for your laptop/server. Then edit the /etc/hosts on the RPI put in that ip next to a name for it. Make sure NiFi is ready to accept remotes. then reboot. try ping again.

avatar

Which ports should be open ? And how to make sure NiFi is ready to accept remotes?