• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Which Ports are Used by mysqld, ndb_mgmd, and ndbd/ndbmtd in a MySQL Cluster Installation

by admin

Learn which ports are used by default for mysqld, ndb_mgmd, and ndbd/ndbmtd. It will also be discussed how to change the default settings.

The MySQL Server – mysqld

The MySQL server (mysqld) uses port 3306 by default, but it can be configured to use any available port by setting the port option in the MySQL configuration file (my.cnf or my.ini) in the [mysqld] section:

[mysqld]
port = 4406

The Cluster Management Node – ndb_mgmd

The Cluster management node (ndb_mgmd) uses port 1186 by default, but it is possible to configure it to any available port by using the PortNumber option in the Cluster configuration file (config.ini):

[ndb_mgmd]
PortNumber = 1286

Alternatively the option can be set in the [ndb_mgmd default] section to apply it to all management nodes.

Note: Both the data nodes and the API nodes (e.g. mysqld) need to connect to the management node, so if the port number is changed, it is necessary to update the connection strings for the other nodes as well.

The Data Nodes – ndbd/ndbmtd

For the data nodes (ndbd/ndbmtd) the default is for the port numbers to be dynamically allocated. It is however possible to configure the port used with the ServerPort configuration setting like:

[ndbd]
ServerPort = 11100
Note that usually each ndbd/ndbmtd process will create more than one listener. Specifying the ServerPort option prevents this and only one listener is created per node.

Which Ports are Currently Used?

On several platforms, you can see which ports are used by MySQL Server and MySQL Cluster at any given time by using the netstat command. Below is an example on Linux with one management node, two data nodes, and one mysqld API node is running on the same server:

$ sudo netstat --listening --numeric --programs | grep '\bLISTEN\b' | grep -E '/ndb|/mysqld'
tcp 0 0 127.0.0.1:11100 0.0.0.0:* LISTEN 20055/ndbd 
tcp 0 0 127.0.0.1:11200 0.0.0.0:* LISTEN 20095/ndbd 
tcp 0 0 0.0.0.0:1186 0.0.0.0:* LISTEN 20040/ndb_mgmd 
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 5934/mysqld

See the platform-specific documentation for netstat to see which options are available.

Filed Under: mysql, MySQL Cluster

Some more articles you might also be interested in …

  1. How to Change the Default Character Set and Collation for a Database in MySQL
  2. How to Create a MySQL Docker Container for Testing
  3. CentOS / RHEL 6 : How to Start/Stop MySQL Server (mysqld)
  4. MySQL Backup stuck at “Starting to lock all the tables”
  5. Recommended Configuration of the MySQL Performance Schema
  6. MySQL: Identify what user and thread are holding on to a meta data lock that is preventing other queries from running
  7. How To Skip a Transaction on MySQL replication slave When GTIDs Are Enabled
  8. Understanding the REVOKE statement in MySQL
  9. Examples of mysqldump partial backups
  10. What are Reserved User Accounts in MySQL

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3 mv” Command Examples
  • “aws s3 mb” Command Examples
  • “aws s3 ls” Command Examples
  • “aws s3 cp” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright