python 2.7.11이상에서 cql을 실행할 수 없었던 버그가 있었다. 이는 2.1.16, 2.2.8, 3.0.9, 3.8 이상에서 패치되었다.
(거의 최근에 발견된 내용이다..)
https://issues.apache.org/jira/browse/CASSANDRA-11850
안전하게 2.7.9를 사용한다.
python 2.7.9 설치
pip 설치
cqlsh를 설치한다.
$ sudo -E pip install cqlsh
버전을 확인한다.
$ cqlsh --version
cqlsh 5.0.1
$ nodetool version
ReleaseVersion: 3.0.9
cqlsh를 실행하면 아래와 같은 에러가 발생할 수 있다.
$ cqlsh
Connection error: ('Unable to connect to any servers', {'::1': error(113, "Tried connecting to [('::1', 9042, 0, 0)]. Last error: No route to host"), '127.0.0.1': ProtocolError("cql_version '3.3.1' is not supported by remote (w/ native protocol). Supported versions: [u'3.4.0']",)})
$ cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
파이썬 드라이버 소스가 안맞거나 ip가 없어서이니.. 단순히 아래와 같이 처리한다.
참고로 cassandra 3.0.9는 cql 버전을 3.4.0을 사용한다.
~/.bashrc 파일에 다음과 같이 설정한다.
alias cqlsh="/usr/local/bin/cqlsh --cqlversion=3.4.0 11.11.11.17"
다시 cqlsh를 실행하면 잘 동작한다.
$ cqlsh
Connected to StoryCluster at 172.17.56.91:9042.
[cqlsh 5.0.1 | Cassandra 3.0.9 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh>
'cassandra' 카테고리의 다른 글
[cassandra] cqlsh에서 위,아래,좌,우 키 동작하게 하기 (0) | 2017.03.22 |
---|---|
opscenter는 cassandra 3.0에서 지원하지 않음. (0) | 2017.03.21 |
[cassandra3] Failed to add contact point 해결하기 (0) | 2017.03.20 |
[cassandra] cassandra 3.0.9 설치 (0) | 2017.03.17 |
[cassandra] 설정 수정 주의 (0) | 2017.03.17 |