Not able to start WSO2 CEP and external Apache Cassandra together on same host

744 Views Asked by At

I've installed WS02 CEP (v2.1.0) and Datastax Community provided Apache Casandra (latest version) locally on my machine (Windows OS). I'm finding issues in launching them together probably because of clash of Thrift client port (9160). If I edit the cassandra.yaml file in the Datastax Community provided Cassandra folder and change the port to something else (say 9166), I can successfully launch both together. But then I cannot launch the cqlsh command based client to query Datastax Cassandra. It gives below error:

cql.cassandra.ttypes.InvalidRequestException: InvalidRequestException(why='Provided version 3.1.1 is not supported by this server (supported: 2.0.0, 3.0.0-beta1)')

I think the reason is that the cqlsh client is by default sending query to 9160 port. Now since I've edited the port, it is querying the Cassandra database embedded withing WSO2 CEP and that probably is of different version.

I've now reverted the port back to 9160 in the cassandra.yaml file of the Datastax Community provided Cassandra folder. I'm now trying the other way; i.e., trying to edit port in the WSO2 CEP embedded Cassandra database. I edited the cassandra-component.xml file under C:\Program Files\wso2cep-2.1.0\repository\conf\etc and changed the port to 9166. However if I now launch both WSO2 CEP and Datastax Cassandra, I get the same error of port clash issue.

---------------------
java.lang.RuntimeException: Unable to create thrift socket to localhost/127.0.0.1:9160
        at org.apache.cassandra.thrift.CassandraDaemon$ThriftServer.<init>(CassandraDaemon.java:147)
        at org.apache.cassandra.thrift.CassandraDaemon.startServer(CassandraDaemon.java:75)
        at org.apache.cassandra.service.AbstractCassandraDaemon.startRPCServer(AbstractCassandraDaemon.java:297)
        at org.apache.cassandra.service.AbstractCassandraDaemon.start(AbstractCassandraDaemon.java:269)
        at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:366)
        at org.wso2.carbon.cassandra.server.CassandraServerController$1.run(CassandraServerController.java:48)
        at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address localhost/127.0.0.1:9160.
        at org.apache.cassandra.thrift.TCustomServerSocket.<init>(TCustomServerSocket.java:78)
        at org.apache.cassandra.thrift.CassandraDaemon$ThriftServer.<init>(CassandraDaemon.java:140)
        ... 6 more
Exception encountered during startup: Unable to create thrift socket to localhost/127.0.0.1:9160
[2013-12-03 17:59:33,001]  INFO {org.apache.cassandra.gms.Gossiper} -  Announcing shutdown
-----------------------------

Can someone pls help out on how I can resolve this issue ?

Many thanks in advance.

Best Regards LB

2

There are 2 best solutions below

0
On

Check /etc/cassandra/conf/cassandra.yaml file rpc_port value should not be same as cqlsh port change it from 9160 to another value and restart cassandra service

0
On

You can pass the port to cqlsh, e.g., to connect to cassandra on localhost port 9166 you would run:

cqlsh localhost 9166