2016-10-08 2 views
0

최근에 cassandra를 학습하고 DataStax Java 드라이버가있는 cassandra에 대한 온라인 자습서를 진행했습니다. 로컬 호스트 노드 내 노트북에Error NoHostAvailableException : 시도한 모든 호스트가 실패했습니다. (시도 : /127.0.0.1:9042

설정 세부 사항 -

OS - 윈도우 7

카산드라 버전 - 카산드라 버전 :. 2.1-SNAPSHOT

DataStax 자바 드라이버 버전 - 3.1.0

CQLSH 및 cassandra-cli 클라이언트를 사용하여 로컬 노드에 연결할 수있었습니다. 기본 키 공간 시스템 및 system_traces를 볼 수도 있습니다. 이 코드는 예외 아래에 발생

 Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build(); 
     Metadata metadata = cluster.getMetadata(); 

- - 나는 모든 통해왔다 추적

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured columnfamily schema_usertypes)) 
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:233) 

의 일부 다음은 내가 간단한 코드 아래에 애 쓰고 카산드라 서버 로그

INFO 12:12:51 Node localhost/127.0.0.1 state jump to normal 
INFO 12:12:51 Startup completed! Now serving reads. 
INFO 12:12:51 Starting listening for CQL clients on /0.0.0.0:9042... 
INFO 12:12:51 Binding thrift service to /0.0.0.0:9160 
INFO 12:12:51 Using TFramedTransport with a max frame size of 15728640 bytes. 
INFO 12:12:51 Using synchronous/threadpool thrift server on 0.0.0.0 : 9160 
INFO 12:12:51 Listening for thrift clients... 

입니다 이전에 묻는 질문 대부분의 답변은 cassandra.yaml 파일의 구성을 변경하는 것이 좋습니다.

내 cassandra.yaml 구성은 -

start_native_transport: true 
native_transport_port: 9042 
listen_address: localhost 
rpc_address: 0.0.0.0 
rpc_port: 9160 

답변의 대부분은 내가 시도했지만 작동하지 않았다, rpc_address에서 머신의 실제 IP 주소를 사용하도록 제안합니다. Question One, Question two, Question three, Topic, Connection requirement, Question four -

는 여기에 내가 겪은 [질문입니다.

This page은 Java DataStax 드라이버와 cassandra 버전의 호환성을 나열하므로 드라이버 버전을 2.1.1 (Casandra 2.1을 사용함에 따라)으로 변경했지만 작동하지 않았습니다.

무엇이 잘못되었을 수 있습니다.

답변

1

schema_usertypes의 오류는 드라이버가이 테이블과 관련이없는 것으로 보려고 한 것처럼 보입니다. Jira.

카산드라 2.1 스넵 샷을 실행 중이십니까? Cassandra 2.1.15를 사용해보십시오. 카산드라 노드에서 뭔가가 보이기 때문에 드라이버가 schema_usertypes 내부의 데이터를 검색하려고하므로 클러스터와 대화 할 수 있습니다.

+0

Cassandra-2.1.15와 함께 작업했습니다. 두 버전의 드라이버 - 3.1.0 및 2.1.1 작업 – Gunwant

관련 문제