【问题标题】:DS201 Cassandra killrvideo - Python Driver and NodesDS201 Cassandra killrvideo - Python 驱动程序和节点
【发布时间】:2016-11-17 17:30:56
【问题描述】:

环境:DSE DS201 虚拟机

错误 1: 练习5:Drivers.ipynb enter image description here

在尝试使用 Python 驱动程序连接到 Cassandra 时。

    from cassandra.cluster import Cluster
    cluster = Cluster()
    session = cluster.connect('killrvideo')

    NoHostAvailable    Traceback (most recent call last)
    <ipython-input-1-535660701145> in <module>()
    1 from cassandra.cluster import Cluster
    2 cluster = Cluster()
    ----> 3 session = cluster.connect('killrvideo')

   /usr/local/lib/python2.7/dist-packages/cassandra/cluster.so in     
    cassandra.cluster.Cluster.connect (cassandra/cluster.c:11471)()

错误 2: 练习:7 Ring.ipynb

一旦我按照笔记本中的建议进行更改并启动节点 1;面对错误。

    root@sample:~/Desktop/node1/bin# ./cassandra
    Cannot change the number of tokens from 256 to 1
    Fatal configuration error; unable to start server.  See log for stacktrace.
    ERROR 22:08:32 Fatal configuration error

org.apache.cassandra.exceptions.ConfigurationException:无法将令牌数从 256 更改为 1 ...

完全关注 Jupyter notebook。然而面临一个错误。

【问题讨论】:

  • cassandra.yaml 中 num_tokens 和 initial_token 的值是什么
  • 按照练习笔记本中的建议,进行如下更改:num_tokens 值从 256 变为 1。取消注释 initial_token 值并将其设置为 0。listen_address 从 localhost 到 127.0.0.1 在 cassandra- env.sh: MAX_HEAP_SIZE="128M" HEAP_NEW_SIZE"32M"
  • 由于我使用的是DS提供的VM,叫DS201;似乎它使用特定于 DSE 版本的驱动程序。所以我终于安装了 DSE 驱动程序 #pip install cassandra-driver-dse #python -c 'import dse; print dse.__version__' 输出应该是:1.0.2 之后我可以使用 Python 连接到 DS

标签: python cassandra datastax datastax-enterprise


【解决方案1】:

所以最后我解决了这个问题。问题出在 Python 驱动程序上

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-11
    • 1970-01-01
    • 2015-04-12
    • 2017-11-26
    • 2018-06-15
    • 2018-11-10
    • 2016-10-02
    • 1970-01-01
    相关资源
    最近更新 更多