尽管有效值,但Cassandra无效Yaml

时间:2016-07-14 01:07:47

标签: cassandra yaml carriage-return linefeed

我在Windows中编写一个python脚本,它接收一个cassandra.yaml文件,写一个具有不同值的新文件,然后将该文件复制到linux服务器。但是,我在启动cassandra时从linux服务器收到此错误:

ERROR 00:53:03 Exception encountered during startup
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [credentials_validity_in_ms, prepared_statements_cache_size_mb, transparent_data_encryption_options, thrift_prepared_statements_cache_size_mb, column_index_cache_size_in_kb] from your cassandra.yaml
    at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:188) ~[apache-cassandra-3.0.7.jar:3.0.7]
    at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:119) ~[apache-cassandra-3.0.7.jar:3.0.7]

我查看了复制到linux服务器的文件,下面是在vi中查看时的一部分。该错误是否与错误消息所示的无效属性有关,还是与回车而不是换行字符有关?或完全不同的东西(如果需要可以发布完整的yaml文件)?

# Validity period for credentials cache. This cache is tightly coupled to^M
# the provided PasswordAuthenticator implementation of IAuthenticator. If^M
# another IAuthenticator implementation is configured, this cache will not^M
# be automatically used and so the following settings will have no effect.^M
# Please note, credentials are cached in their encrypted form, so while^M
# activating this cache may reduce the number of queries made to the^M
# underlying table, it may not  bring a significant reduction in the^M
# latency of individual authentication attempts.^M
# Defaults to 2000, set to 0 to disable credentials caching.^M
credentials_validity_in_ms: 2000^M
^M
# Refresh interval for credentials cache (if enabled).^M

1 个答案:

答案 0 :(得分:3)

  

错误是否与错误等无效属性有关   消息说?

是。我认为它与您使用python脚本添加的属性有关。我还尝试添加一些附加属性(它们不是原始 cassandra.yaml 的一部分),但cassandra无法启动。我认为 cassandra.yaml

是不允许的
  

是否与回车而不是换行有关   字符?

我不这么认为。就此错误而言,它明确指出您不得在 cassandra.yaml 中使用任何添加属性。

DOS / Windows使用CR-LF字符作为行分隔符,但基于Linux的系统仅使用LF。这就是为什么^ M字符出现在你的vi编辑器中。您可以使用dos2unix实用程序从任何文件中删除CR字符。

BTW为什么要在 cassandra.yaml 文件中添加这些属性?您可以创建自己的属性文件并从那里读取可配置的值