109

When experimenting with Cassandra I've observed that Cassandra listens to the following ports:

  • TCP *:8080
  • TCP *:8888
  • TCP *:57311
  • TCP *:57312
  • TCP 127.0.0.1:7000
  • TCP 127.0.0.1:9160
  • UDP 127.0.0.1:700

How does Cassandra use each of the ports listed?

knorv
  • 49,059
  • 74
  • 210
  • 294
  • 13
    adamse: Thanks for the tip! That's probably so, but for the sake of future Cassandra users on Stackoverflow (a growing population!) I thinks it good to have the answer stored here too :-) – knorv Mar 01 '10 at 21:33

7 Answers7

148

@Schildmeijer is largely right, however port 7001 is still used when using TLS Encrypted Internode communication

So my complete list would be for current versions of Cassandra:

  • 7199 - JMX (was 8080 pre Cassandra 0.8.xx)
  • 7000 - Internode communication (not used if TLS enabled)
  • 7001 - TLS Internode communication (used if TLS enabled)
  • 9160 - Thrift client API
  • 9042 - CQL native transport port
Kracekumar
  • 19,457
  • 10
  • 47
  • 56
Matthew O'Riordan
  • 7,981
  • 4
  • 45
  • 59
  • 4
    Here is the up-to-date link as of 2017 to the official documentation http://cassandra.apache.org/doc/latest/faq/index.html#what-ports – Johnride Jan 30 '17 at 16:40
54

For Apache Cassandra 2.0 you need to take into account the following TCP ports: (See EC2 security group configuration and Apache Cassandra FAQ)

Cassandra

  • 7199 JMX monitoring port
  • 1024 - 65355 Random port required by JMX. Starting with Java 7u4 a specific port can be specified using the com.sun.management.jmxremote.rmi.port property.
  • 7000 Inter-node cluster
  • 7001 SSL inter-node cluster
  • 9042 CQL Native Transport Port
  • 9160 Thrift

DataStax OpsCenter

  • 61620 opscenterd daemon
  • 61621 Agent
  • 8888 Website

Architecture

A possible architecture with Cassandra + OpsCenter on EC2 could look like this: AWS EC2 with OpsCenter

joscas
  • 7,474
  • 5
  • 39
  • 59
37

8080 - JMX (remote)

8888 - Remote debugger (removed in 0.6.0)

7000 - Used internal by Cassandra
(7001 - Obsolete, removed in 0.6.0. Used for membership communication, aka gossip)

9160 - Thrift client API

Cassandra FAQ What ports does Cassandra use?

Johnride
  • 8,476
  • 5
  • 29
  • 39
Schildmeijer
  • 20,702
  • 12
  • 62
  • 79
7

JMX now uses port 7199 instead of port 8080 (as of Cassandra 0.8.xx).

This is configurable in your cassandra-env.sh file, but the default is 7199.

David
  • 896
  • 1
  • 10
  • 12
5

Ports 57311 and 57312 are randomly assigned ports used for RMI communication. These ports change each time Cassandra starts up, but need to be open in the firewall, along with 8080/7199 (depending on version), to allow for remote JMX access. Something that doesn't appear to be particularly well documented, but has tripped me up in the past.

chrisbunney
  • 5,819
  • 7
  • 48
  • 67
  • 1
    For posterity, this annoyance should be fixed, from Cassandra 2.0.8 onward [according to this ticket](https://issues.apache.org/jira/browse/CASSANDRA-7087). The default `cassandra-env.sh` now sets the `com.sun.management.jmxremote.rmi.port` property to the same value as the main JMX port so that random ports are not used. – ches Dec 18 '14 at 11:32
0

In addition to the above answers, as part of configuring your firewall, if you are using SSH then use port 22.

Keerthikanth Chowdary
  • 728
  • 1
  • 10
  • 17
-1

I resolved issue using below steps :

  1. Stop cassandara services

    sudo su -
    systemctl stop datastax-agent
    systemctl stop opscenterd
    systemctl stop app-dse
    
  2. Take backup and Change port from 9042 to 9035

    cp /opt/dse/resources/cassandra/conf/cassandra.yaml /opt/dse/resources/cassandra/conf/bkp_cassandra.yaml
    Vi /opt/dse/resources/cassandra/conf/cassandra.yaml
    native_transport_port: 9035
    
  3. Start Cassandra services

    systemctl start datastax-agent
    systemctl start opscenterd
    systemctl start app-dse
    
  4. create cqlshrc file.

    vi  /root/.cassandra/cqlshrc
    
    [connection]
    hostname = 198.168.1.100
    port = 9035
    

Thanks, Mahesh

GGamba
  • 13,140
  • 3
  • 38
  • 47