与Cassandra的交易是什么?
从具有2个节点的令牌工具和第二个群集上,我得到以下错误。
initial_token: 85070591730234615865843651857942052864
INFO [main] 2014-02-25 01:15:39,670 CassandraDaemon.java (line 130) Logging initialized
INFO [main] 2014-02-25 01:15:39,716 YamlConfigurationLoader.java (line 76) Loading settings from file:/etc/cassandra/cassandra.yaml
INFO [main] 2014-02-25 01:15:40,407 DatabaseDescriptor.java (line 141) Data files directories: [/var/lib/cassandra/data]
INFO [main] 2014-02-25 01:15:40,408 DatabaseDescriptor.java (line 142) Commit log directory: /var/lib/cassandra/commitlog
INFO [main] 2014-02-25 01:15:40,409 DatabaseDescriptor.java (line 182) DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
INFO [main] 2014-02-25 01:15:40,409 DatabaseDescriptor.java (line 196) disk_failure_policy is stop
INFO [main] 2014-02-25 01:15:40,417 DatabaseDescriptor.java (line 266) Global memtable threshold is enabled at 122MB
INFO [main] 2014-02-25 01:15:40,609 DatabaseDescriptor.java (line 399) Not using multi-threaded compaction
ERROR [main] 2014-02-25 01:15:40,612 DatabaseDescriptor.java (line 115) Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: For input string: "85070591730234615865843651857942052864"
at org.apache.cassandra.dht.Murmur3Partitioner$1.validate(Murmur3Partitioner.java:178)
at org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:438)
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:110)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:151)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:462)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:552)
答案 0 :(得分:6)
这些是无效的Murmur3Partitioner令牌,它们是RandomPartitioner令牌。看一下这些DataStax docs生成murmur3标记,或者如果你想使用RandomPartitioner,那么在cassandra中编辑你的partitioner
设置。
只是为了明确比较
Murmur3 Partitioner | Random Partitioner
------------------------------------------------------------
-9223372036854775808 | 0
-4611686018427387904 | 42535295865117307932921825928971026432
-0 | 85070591730234615865843651857942052864
-4611686018427387904 | 127605887595351923798765477786913079296
你可以使用python生成murmur3标记(n是dc中的节点数):
python -c 'print [str(((2**64 / n) * i) - 2**63) for i in range(n)]'
# eg for 4 nodes...
python -c 'print [str(((2**64 / 4) * i) - 2**63) for i in range(4)]'