Tamas
Tamas

Reputation: 21

Node is unreachable in single node Cassandra installation

I have a problem with a single node Cassandra installation. I can start it without any errors in the log. I can create a keyspace, create tables, insert and delete data. However truncate is not working

cqlsh> CREATE KEYSPACE mykeyspace WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};
cqlsh> use mykeyspace;
cqlsh:mykeyspace> create table test1 (num int, primary key (num));
cqlsh:mykeyspace> insert into test1 (num) values (12);
cqlsh:mykeyspace> select * from test1;

 num
-----
  12

(1 rows)
cqlsh:mykeyspace> truncate test1;
Unable to complete request: one or more nodes were unavailable.

Also if I try to run nodetool describecluster it doesn't return complete response

[XXXX@XXXX dsc-cassandra-2.0.6]$ ./bin/nodetool describecluster
Cluster Information:
        Name: Test Cluster
        Snitch: org.apache.cassandra.locator.DynamicEndpointSnitch
        Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
        Schema versions:
                UNREACHABLE: [127.0.0.1]

I'm using

I get responses for ping 127.0.0.1 and ping localhost
I checked all the ports that I am aware of cassandra may need (7000, 9160, 7199, 9042) using telnet - for example
telnet 127.0.0.1 7199
telnet localhost 7199
I can connect to these ports.

I'm using the default cassandra.yaml. These are the lines where either IP or hostname shows up

listen_address: localhost
rpc_address: localhost
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
  parameters:
      - seeds: "127.0.0.1"

I also looked into the source code. I believe the problem can be close to the method org.apache.cassandra.service.StorageProxyMBean.describeSchemaVersions(). Most likely I get no response to the SCHEMA_CHECK message.
I tried to enable TRACE log in log4j for nodetool (conf/log4j-tools.properties) to get more information about the issue, but somehow log4j didn't start logging (it did create the file that I set in the appender, but the file was empty.)

There must be something specific to this environment because I can't repeat this problem in any other environments. So I can't figure out what's causing it.

Upvotes: 1

Views: 865

Answers (1)

Tamas
Tamas

Reputation: 21

The problem was that Cassandra couldn't load snappy.

org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] null
    at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:239)
    at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48)
    at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:79)
    at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:66)
    at org.apache.cassandra.net.OutboundTcpConnection.connect(OutboundTcpConnection.java:359)
    at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:150)

I turned off compression in cassanda.yaml

internode_compression: none

Now both nodetool describecluster and I truncate work.

I also found a similar post here Cassandra Startup Error 1.2.6 on Linux x86_64

Since I can't install another glibc on this machine for the sake of testing I downloaded snappy-java-1.0.4.1.jar and replaced libsnappyjava.so in my snappy-java-1.0.5.jar

With this jar I was able to run cassandra with

internode_compression: all

(I have glibc 2.5 installed)

Upvotes: 1

Related Questions