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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. CentOS / RHEL 6 : How to Start/Stop MySQL Server (mysqld)
  2. How to find the size of a MySQL database
  3. MySQL Enterprise Backup (MEB): Lock the Tables While Making the Backup?
  4. What is the purpose of “mysql.sys@localhost” user
  5. How to gather information on the MySQL 8 Roles and Privileges assigned to a user without using SHOW GRANTS
  6. MySQL : How To Find the Slowest Queries
  7. MySQL ‘show processlist’ statement
  8. How to List and Set SELinux Context for MySQL Server
  9. Understanding the REVOKE statement in MySQL
  10. MySQL: How to Set Account Resource Limits

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary