2

Sadly I found a question very similar to mine, but with no real answer nohostavailableexception-while-bulk-loading-data-into-cassandra

I'm using Cassandra 2.0.8 installed on a RHEL 5 VM with 8 Cores and 8 GB of RAM. I am running it as a single node for now.

I am trying to initialize it by migrating data off my oracle database. So I have a program that selects from the oracle table and then inserts into cassandra (in a loop) Biggest table has 500,000 records.

During the operation my program keeps dying with read-timeout errors. I tried increasing all the time out values in cassandra.yaml but it doesn't help.

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout during read))
        at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65)
        at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256)
        at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172)
        at com.datastax.driver.core.SessionManager.execute(SessionManager.java:92)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout during read))
        at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103)
        at com.datastax.driver.core.RequestHandler$1.run(RequestHandler.java:175)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

My cassandra.yaml timeout settings are

# How long the coordinator should wait for read operations to complete read_request_timeout_in_ms: 15000
# was 5000

# How long the coordinator should wait for seq or index scans to complete range_request_timeout_in_ms: 20000
# was 10000

# How long the coordinator should wait for writes to complete write_request_timeout_in_ms: 30000
# was 20000

# How long a coordinator should continue to retry a CAS operation
# that contends with other proposals for the same row cas_contention_timeout_in_ms: 1000

# How long the coordinator should wait for truncates to complete
# (This can be much longer, because unless auto_snapshot is disabled
# we need to flush first so we can snapshot before removing the data.) truncate_request_timeout_in_ms: 300000
# was 60000

# The default timeout for other, miscellaneous operations request_timeout_in_ms: 20000
# was 10000

Anyone know how to fix this issue? or a better way to migrate data from 1 place to another (note that some tables are not that simple to migrate, I need to do some extra queries before inserting)

Community
  • 1
  • 1
george_h
  • 1,562
  • 2
  • 19
  • 37
  • What library do you use to write data to Cassandra? Do you use prepared statements? Do you use batch statements? – Alex Popescu Jun 14 '14 at 06:09
  • I use the datastax java drive. I do use prepared statements from the datastax lib. I don't think I use batch statements, I know in java.sql there is .addBatch() couldn't find such a thing for datastax driver. I did manage to import my data by exporting the table to CSV format and then going into CQL and running the COPY command. – george_h Jun 15 '14 at 09:06

0 Answers0