zaro

What ports are used by Slurm?

Published in Slurm Networking 3 mins read

Slurm, the popular open-source workload manager for high-performance computing (HPC) clusters, relies on specific TCP ports for communication between its various daemons and client utilities. Installing the slurm package automatically configures and opens TCP ports 6817, 6818, and 6819, which are essential for its core operations.

Key Slurm Ports and Their Functions

Slurm's architecture involves several key daemons that interact over defined network ports to manage job scheduling, resource allocation, and accounting. The primary ports used by Slurm are:

Port (TCP) Default Service Description
6817 slurmctld This port is used by the Slurm Controller Daemon (slurmctld), which is the central manager of the Slurm cluster. It listens for connections from client commands (like sbatch, srun, squeue) and communicates with slurmd daemons on compute nodes to manage job submissions, scheduling, and state.
6818 slurmd Each compute node runs the Slurm Node Daemon (slurmd), which listens on this port for instructions from slurmctld. It handles job execution on its local node, monitors resources, and reports node status back to the controller.
6819 slurmdbd The Slurm Database Daemon (slurmdbd) uses this port to communicate with the slurmctld and other Slurm components for logging accounting information to a database (e.g., MySQL or MariaDB). This is crucial for tracking resource usage and job statistics.

Configuration and Firewall Considerations

While Slurm defaults to these standard ports, system administrators can customize them based on network policies, security requirements, or to avoid conflicts with other services. Proper firewall configuration is critical to ensure Slurm operates correctly and securely.

Customizing Slurm Ports

Slurm's main configuration file, /etc/slurm/slurm.conf, is where many of its parameters, including port settings, are defined.

  • SlurmctldPort: This parameter explicitly sets the TCP port for the slurmctld daemon. Its default value is 6817. You would configure SlurmctldHost in this file with the hostname of your management server.
  • DbdPort: Located in both /etc/slurm/slurm.conf and typically /etc/slurm/slurmdbd.conf, this parameter specifies the TCP port for the slurmdbd daemon. It defaults to 6819.
  • Slurmd Port: The slurmd daemon on compute nodes defaults to using TCP port 6818 for communication with slurmctld. While not directly set by a SlurmdPort parameter, slurmctld uses the SlurmPort setting (which also defaults to 6818) in slurm.conf to connect to slurmd on the compute nodes.

After changing any port settings in the configuration files, remember to restart the relevant Slurm daemons for the changes to take effect.

Firewall Rules

For Slurm to function, the specified ports must be open for TCP traffic between the different cluster components:

  • Controller (slurmctld): Needs to accept inbound connections on its configured port (default 6817) from client machines and slurmd daemons. It also initiates outbound connections to slurmd (on port 6818) and slurmdbd (on port 6819).
  • Compute Nodes (slurmd): Must accept inbound connections on its listening port (default 6818) from slurmctld.
  • Database Daemon (slurmdbd): Needs to accept inbound connections on its configured port (default 6819) from slurmctld.

It is crucial to configure your firewall (e.g., firewalld, ufw, iptables) on all Slurm hosts to allow this traffic. For example, on a system using firewalld, you might add rules like firewall-cmd --permanent --add-port=6817-6819/tcp and then reload the firewall.

Importance of Port Management

Properly managing Slurm's network ports is vital for both the security and functionality of your HPC cluster. Ensuring the correct ports are open and protected by firewalls helps prevent unauthorized access while allowing the Slurm daemons to communicate seamlessly and manage workloads efficiently.

For more detailed information on Slurm configuration and networking, refer to the official Slurm Workload Manager Documentation.