ubuntu - 当我输入 cqlsh 我得到连接被拒绝错误

标签 ubuntu cassandra connection port cqlsh

我已经在 ubuntu 18.04 中成功安装了 cassandra。当我在命令下运行时
得到以下输出。

sudo systemctl status cassandra

cassandra.service - LSB: distributed storage system for structured data Loaded: loaded (/etc/init.d/cassandra; generated) Active: active (exited) since Sun 2019-01-06 06:15:28 UTC; 10s ago Docs: man:systemd-sysv-generator(8) Process: 9453 ExecStop=/etc/init.d/cassandra stop (code=exited, status=0/SUCCESS)
Process: 9472 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)

Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Stopped LSB: distributed storage system for structured data. Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Starting LSB: distributed storage system for structured data... Jan 06 06:15:28 ip-172-31-4-16 systemd[1]: Started LSB: distributed storage system for structured data.



当我键入 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")})



我已经检查了 的日志/var/log/cassandra/system.log .我没有找到任何错误日志..

以下是里面的一些内容/etc/cassandra/cassandra.yaml 文件

监听地址:本地主机
存储端口:7000
ssl_storage_port:7001
start_native_transport:真
native_transport_port: 9042
start_rpc: 假
rpc_address:本地主机
rpc_port:9160
rpc_keepalive: 真

最佳答案

正如您在 status 中看到的那样,Cassandra 进程没有运行。 : active (exited) .

在 Ubuntu 18.04 上,最可能的原因是 Ubuntu 默认附带 Java 10,现有 Cassandra 版本不支持。请安装 Java 8(通过 sudo apt install openjdk-8-jdk )并将其设置为默认值 - 之后它应该可以工作。

关于ubuntu - 当我输入 cqlsh 我得到连接被拒绝错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54059187/

相关文章:

Python 为什么不能为 sqlite3 游标编写上下文管理器?

ubuntu - iwconfig -/proc/net/wireless 不存在

python - TimeUUID 与 Cassandra 和 Lazyboy

Cassandra cqlsh - 如何显示时间戳列的微秒/毫秒?

mysql - SQL 无法连接到数据库服务器

android - Sqlite Azure 移动服务 SDK 中的连接池已关闭

ubuntu - (Ubuntu 10.04) 安装 php5 时如何摆脱安装 apache2?

mysql - Ubuntu 上 C 和 MySql 中的访问拒绝错误

macos - Ubuntu/OSX 上 PhantomJS 的字体渲染差异

python - 无法使用 python 连接到 Cassandra,但可以通过 cqlsh 连接到 Cassandra