• 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. Understanding MySQL Query Cache
  2. MySQL 8.0 : Persisted Variables
  3. How To Create a Local Yum Repository for MySQL Enterprise Packages
  4. Backup and Restore Of Group Replication Node ( MySQL 8.0 )
  5. Understanding the Different Configuration files used for MySQL Server
  6. What is the MySQL Enterprise Monitor?
  7. MySQL: How to Set Account Resource Limits
  8. MySQL : Stored Procedure For Rotating the Audit Log
  9. How to Migrate from Oracle to MySQL
  10. How to use foreign keys to attain referential integrity in MySQL

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary