CommitLogSync 异常

CommitLogSync exception

我已经在 3 台 RHEL 服务器上安装了 cassandra。我配置了 2 个数据中心。 YAML 文件如下所示:

cluster_name: 'Cluster1'

num_tokens: 256

分区器:org.apache.cassandra.dht.Murmur3Partitioner

data_file_directories:- /home/cass/share/cassandra/data

commitlog_directory: /home/cass/share/cassandra/commitlog

saved_caches_directory: /home/cass/share/cassandra/saved_caches

seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider 参数: - 种子:“172.16.129.140” listen_address: 'IP address of the node'

endpoint_snitch: GossipingPropertyFileSnitch

我遇到以下异常: 启动期间遇到异常 (org.apache.cassandra.exceptions.ConfigurationException):缺少必需的指令 CommitLogSync

缺少必需的指令 CommitLogSync

错误05:55:21启动期间遇到异常:缺少必需的指令 CommitLogSync

这里到底出了什么问题?

您的 cassandra.yaml 是发货版本的修改版吗?即使是默认值也需要在那里。

快速浏览一下您的代码片段 - commitlog 目录是否真的存在?

commitlog_directory: /home/cass/ share/cassandra/commitlog

里面有一个space,也许这只是一个简单的错字。来自文档:

commitlog_sync

(Default: periodic) The method that Cassandra uses to acknowledge writes in milliseconds:

periodic: (Default: 10000 milliseconds [10 seconds]) With commitlog_sync_period_in_ms, controls how often the commit log is synchronized to disk. Periodic syncs are acknowledged immediately.

batch: (Default: disabled)note With commitlog_sync_batch_window_in_ms (Default: 2 ms), controls how long Cassandra waits for other writes before performing a sync. When this method is enabled, Cassandra does not acknowledge writes until they are fsynced to disk.

https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html

为了安全地设置默认值和所有参数,我总是建议使用出厂的 cassandra.yaml 并且只修改需要其他值的设置。这也使得升级时更容易 - diff 是你的朋友 - 不要错过新参数。