2016-07-14 42 views
1

我在Windows中编写了一个python脚本,它接受cassandra.yaml文件,用不同的值写入一个新文件,然后将该文件复制到Linux服务器。不过,我开始卡桑德拉时获得来自Linux服务器这个错误:Cassandra尽管有效值,Yaml无效

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 

回答

3

是否错误有类似的错误 消息说无效性呢?

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

它有与支架做允许返回,而不是换行字符 ?

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

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

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

+0

谢谢,你是对的,它是一个版本不匹配:我是从版本3.7复制cassandra.yaml文件到运行版本3.0的Linux服务器。 7。 – Rdesmond