Fail to connect to single node local cluster with java driver 2.1.0/2.0.5

閲覧: 3,785 回
最初の未読メッセージにスキップ

Joel Costigliola

未読、
2014/09/02 21:09:532014/09/02
To: java-dri...@lists.datastax.com
Hi,

Following the getting started steps, I'm trying to setup a single node cassandra cluster on my local machine and connect to it with the java driver.

I'm using the following code inspired by http://www.datastax.com/documentation/developer/java-driver/2.0/java-driver/quick_start/qsSimpleClientCreate_t.html.

public static void main(String[] args) {
   
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
   
Metadata metadata = cluster.getMetadata();
   
System.out.printf("Connected to cluster: %s\n", metadata.getClusterName());
    cluster
.close();
}

server version : 2.0.10
java driver version : 2.1.0 (also tried with 2.0.5)

Error is:

Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Connection has been closed))
    at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:195)
    at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
    at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1143)
    at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:313)

Comments :
  • I'm able to connect to cassandra using cqlsh.
  • As I'm using the latest stable version of Cassandra and the java driver, I'm expecting them to be compatible.
  • port 9042 is open, running telnet 127.0.0.1 9042 gives :
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
server config modifications :

data_file_directories:
    - /home/joelco/orion/scratch/cassandra/data

commitlog_directory: /home/joelco/orion/scratch/cassandra/commitlog


server config NOT modified elements:

start_native_transport: true
native_transport_port: 9042

Server logs :

