arun kamboj
arun kamboj

Reputation: 1315

Cassandra throws an error while connecting with Sails.js

We've installed Cassandra and Sails.js on two different servers. I've installed the sails-cassandra package in Sails.js and set it up with a Cassandra IP address.

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

We're trying to run sails lift but getting the error code below:

info: Starting app...

/doowdle/backend/node_modules/cassandra-store/lib/CassandraStore.js:45 throw error; ^ Error: All host(s) tried for query failed. First host tried, X.X.X.X:9042: Error: connect ECONNREFUSED X.X.X.X:9042. See innerErrors.

Is there anything that I missed in the cassandra.yaml file?

When I run ./cassandra, i get the following output:

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]

Any Idea?

Upvotes: 0

Views: 211

Answers (1)

Alex Ott
Alex Ott

Reputation: 87259

It looks like that you're using cassandra.yaml from newer version of Cassandra, or did the mistake when configuring it. See the message:

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]

I suggest to take stock cassandra.yaml from your distribution (Cassandra 2.2.12), and modify only necessary parameters - cluster_name, listen_address, etc., and start Cassandra again.

Or take the latest Cassandra (3.11.3) and use it.

P.S. I just checked - the back_pressure_enabled was introduced only in 3.10...

Upvotes: 0

Related Questions