Cassandra Firewall Ports

  • 0

Cassandra Firewall Ports

Category : Knowledge

Get Social!

datastax-logoCassandra uses various ports for communication, either server to server communication or client to server communication.

If you’re using Cassandra in a firewalled environment you may need to open various ports depending on your needs. All ports are TCP and can be configured in the relevant config files to use non-default ports.

Ports
Port # Type Description
7000 TCP Non-encrypted inter-node cluster communication. Not used if SSL is in use.
7001 TCP Encrypted SSL inter-node cluster communication. Not used if SSL is not in use.
7199 TCP JMX monitoring port.
9042 TCP Client port used for native CQL.
9160 TCP Client port used for Thrift.

  • 0

Change Listening Port of MySQL or MariaDB Server

Category : How-to

Get Social!

mysql-logoThe MySQL and MariaDB server both use a file called my.cnf for parameters that are used to configure the server. This is where the port number and, if you use it, the local socket can be configured.

A local socket is the prefered method of connecting to a database as it removes much of the overhead of creating a TCP connection and transferring data. This comes with the limitation that it can only be used if the application accessing the database is on the same machine. In larger or highly available systems this may not be possible.

A TCP connection is the only option of connecting to your MySQL or MariaDB database from a remote machine. It incurs a small penalty over a local socket and therefore slightly higher latencies. MySQL server and MariaDB can be configured to use a local socket, TCP connections or both.

We’ll be editing the my.cnf file for the following sections. Open the file in your favourite editor.

Configuring local socket use

The socket option indicates the filesystem path to the location of the socket you’d like to use. Specify a filesystem path, usually /var/run/mysql/mysqld.sock and the socket will be created when the server next starts. Remove or comment (#) the line to disable socket access.

Restart the server for the changes to take effect.

Setting or changing the TCP port

The port option sets the MySQL or MariaDB server port number that will be used when listening for TCP/ IP connections. The default port number is 3306 but you can change it as required. Use the port option with the bind option to control the interface where the port will be listening. Use 0.0.0.0 to listen on all IP addresses on the host, or specify a single one directly to listen on a single interface. Omit both of these options to disable TCP/ IP connections.

Restart the server for the changes to take effect.