~/orion/scratch/cassandra/apache-cassandra-2.0.10 ∙  INFO 12:52:16,753 Logging initialized
 INFO 12:52:16,774 Loading settings from file:/home/joelco/orion/scratch/cassandra/apache-cassandra-2.0.10/conf/cassandra.yaml
 INFO 12:52:16,977 Data files directories: [/home/joelco/orion/scratch/cassandra/data]
 INFO 12:52:16,977 Commit log directory: /home/joelco/orion/scratch/cassandra/commitlog
 INFO 12:52:16,977 DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
 INFO 12:52:16,977 disk_failure_policy is stop
 INFO 12:52:16,977 commit_failure_policy is stop
 INFO 12:52:16,980 Global memtable threshold is enabled at 979MB
 INFO 12:52:17,046 Not using multi-threaded compaction
 INFO 12:52:17,163 Loading settings from file:/home/joelco/orion/scratch/cassandra/apache-cassandra-2.0.10/conf/cassandra.yaml
 INFO 12:52:17,173 Loading settings from file:/home/joelco/orion/scratch/cassandra/apache-cassandra-2.0.10/conf/cassandra.yaml
 INFO 12:52:17,182 JVM vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.7.0_60
 INFO 12:52:17,182 Heap size: 4107272192/4108320768
 INFO 12:52:17,182 Code Cache Non-heap memory: init = 2555904(2496K) used = 662848(647K) committed = 2555904(2496K) max = 50331648(49152K)
 INFO 12:52:17,183 Par Eden Space Heap memory: init = 671088640(655360K) used = 120797352(117966K) committed = 671088640(655360K) max = 671088640(655360K)
 INFO 12:52:17,183 Par Survivor Space Heap memory: init = 83886080(81920K) used = 0(0K) committed = 83886080(81920K) max = 83886080(81920K)
 INFO 12:52:17,184 CMS Old Gen Heap memory: init = 3352297472(3273728K) used = 0(0K) committed = 3352297472(3273728K) max = 3353346048(3274752K)
 INFO 12:52:17,184 CMS Perm Gen Non-heap memory: init = 21757952(21248K) used = 14308736(13973K) committed = 21757952(21248K) max = 85983232(83968K)
 INFO 12:52:17,184 Classpath: bin/../conf:bin/../build/classes/main:bin/../build/classes/thrift:bin/../lib/antlr-3.2.jar:bin/../lib/apache-cassandra-2.0.10.jar:bin/../lib/apache-cassandra-clientutil-2.0.10.jar:bin/../lib/apache-cassandra-thrift-2.0.10.jar:bin/../lib/commons-cli-1.1.jar:bin/../lib/commons-codec-1.2.jar:bin/../lib/commons-lang3-3.1.jar:bin/../lib/compress-lzf-0.8.4.jar:bin/../lib/concurrentlinkedhashmap-lru-1.3.jar:bin/../lib/disruptor-3.0.1.jar:bin/../lib/guava-15.0.jar:bin/../lib/high-scale-lib-1.1.2.jar:bin/../lib/jackson-core-asl-1.9.2.jar:bin/../lib/jackson-mapper-asl-1.9.2.jar:bin/../lib/jamm-0.2.5.jar:bin/../lib/jbcrypt-0.3m.jar:bin/../lib/jline-1.0.jar:bin/../lib/json-simple-1.1.jar:bin/../lib/libthrift-0.9.1.jar:bin/../lib/log4j-1.2.16.jar:bin/../lib/lz4-1.2.0.jar:bin/../lib/metrics-core-2.2.0.jar:bin/../lib/netty-3.6.6.Final.jar:bin/../lib/reporter-config-2.1.0.jar:bin/../lib/servlet-api-2.5-20081211.jar:bin/../lib/slf4j-api-1.7.2.jar:bin/../lib/slf4j-log4j12-1.7.2.jar:bin/../lib/snakeyaml-1.11.jar:bin/../lib/snappy-java-1.0.5.jar:bin/../lib/snaptree-0.1.jar:bin/../lib/super-csv-2.1.0.jar:bin/../lib/thrift-server-internal-only-0.3.3.jar:bin/../lib/jamm-0.2.5.jar
 INFO 12:52:17,185 JNA not found. Native methods will be disabled.
 INFO 12:52:17,195 Initializing key cache with capacity of 100 MBs.
 INFO 12:52:17,200 Scheduling key cache save to each 14400 seconds (going to save all keys).
 INFO 12:52:17,200 Initializing row cache with capacity of 0 MBs
 INFO 12:52:17,204 Scheduling row cache save to each 0 seconds (going to save all keys).
 INFO 12:52:17,279 Initializing system.schema_triggers
 INFO 12:52:17,297 Initializing system.compaction_history
 INFO 12:52:17,305 Opening /home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-1 (237 bytes)
 INFO 12:52:17,305 Opening /home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-3 (238 bytes)
 INFO 12:52:17,305 Opening /home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-2 (340 bytes)
 INFO 12:52:17,324 Initializing system.batchlog
 INFO 12:52:17,327 Initializing system.sstable_activity
 INFO 12:52:17,329 Initializing system.peer_events
 INFO 12:52:17,332 Initializing system.compactions_in_progress
 INFO 12:52:17,334 Initializing system.hints
 INFO 12:52:17,337 Initializing system.schema_keyspaces
 INFO 12:52:17,338 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-jb-5 (257 bytes)
 INFO 12:52:17,342 Initializing system.range_xfers
 INFO 12:52:17,345 Initializing system.schema_columnfamilies
 INFO 12:52:17,347 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-2 (5942 bytes)
 INFO 12:52:17,348 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-1 (5943 bytes)
 INFO 12:52:17,348 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-3 (5935 bytes)
 INFO 12:52:17,352 Initializing system.NodeIdInfo
 INFO 12:52:17,355 Initializing system.paxos
 INFO 12:52:17,362 Initializing system.schema_columns
 INFO 12:52:17,363 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-3 (10259 bytes)
 INFO 12:52:17,363 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-2 (10272 bytes)
 INFO 12:52:17,363 Opening /home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-1 (10258 bytes)
 INFO 12:52:17,365 reading saved cache /var/lib/cassandra/saved_caches/system-schema_columns-KeyCache-b.db
 INFO 12:52:17,373 Initializing system.IndexInfo
 INFO 12:52:17,377 Initializing system.peers
 INFO 12:52:17,378 Opening /home/joelco/orion/scratch/cassandra/data/system/peers/system-peers-jb-3 (30 bytes)
 INFO 12:52:17,379 Opening /home/joelco/orion/scratch/cassandra/data/system/peers/system-peers-jb-2 (30 bytes)
 INFO 12:52:17,382 Initializing system.local
 INFO 12:52:17,383 Opening /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-21 (5705 bytes)
 INFO 12:52:17,383 Opening /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-22 (5280 bytes)
 INFO 12:52:17,385 reading saved cache /var/lib/cassandra/saved_caches/system-local-KeyCache-b.db
 INFO 12:52:17,756 Enqueuing flush of Memtable-local@802356594(114/1140 serialized/live bytes, 3 ops)
 INFO 12:52:17,757 Writing Memtable-local@802356594(114/1140 serialized/live bytes, 3 ops)
 INFO 12:52:17,793 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-23-Data.db (139 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:17,804 Initializing system_traces.sessions
 INFO 12:52:17,807 Initializing system_traces.events
 INFO 12:52:17,807 completed pre-loading (8 keys) key cache.
 INFO 12:52:17,812 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677555.log, /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677556.log, /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677557.log, /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677558.log, /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677559.log
 INFO 12:52:17,822 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677555.log (CL version 3, messaging version 7)
 INFO 12:52:17,888 Finished reading /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677555.log
 INFO 12:52:17,888 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677556.log (CL version 3, messaging version 7)
 INFO 12:52:17,889 Finished reading /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677556.log
 INFO 12:52:17,889 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677557.log (CL version 3, messaging version 7)
 INFO 12:52:17,889 Finished reading /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677557.log
 INFO 12:52:17,889 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677558.log (CL version 3, messaging version 7)
 INFO 12:52:17,889 Finished reading /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677558.log
 INFO 12:52:17,889 Replaying /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677559.log (CL version 3, messaging version 7)
 INFO 12:52:17,890 Finished reading /home/joelco/orion/scratch/cassandra/commitlog/CommitLog-3-1409704677559.log
 INFO 12:52:17,921 Enqueuing flush of Memtable-peers@198999606(0/0 serialized/live bytes, 1 ops)
 INFO 12:52:17,922 Writing Memtable-peers@198999606(0/0 serialized/live bytes, 1 ops)
 INFO 12:52:17,922 Enqueuing flush of Memtable-schema_keyspaces@954339663(113/1130 serialized/live bytes, 4 ops)
 INFO 12:52:17,922 Enqueuing flush of Memtable-compaction_history@31356598(562/5620 serialized/live bytes, 19 ops)
 INFO 12:52:17,922 Enqueuing flush of Memtable-schema_columns@876849071(51845/302155 serialized/live bytes, 1639 ops)
 INFO 12:52:17,923 Enqueuing flush of Memtable-schema_columnfamilies@1169550583(29482/189858 serialized/live bytes, 885 ops)
 INFO 12:52:17,951 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/peers/system-peers-jb-4-Data.db (30 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:17,951 Writing Memtable-schema_keyspaces@954339663(113/1130 serialized/live bytes, 4 ops)
 INFO 12:52:17,972 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-jb-6-Data.db (135 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:17,972 Writing Memtable-compaction_history@31356598(562/5620 serialized/live bytes, 19 ops)
 INFO 12:52:17,984 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-4-Data.db (353 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:17,985 Writing Memtable-schema_columns@876849071(51845/302155 serialized/live bytes, 1639 ops)
 INFO 12:52:18,010 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-4-Data.db (10275 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:18,010 Writing Memtable-schema_columnfamilies@1169550583(29482/189858 serialized/live bytes, 885 ops)
 INFO 12:52:18,025 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-4-Data.db (5937 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=271)
 INFO 12:52:18,026 Log replay complete, 45 replayed mutations
 INFO 12:52:18,031 Compacting [SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-1-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-2-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-3-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-4-Data.db')]
 INFO 12:52:18,031 Compacting [SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-3-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-1-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-2-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-4-Data.db')]
 INFO 12:52:18,031 Compacting [SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-4-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-3-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-1-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-2-Data.db')]
 INFO 12:52:18,105 Compacted 4 sstables to [/home/joelco/orion/scratch/cassandra/data/system/compaction_history/system-compaction_history-jb-5,].  1,168 bytes to 666 (~57% of original) in 72ms = 0.008821MB/s.  6 total partitions merged to 6.  Partition merge counts were {1:6, }
 INFO 12:52:18,118 Compacted 4 sstables to [/home/joelco/orion/scratch/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-5,].  23,757 bytes to 5,937 (~24% of original) in 82ms = 0.069048MB/s.  8 total partitions merged to 2.  Partition merge counts were {4:2, }
 INFO 12:52:18,125 Compacted 4 sstables to [/home/joelco/orion/scratch/cassandra/data/system/schema_columns/system-schema_columns-jb-5,].  41,064 bytes to 10,369 (~25% of original) in 91ms = 0.108666MB/s.  8 total partitions merged to 2.  Partition merge counts were {4:2, }
 INFO 12:52:18,220 Cassandra version: 2.0.10
 INFO 12:52:18,220 Thrift API version: 19.39.0
 INFO 12:52:18,222 CQL supported versions: 2.0.0,3.1.7 (default: 3.1.7)
 INFO 12:52:18,228 Loading persisted ring state
 INFO 12:52:18,237 Starting up server gossip
 INFO 12:52:18,241 Enqueuing flush of Memtable-local@506163064(287/2870 serialized/live bytes, 10 ops)
 INFO 12:52:18,241 Writing Memtable-local@506163064(287/2870 serialized/live bytes, 10 ops)
 INFO 12:52:18,251 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-24-Data.db (264 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=176950)
 INFO 12:52:18,252 Loading settings from file:/home/joelco/orion/scratch/cassandra/apache-cassandra-2.0.10/conf/cassandra.yaml
 INFO 12:52:18,252 Compacting [SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-23-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-21-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-24-Data.db'), SSTableReader(path='/home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-22-Data.db')]
 INFO 12:52:18,273 Compacted 4 sstables to [/home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-25,].  11,388 bytes to 5,703 (~50% of original) in 19ms = 0.286253MB/s.  4 total partitions merged to 1.  Partition merge counts were {4:1, }
 INFO 12:52:18,285 Starting Messaging Service on port 7000
 INFO 12:52:18,295 Loading settings from file:/home/joelco/orion/scratch/cassandra/apache-cassandra-2.0.10/conf/cassandra.yaml
 INFO 12:52:18,312 Using saved tokens [-1037738392884764226, -114114770726125430, -1175292930472760704, -1184685874629573288, -1532872502682624872, -1586050471616667441, -1666066385624833206, -1703231885114282462, -1706181100899711056, -1750296870350924997, -2031584901363337802, -2211174505343213626, -2280073546334040634, -2296910473614507986, -2319177978591955268, -2394042510113334342, -2495124680402809558, -2720195819219530409, -2815234791908244122, -2818059974878549954, -285015940718210058, -2883350373510173262, -2896016049320828037, -2955394069849693990, -3012211570365706950, -3024810560250452265, -3031642182568533464, -3042058966665563989, -3076745936893827912, -3114729648610720159, -3266970920981440576, -3288048416204801077, -3322225401595337074, -3594320368499500784, -3627706732913422884, -3664141515911229569, -3873488169044007274, -3936256537973502426, -3941080624913539968, -3943468416173552951, -4015712331508697761, -4032648882745432812, -41320559869240939, -4154847811762224747, -4510011264927231078, -4511422740196412980, -4576828217039590369, -4584269979703704845, -4628820308157533372, -4683205197644875163, -4691474129403988078, -4698071295691855471, -4775526869453964953, -4878640277195417856, -4910694478427429554, -5117637037783866995, -5168420076230218626, -533849967996952803, -5340192350891676915, -5342362537053385319, -5387165543265995168, -5565238243853457581, -561807302666534238, -5631854358142569501, -5635284018802601770, -5654311859704915751, -5673468588901507706, -5748907902021021064, -5754824590745695048, -5769076093173102698, -5844169739539231551, -5866280774789132828, -5918984249667605733, -5931165312919199335, -5999569740845354206, -6015736187302655658, -6028993643568575221, -6102009343206783837, -6160224941877843064, -6174620195594390822, -6258701687993684609, -626698018240203151, -6271513572970625621, -6502395722768854774, -6561772801900135933, -6575154774980832899, -6599850217088052332, -6711314412068810594, -6781853947708896114, -6814648958507553072, -6849763816210381551, -6855569685883463579, -6886249383551024681, -6895666085321417237, -6947294193118983664, -6988156990879450239, -702497300063104182, -7046529375004781094, -7119341047152442443, -7162465804859550596, -7226021058507810403, -7577606859358667648, -7617551309239570057, -7707571073917036634, -7714343517160240770, -7737975118096485751, -7757152545003659834, -7808363007305995003, -7944380894868648523, -801589175681579414, -8112159344209697214, -8125254031416284429, -8281689239525414642, -8418456079773422136, -8452280951634687664, -8516531891299986359, -856545487352375200, -858654049709238455, -8721644742369500221, -8745755831445717892, -875771057117726126, -8974692074837218064, -8980553982184138048, -8992068909529000613, -9012210230134713483, -9035130440865237581, -9069118510706465212, -9095494681116371046, -9113993419605077121, -9167683970172119035, -917927138709330402, -9195963694719289117, -9204552437444619279, -949755246818183658, -977835567420352130, 1023857633657896236, 1133062107205326711, 1141006958561063817, 1144874712133356595, 1154768561823444489, 1177450572738553818, 1182054956043680423, 1191460889159256418, 1210897448338306224, 1300022954669119382, 1388655541074200795, 1483468952535820533, 1540704311170188307, 1616780198765365160, 1658987176268808137, 1664558175337994313, 1724474151735914229, 176521735924112247, 1779989558455362022, 1793163749983790231, 190415635851520774, 2000555338112817716, 2018029161403874232, 2060230108288676821, 2061119988167342594, 2106078757075415380, 2174068430599759726, 2178507873306502494, 2265686861701066055, 2296134883400680142, 2325630031286295575, 233410682131138126, 2374306700681929485, 2480540545619075888, 2483190630934001709, 2595094501028532422, 264749996365466087, 2683092427245035230, 2698160617693611590, 277761394014655587, 2851207108354422117, 288377641980503052, 2973067309550171071, 3042245695595140039, 3053267208680383355, 3158000110909656729, 3196838638801447213, 3331366355185734806, 333899856619940448, 3439783902759219829, 3628269510116653105, 3750594619569194927, 378740104057200032, 3790315186730712580, 3840469898620421857, 3900382559890602317, 3926264260479524621, 4017272805369344792, 4197257784167255791, 4226482052659358787, 4290031286882248095, 4293980161696313385, 434748556748960270, 4364187062509246098, 4581059877798911934, 4762515917802102032, 4877816447148646540, 4904803892191890695, 5030819992044423809, 5085315265272571237, 5141668363550012557, 5314039917926917420, 5429866445692953023, 5455678762252730819, 5573377217198121806, 5660671444626735876, 5662132527251798420, 5667569444658979368, 5692910470897739624, 5781313542144632146, 5893860358306708633, 592418080538207350, 5972382344003135652, 6063126429834767036, 6098345825032710010, 6111774805262585617, 6141532946056913038, 6476732702847962181, 6477788696486671435, 6499521946931839019, 6523250436310471102, 6547700456184614775, 6911879253940056787, 709100032538625155, 7102214224808015371, 7102682839728601235, 7141508088573801533, 7225206089495207681, 726601050229258437, 7332048054727762690, 7402306827776948142, 7468806593322404596, 7506435495721564945, 7573546649613336089, 7696513012314163655, 7722279077662436745, 7772437378573998827, 780544898910372634, 782256403767182110, 7961579461860654914, 8073883865524594207, 8091050242952429785, 8213932593559778361, 8616407307268968810, 8781167473197419667, 8796813037006147268, 8877709666270759143, 8982523168688427581, 8990165405937496468, 9031557224746252731, 9192505459251040878]
 INFO 12:52:18,313 Enqueuing flush of Memtable-local@1397247555(84/840 serialized/live bytes, 4 ops)
 INFO 12:52:18,314 Writing Memtable-local@1397247555(84/840 serialized/live bytes, 4 ops)
 INFO 12:52:18,326 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-26-Data.db (116 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=177634)
 INFO 12:52:18,341 Enqueuing flush of Memtable-local@77117295(10101/101010 serialized/live bytes, 259 ops)
 INFO 12:52:18,341 Writing Memtable-local@77117295(10101/101010 serialized/live bytes, 259 ops)
 INFO 12:52:18,370 Completed flushing /home/joelco/orion/scratch/cassandra/data/system/local/system-local-jb-27-Data.db (5280 bytes) for commitlog position ReplayPosition(segmentId=1409705537722, position=189636)
 INFO 12:52:18,395 Node localhost/127.0.0.1 state jump to normal


What am I doing wrong ?
It is probably a stupid mistake of mine but I can't find it, this is quite frustrating.

Thanks for your help.

Cheers,

Joel

Neha

未読、
2014/09/02 22:05:472014/09/02
To: java-dri...@lists.datastax.com、java-dri...@lists.datastax.com
Hey .. 
Try localhost instead of 127.0.0.1 

Sent from my iPhone 
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Joel Costigliola

未読、
2014/09/02 22:21:122014/09/02
To: java-dri...@lists.datastax.com
Same error when using addContactPoint("localhost").
listen_address and rpc_address are both set to localhost in cassandra configuration

BTW, I'm running on Ubuntu 14.04

Thanks for your response Neha

Neha Trivedi

未読、
2014/09/02 23:07:072014/09/02
To: java-dri...@lists.datastax.com
1. you can try removing addContactPoint completely.
Cluster cluster = Cluster.builder().build();

2. Check if ur cassandra is running properly (ps -aux | grep cassandra)?
3. when u start cassandra check from log (/var/log/cassandra/..) do a tail and check which port it is listening to..

Joel Costigliola

未読、
2014/09/02 23:16:542014/09/02
To: java-dri...@lists.datastax.com
Ok I found the problem, I was running the code from a project using a lot of third parties libraries and one of them is causing the error (I don't know which one yet).

Running from a "clean" project works perfectly.

Neha, thanks for your time. Appreciated.

Joel

Neha Trivedi

未読、
2014/09/02 23:17:322014/09/02
To: java-dri...@lists.datastax.com
good :)!!

Debasish Sena

未読、
2016/05/16 2:12:112016/05/16
To: DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

I am quite new to Cassandra. I am trying to run a piece of code connecting to Cassandra database through Java driver from a Windows system. Here is my piece of code.

public static void main(String[] args) {
Cluster cluster = Cluster.builder().addContactPoint("localhost").build();
Session session = cluster.connect("people");
...
}

I am still getting the error "Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.ConnectionException: [localhost/127.0.0.1:9042] Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Unexpected exception triggered (java.lang.IndexOutOfBoundsException: Not enough readable bytes - Need 4, maximum is 0))))".

Could you please help me out.

Thanks.
Debasish

Kant Kodali

未読、
2016/05/16 3:03:302016/05/16
To: java-dri...@lists.datastax.com
Make sure Cassandra is running on default port 9042 (not sure what the command would be in windows to check if a process in running on a certain port).

I don't see anything wrong with this piece of code (assuming you have a mapping between localhost and 127.0.0.1)

public static void main(String[] args) {
Cluster cluster = Cluster.builder().addContactPoint("localhost").build();
Session session = cluster.connect("people");
...
}

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.

Debasish Sena

未読、
2016/05/16 3:07:202016/05/16
To: DataStax Java Driver for Apache Cassandra User Mailing List
Cassandra is running on 9042 port and the cluster address is 127.0.0.1 as shown by CQLSH.

Kevin Gallardo

未読、
2016/05/16 5:15:332016/05/16
To: java-dri...@lists.datastax.com
Hello, 

That error ("Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Unexpected exception triggered (java.lang.IndexOutOfBoundsException: Not enough readable bytes - Need 4, maximum is 0))))") seems to indicate an incompatibility between the Cassandra version and the driver's version. More specifically if CQLSH works, since it is packaged with your Cassandra install, so versions of CQLSH and C* are the same, but the driver may not be compatible.

However, I am not sure how much of Cassandra < 3.0 is working well on Windows. You might want to upgrade to the latest version of Cassandra which is 3.5, and the latest Java driver, 3.0.1, since Cassandra is officially supported on Windows since version 3.0.

As a reminder here is the compatibility matrix of DataStax drivers and Cassandra http://docs.datastax.com/en/developer/driver-matrix/doc/common/driverMatrix.html?scroll=driverMatrix__java-driver-matrix.

Cheers.
--
Kévin Gallardo.
Software Engineer in Drivers and Tools Team, at DataStax.

Debasish Sena

未読、
2016/05/16 6:08:392016/05/16
To: DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

I tried the same by changing the driver version. I got the result.
Thanks a ton, Kevin!!!

Cheers.

Ann Jisna James

未読、
2016/10/05 8:42:372016/10/05
To: DataStax Java Driver for Apache Cassandra User Mailing List

sir,i am a student.last year i made a mini project on cassandra but now when i am trying to run it with cassandra it is showing the same error as yours can you plz guide me as to how you resolved the issue.my front end is in java and i am working on linux platform.
全員に返信
投稿者に返信
転送
新着メール 0 件