如何在 MacOs Big Sur 上安装 Cassandra

时间:2021-01-05 10:49:34

标签: cassandra macos-big-sur

我使用 brew 在 MacOs 上安装了 Cassandra:brew install cassandra 并成功运行cassandra -f

升级到 MacOs Big Sur cassandra 后无法启动,出现此错误:

Cannot change the number of tokens from 512 to 256
Fatal configuration error; unable to start server.  See log for stacktrace.
ERROR [main] 2021-01-05 11:53:34,647 CassandraDaemon.java:803 - Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Cannot change the number of tokens from 512 to 256
    at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:1050) ~[apache-cassandra-3.11.9.jar:3.11.9]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:732) ~[apache-cassandra-3.11.9.jar:3.11.9]
    at org.apache.cassandra.service.StorageService.initServer(StorageService.java:666) ~[apache-cassandra-3.11.9.jar:3.11.9]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:395) [apache-cassandra-3.11.9.jar:3.11.9]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:633) [apache-cassandra-3.11.9.jar:3.11.9]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:786) [apache-cassandra-3.11.9.jar:3.11.9]
INFO  [StorageServiceShutdownHook] 2021-01-05 11:53:34,649 HintsService.java:209 - Paused hints dispatch
INFO  [StorageServiceShutdownHook] 2021-01-05 11:53:34,649 Gossiper.java:1662 - Announcing shutdown
INFO  [StorageServiceShutdownHook] 2021-01-05 11:53:34,657 StorageService.java:2408 - Node localhost/127.0.0.1 state jump to shutdown
INFO  [StorageServiceShutdownHook] 2021-01-05 11:53:36,663 MessagingService.java:985 - Waiting for messaging service to quiesce
INFO  [ACCEPT-localhost/127.0.0.1] 2021-01-05 11:53:36,665 MessagingService.java:1346 - MessagingService has terminated the accept() thread
INFO  [StorageServiceShutdownHook] 2021-01-05 11:53:36,745 HintsService.java:209 - Paused hints dispatch

首先我尝试通过 brew 卸载 Cassandra,删除剩余的文件: rm -rf /usr/local/etc/cassandra 并用 brew 重新安装它。这没有帮助。

我发现这个 link 存在复杂的支持问题,这些问题依赖于找出 Cassandra 配置所在的位置以及大量阅读关于 cassandra 上下文中的令牌的内容。对于自动开发环境来说,这似乎有点极端。

如何在 MacOs Big Sur 上安装 Cassandra? 有没有快速修复

1 个答案:

答案 0 :(得分:0)

凭直觉,我按照链接中的部分说明进行操作,然后 在 '/usr/local/etc/cassandra' 将 num_tokens 属性值从 256 替换为 512,它似乎有效。请发布更好的答案或指向 brew 的修复