无法登录到 Google 云平台中托管的 datastax Cassandra 集群中的 cqlsh

Ani*_*tta 1 cassandra cqlsh datastax google-cloud-platform

我已经在 GCP 中设置了一个 2 节点的 Casandra 集群。

在此处输入图片说明

但问题是我无法访问 cqlsh。我收到 belwo 错误在此处输入图片说明

Aar*_*ron 6

$ cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1':
Run Code Online (Sandbox Code Playgroud)

首先,正如我在本答案中向您提到的,使用 cqlsh 连接到 127.0.0.1 根本无法在多节点集群中工作。您需要指定nodetool status命令结果中显示的 IP 地址。

接下来,错误消息的第二部分应该给出一个重要的线索:

    AuthenticationFailed('Remote end requires authentication'),)})
Run Code Online (Sandbox Code Playgroud)

启用身份验证后,您需要提供有效的用户名和密码才能登录。如果您尚未创建任何新用户,则用户名和密码都将默认为“cassandra”。

$ cqlsh 10.138.0.3 -u cassandra -p cassandra
Run Code Online (Sandbox Code Playgroud)