2016-07-14 127 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

相關問題