我正在尝试用cqlsh连接到cassandra,但是在cassandra服务运行时无法连接。下面是cassandra服务的状态。
(base) kuldeep@kuldeep-OptiPlex-3050:~$ systemctl status cassandra
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (running) since Mon 2020-12-28 18:13:35 IST; 25min ago
Docs: man:systemd-sysv-generator(8)
Process: 21770 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Tasks: 52 (limit: 4915)
CGroup: /system.slice/cassandra.service
└─21858 java -ea -da:net.openhft... -XX:+UseThreadPriorities -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX:StringTableSize=1000003 -XX:+AlwaysPreTouch -XX:-Us
Dec 28 18:13:35 kuldeep-OptiPlex-3050 systemd[1]: Starting LSB: distributed storage system for structured data...
Dec 28 18:13:35 kuldeep-OptiPlex-3050 systemd[1]: Started LSB: distributed storage system for structured data.
但当我试图和Cassandra联系时 cqlsh
我得到以下错误。
(base) kuldeep@kuldeep-OptiPlex-3050:~$ cqlsh
Traceback (most recent call last):
File "/usr/local/bin/cqlsh", line 115, in <module>
from cqlshlib import cqlhandling, cql3handling, pylexotron
File "/usr/lib/python2.7/dist-packages/cqlshlib/cqlhandling.py", line 22, in <module>
from cassandra.metadata import cql_keywords_reserved
ImportError: No module named cassandra.metadata
在做了一些研究之后,有人建议我安装cassandra驱动程序,我也照做了。
(base) kuldeep@kuldeep-OptiPlex-3050:~$ pip install cassandra_driver
Requirement already satisfied: cassandra_driver in ./anaconda3/lib/python3.7/site-packages (2.7.0)
Requirement already satisfied: six>=1.6 in ./anaconda3/lib/python3.7/site-packages (from cassandra_driver) (1.14.0)
Requirement already satisfied: futures in ./anaconda3/lib/python3.7/site-packages (from cassandra_driver) (3.1.1)
但我又犯了同样的错误。
cqlsh
Traceback (most recent call last):
File "/usr/local/bin/cqlsh", line 115, in <module>
from cqlshlib import cqlhandling, cql3handling, pylexotron
File "/usr/lib/python2.7/dist-packages/cqlshlib/cqlhandling.py", line 22, in <module>
from cassandra.metadata import cql_keywords_reserved
ImportError: No module named cassandra.metadata
有谁能帮我摆脱困境吗。任何帮助都将受到极大的感谢。
暂无答案!
目前还没有任何答案,快来回答吧!