Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cassandra -tokens and org.apache.cassandra.exceptions.ConfigurationException: For input string:

Tags:

cassandra

whats the deal with Cassandra?

From the token tool with 2 nodes and on the second cluster I get the below error.

   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)
like image 942
Tampa Avatar asked Feb 25 '14 06:02

Tampa


People also ask

What is the Apache Cassandra Project?

The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model. 3. Apache Cassandra WSO2 46 usages 4. Apache Cassandra 13 usages

What is the default location for hints in Cassandra?

If not set, the default directory is $CASSANDRA_HOME/data/hints. How often hints should be flushed from the internal buffers to disk. Will not trigger fsync. Min unit: ms Maximum size for a single hints file, in mebibytes. Min unit: MiB This option is commented out by default.

What happens if counter cache is > 1 in Cassandra?

In case of RF = 1 a counter cache hit will cause Cassandra to skip the read before write entirely. With RF > 1 a counter cache hit will still help to reduce the duration of the lock hold, helping with hot counter cell updates, but will not allow skipping the read entirely.

How to restrict user access to certain DCS in Cassandra?

Network authorization backend, implementing INetworkAuthorizer; used to restrict user access to certain DCs Out of the box, Cassandra provides org.apache.cassandra.auth. {AllowAllNetworkAuthorizer, CassandraNetworkAuthorizer}. AllowAllNetworkAuthorizer allows access to any DC to any user - set it to disable authorization.


1 Answers

These aren't valid Murmur3Partitioner tokens, they are RandomPartitioner tokens. Take a look at these DataStax docs on generating murmur3 tokens, or if you do want to use RandomPartitioner then edit your partitioner setting in cassandra.

Just for a clear comparison

Murmur3 Partitioner    | Random Partitioner
------------------------------------------------------------
-9223372036854775808   | 0
-4611686018427387904   | 42535295865117307932921825928971026432
-0                     | 85070591730234615865843651857942052864
-4611686018427387904   | 127605887595351923798765477786913079296

You can generate murmur3 tokens using python (n is the number of nodes in the 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)]'
like image 98
Lyuben Todorov Avatar answered Sep 22 '22 06:09

Lyuben Todorov