DCA practice question 20 of 25

Will this command list all nodes in a swarm cluster from the command line? Solution: 'docker node Is'

Full set: 191 questions
Answer options
A: Yes Correct answer
B: No
Correct Answer:
A. Yes
Explanation

The command docker node ls is the correct and standard command to list all nodes that are part of a Docker Swarm cluster. When executed on a manager node, it provides a table of information for each node, including its ID, hostname, availability, manager status, and engine version. The ls is an alias for list. This command is the primary tool for administrators to view the current state and membership of the swarm cluster from the command line.

Why Incorrect

B. No: This is incorrect. The official Docker documentation and command-line reference explicitly define docker node ls as the command for listing swarm nodes.

References

1. Docker Inc. (2024). docker node ls. Docker Documentation, Command-line reference. Retrieved from https://docs.docker.com/engine/reference/commandline/nodels/. (The main description states: "Lists the nodes in the swarm.")

2. Docker Inc. (2024). Manage swarm service. Docker Documentation. Retrieved from https://docs.docker.com/engine/swarm/swarm-tutorial/deploy-service/. (In "Step 3: Deploy the service on the swarm", the tutorial uses docker node ls to verify the nodes in the swarm.)

Scroll to Top