与Sails.js连接时,Cassandra引发错误

时间:2018-10-09 03:40:12

标签: cassandra sails.js

我们已经在两个不同的服务器上安装了Cassandra和Sails.js。我已经在Sails.js中安装了sails-cassandra软件包,并使用Cassandra IP地址进行了设置。

  connections: {
    someCassandraServer: {
      contactPoints: ["X.X.X.X"],
      user: 'cassandra', //optional
      password: 'cassandra', //optional
      keyspace: 'testkeyspace'
    }
  },

我们正在尝试运行sails lift,但在下面显示错误代码:

信息:正在启动应用程序...

/doowdle/backend/node_modules/cassandra-store/lib/CassandraStore.js:45抛出错误; ^错误:所有尝试查询的主机均失败。第一个尝试过的主机,X.X.X.X:9042:错误:连接ECONNREFUSED X.X.X.X:9042。参见innerErrors。

cassandra.yaml文件中是否缺少任何内容?

运行./cassandra时,得到以下输出:

owner@STS-YYC-UBUNTU:/etc/apache-cassandra-2.2.12/bin$ ./cassandra 
owner@STS-YYC-UBUNTU:/etc/apache-cassandra-2.2.12/bin$ 
CompilerOracle: inline org/apache/cassandra/db/AbstractNativeCell.compareTo (Lorg/apache/cassandra/db/composites/Composite;)I 
CompilerOracle: inline org/apache/cassandra/db/composites/AbstractSimpleCellNameType.compareUnsigned (Lorg/apache/cassandra/db/composites/Composite;Lorg/apache/cassandra/db/composites/Composite;)I 
CompilerOracle: inline org/apache/cassandra/io/util/Memory.checkBounds (JJ)V 
CompilerOracle: inline org/apache/cassandra/io/util/SafeMemory.checkBounds (JJ)V 
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.selectBoundary (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;II)I 
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.strictnessOfLessThan (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;)I 
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare (Ljava/nio/ByteBuffer;[B)I 
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare ([BLjava/nio/ByteBuffer;)I 
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I 
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/lang/Object;JI)I 
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/nio/ByteBuffer;)I 
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I 
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: Invalid yaml. 
Please remove properties [credentials_validity_in_ms, enable_scripted_user_defined_functions, column_index_cache_size_in_kb, back_pressure_enabled, 
enable_materialized_views, cdc_enabled, prepared_statements_cache_size_mb, back_pressure_strategy, concurrent_materialized_view_writes, 
transparent_data_encryption_options, thrift_prepared_statements_cache_size_mb, slow_query_log_timeout_in_ms, hints_flush_period_in_ms, 
max_hints_file_size_in_mb] from your cassandra.yaml org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. 
Please remove properties [credentials_validity_in_ms, enable_scripted_user_defined_functions, column_index_cache_size_in_kb, back_pressure_enabled, 
enable_materialized_views, cdc_enabled, prepared_statements_cache_size_mb, back_pressure_strategy, concurrent_materialized_view_writes, 
transparent_data_encryption_options, thrift_prepared_statements_cache_size_mb, slow_query_log_timeout_in_ms, hints_flush_period_in_ms, 
max_hints_file_size_in_mb] from your cassandra.yaml 
at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:146) 
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:113) 
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:85) 
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:149) 
at org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:133) 
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:507) 
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:642) 
ERROR 03:26:04 Exception encountered during startup org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. 
Please remove properties [credentials_validity_in_ms, enable_scripted_user_defined_functions, column_index_cache_size_in_kb, back_pressure_enabled, 
enable_materialized_views, cdc_enabled, prepared_statements_cache_size_mb, back_pressure_strategy, concurrent_materialized_view_writes, 
transparent_data_encryption_options, thrift_prepared_statements_cache_size_mb, slow_query_log_timeout_in_ms, hints_flush_period_in_ms, 
max_hints_file_size_in_mb] from your cassandra.yaml 
at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:146) ~[apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:113) ~[apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:85) ~[apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:149) ~[apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:133) ~[apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:507) [apache-cassandra-2.2.12.jar:2.2.12] 
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:642) [apache-cassandra-2.2.12.jar:2.2.12]

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您似乎在使用新版Cassandra中的cassandra.yaml,或者在配置它时出错。查看消息:

  

无效的Yaml。请删除性能:[credentials_validity_in_ms,enable_scripted_user_defined_functions,column_index_cache_size_in_kb,back_pressure_enabled,enable_materialized_views,cdc_enabled,prepared_statements_cache_size_mb,back_pressure_strategy,concurrent_materialized_view_writes,transparent_data_encryption_options,thrift_prepared_statements_cache_size_mb,slow_query_log_timeout_in_ms,hints_flush_period_in_ms,max_hints_file_size_in_mb]

我建议从您的发行版(Cassandra 2.2.12)中获取库存cassandra.yaml,并仅修改必要的参数-cluster_namelisten_address等,然后再次启动Cassandra。 / p>

或者使用最新的Cassandra(3.11.3)并使用它。

P.S。我刚刚检查过-back_pressure_enabled SO post ...