View current swarm settings
In this step, you will learn how to view the current settings of your Docker Swarm. This is useful for understanding the current configuration and for verifying changes after updating settings.
To view the swarm settings, you use the docker swarm inspect
command. This command provides detailed information about the swarm, including its ID, creation date, and various configuration settings.
Open the terminal and run the following command to inspect the Docker Swarm:
docker swarm inspect
The output will be a JSON object containing the swarm configuration. Look for the Spec
section, which contains the configurable settings. Pay attention to the Orchestration
and Dispatcher
fields, as these contain settings related to task history and node certificates.
For example, you might see output similar to this (the exact values will vary):
[
{
"ID": "xxxxxxxxxxxx",
"Version": {
"Index": 10
},
"CreatedAt": "2023-10-27T10:00:00.000000000Z",
"UpdatedAt": "2023-10-27T10:00:00.000000000Z",
"Spec": {
"Orchestration": {
"TaskHistoryRetentionLimit": 5
},
"Raft": {
"SnapshotInterval": 10000,
"KeepOldSnapshots": 0,
"LogEntriesForSlowFollowers": 500,
"ElectionTick": 3,
"HeartbeatTick": 1
},
"Dispatcher": {
"HeartbeatPeriod": 5000000000
},
"CAConfig": {
"NodeCertExpiry": 7776000000000000,
"ExternalCAs": null,
"SigningCACert": "...",
"SigningCAKey": "...",
"ForceRotate": 0
},
"TaskDefaults": {
"LogDriver": null
}
},
"TLSInfo": {
"TrustRoot": "...",
"CertIssuerSubject": "CN=swarm-ca",
"CertIssuerPublicKey": "..."
},
"RootRotationInProgress": false
}
]
In the Spec
section, you can find the TaskHistoryRetentionLimit
under Orchestration
and NodeCertExpiry
under CAConfig
. These are the settings we will modify in the next steps.