Member since
03-02-2017
6
Posts
0
Kudos Received
0
Solutions
03-06-2017
07:40 AM
I am using embedded spark and running Spark application with that along with nifi receiver for spark. On debugging I found that objects are created but no data comes there. # Site to Site properties nifi.remote.input.host=localhost nifi.remote.input.secure=false nifi.remote.input.socket.port=10000 nifi.remote.input.http.enabled=true nifi.remote.input.http.transaction.ttl=30 sec nifi.web.http.port=8080 Below is the code : SiteToSiteClientConfig config = new SiteToSiteClient.Builder()
.url("http://localhost:8080/nifi")
.portName("SparkPort")
.buildConfig(); SparkConf sparkConf = new SparkConf()
.setMaster("local[2]")
.setAppName("SparkNifiConnectorApp"); JavaStreamingContext ssc = new JavaStreamingContext(sparkConf, Durations.seconds(1)); // Create a JavaReceiverInputDStream using a NiFi receiver so that we can pull data from
// specified Port while(true) { JavaReceiverInputDStream packetStream =
ssc.receiverStream(new NiFiReceiver(config, StorageLevel.MEMORY_ONLY())); // Map the data from NiFi to text, ignoring the attributes System.out.println("Packet Content = " + packetStream); System.out.println("Packet Count = " + packetStream.countByValue()); System.out.println("Packet Count = " + packetStream.count()); JavaDStream text = packetStream.map(new Function<NiFiDataPacket, String>() { public String call(final NiFiDataPacket dataPacket) throws Exception {
System.out.println("Packet Data : " +dataPacket.getContent()); return new String(dataPacket.getContent(), StandardCharsets.UTF_8); } }); System.out.println("Data from Nifi :" + text.toString()); text.print();
... View more
03-03-2017
07:18 AM
I checked once, the Spark program is running on same machine as Nifi. The queue before the Output Port has data whereas the Output Port doesn't have any ( Doesn't show any data for it in Data Provenance Page of Output Port). I am new to this tool. I have attached the screenshots of my flow.nifi-flow.png output-port.pngoutput-port-data-provenance.png
... View more
03-02-2017
05:17 PM
Graham Martin , Graham Martin : No errror logs, nifi.remote.input.host=localhost I am trying to pull data from Ouput Port through Spark program ( that pulls from Output Port in nifi work flow) Success of GetFile is connected to Output Port. Data Provenance for Output Port doesn't show any records for flow files. Although GetFile and connecting queue have flowfile records in Data Provernance. Spark code : SiteToSiteClientConfig config = new SiteToSiteClient.Builder()
.url("http://localhost:8080/nifi")
.portName("SparkPort")
.buildConfig();
SparkConf sparkConf = new SparkConf()
.setMaster("local[2]")
.setAppName("SparkNifiConnectorApp");
nifi.web.http.port=8080
... View more
03-02-2017
01:23 PM
@nmaillard : Please assist. I have followed steps given in site https://blogs.apache.org/nifi/entry/stream_processing_nifi_and_spark
... View more
03-02-2017
01:18 PM
I am using Spark receiver for Nifi.. its not working.. # Site to Site properties
nifi.remote.input.host=localhost
nifi.remote.input.secure=false
nifi.remote.input.socket.port=10000
nifi.remote.input.http.enabled=true
nifi.remote.input.http.transaction.ttl=30 sec
... View more
03-02-2017
01:05 PM
I am trying to pull data from Nifi using site to site mechanism The Nifi flow has following processors :- GetFile Processor, Output Port and connection from GetFile to Output port. On starting them all ... files are getting in queue but not reaching Output Port as i can't see them in Data Provenance of Output Port... I am trying to pull data from Nifi through Spark. # Site to Site properties nifi.remote.input.host=localhost nifi.remote.input.secure=false nifi.remote.input.socket.port=10000 nifi.remote.input.http.enabled=true nifi.remote.input.http.transaction.ttl=30 sec nifi.web.http.port=8080 The port name in Nifi and Spark config is also same. I am also using Nifi receiver for Spark Please assist
... View more
Labels:
- Labels:
-
Apache NiFi