Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to load data from cassandra into NIFI

avatar

Hello,

I want to use the querycassandra processor, but i'm facing some troubles. I'm trying to do some very basic actions which is selecting all rows from a table and then send them to another ExcecuteStream processor(java program).

Here is the table :

15604-selectfrom.png

Here is the processor configuration. I've also added the port 9042 to the HDP sandbox both from the port forwarding table and the start_sandbox script:

15603-dockerps.png

username/password: cassandra

15582-nifi-cassandra2.png

a global schema showing the error:

all host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException:[/127.0.0.1] Cannot connect)

15584-nifi-cass.png


nifi-cassandra.png
6 REPLIES 6

avatar
Super Guru

@amine adi

So Cassandra is running on same node as Nifi? Is that right?

avatar

Cassandra is running on my linux host, and nifi is installed as a service in my HDP sandbox.

avatar
Super Guru
@amine adi

For nifi "127.0.0.1" is its own host. Not your linux host. How do you connect to linux host from your sandbox? For example if you want to scp a file from your sandbox to your linux host, what ip address/host name wil you use? Use that instead of 127.0.0.1 from Nifi to connect to Cassandra.

avatar

here are my interface configuration both from my linux host, and my hortonworks sandbox where nifi belongs:

15605-linux-host.png

15606-sandbox-ifconfig.png

Thanks again !

avatar
Guru

@amine adi

I'm guessing that the ports are closed. If you are using the HDP Sandbox, the Sandbox is now Dockerized within the VM. You may want to add the Cassandra ports that you are using do both the VirtualBox Port Forwarding Section, and, you'll also have to edit some of the Docker scripts. Fortunately, there is a very good step by step tutorial here: https://community.hortonworks.com/articles/65914/how-to-add-ports-to-the-hdp-25-virtualbox-sandbox.h...

As always, if you find this post useful, don't forget to "accept" the answer.

avatar

Thanks @Sonu Sahi for your reply, but i've already done this and the error persist 😕