【问题标题】:Connecting to Cassandra Instance Remotely using Linux Shell Script使用 Linux Shell 脚本远程连接到 Cassandra 实例
【发布时间】:2017-02-04 17:46:45
【问题描述】:

我想从我的开发环境连接到安装在远程服务器中的 Cassandra。开发环境没有安装 cassandra,因此它不允许我执行以下操作来连接到我在另一台机器上运行的 cassandra 服务器。

客户端系统 - 没有 Cassandra 的开发系统 目标系统 - 安装 Cassandra 的 Prod 环境

我正在我的开发终端上尝试以下命令来连接到 Prod Cassandra。

/opt/cassandra/dse-4.8.7/bin/cqlsh -e "select * from /"IasService/"./"Table/" 限制 10" remote.stress.py1.s.com 9160 -u test-p test2;

任何线索都会有所帮助。

【问题讨论】:

    标签: linux shell cassandra datastax cqlsh


    【解决方案1】:

    tldr;

    从您的命令中删除 9160。

    如果您提供错误消息或命令结果,会更容易为您提供帮助。

    话虽如此,DSE 4.8.7 的核心是 Cassandra 2.1.14。从 Cassandra 2.1 开始,cqlsh 使用端口 9042 上的本机二进制协议进行连接。所以强制它到 9160(就像你一样)肯定行不通。

    $ cqlsh -e "SELECT release_version FROM system.local" 192.168.6.5 9042 
      -u cassdba -p superSecret
    
     release_version
    -----------------
              2.1.13
    
    (1 rows)
    

    而且由于 9042 是现在 cqlsh 使用的默认端口,所以你根本不需要指定它。

    【讨论】:

      猜你喜欢
      • 2022-10-24
      • 1970-01-01
      • 2021-02-12
      • 2021-03-24
      • 1970-01-01
      • 2013-10-01
      • 2016-09-02
      • 2015-07-10
      • 2014-05-05
      相关资源
      最近更新 更多