mirror of https://github.com/docker/docs.git
				
				
				
			Add swarm task state REMOVE (#6206)
This commit is contained in:
		
							parent
							
								
									246e8e2e3a
								
							
						
					
					
						commit
						542032cf21
					
				|  | @ -6,23 +6,18 @@ redirect_from: | ||||||
| - /datacenter/ucp/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-task-state/ | - /datacenter/ucp/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-task-state/ | ||||||
| --- | --- | ||||||
| 
 | 
 | ||||||
| Docker lets you create services, which can start tasks. | Docker lets you create services, which can start tasks. A service is a description of a desired state, and a task does the work. | ||||||
| A service is a description of a desired state, and a task does the work. |  | ||||||
| Work is scheduled on swarm nodes in this sequence: | Work is scheduled on swarm nodes in this sequence: | ||||||
| 
 | 
 | ||||||
| 1. Create a service by using `docker service create` or the UCP web UI or CLI. | 1.  Create a service by using `docker service create` or the UCP web UI or CLI. | ||||||
| 2. The request goes to a Docker manager node. | 2.  The request goes to a Docker manager node. | ||||||
| 2. The Docker manager node schedules the service to run on particular nodes.  | 3.  The Docker manager node schedules the service to run on particular nodes. | ||||||
| 3. Each service can start multiple tasks. | 4.  Each service can start multiple tasks. | ||||||
| 4. Each task has a life cycle, with states like `NEW`, `PENDING`, and `COMPLETE`. | 5.  Each task has a life cycle, with states like `NEW`, `PENDING`, and `COMPLETE`. | ||||||
| 
 | 
 | ||||||
| Tasks are execution units that run once to completion. When a task stops, | Tasks are execution units that run once to completion. When a task stops, it isn't executed again, but a new task may take its place. | ||||||
| it isn't executed again, but a new task may take its place. |  | ||||||
| 
 | 
 | ||||||
| Tasks advance through a number of states until they complete or fail. Tasks | Tasks advance through a number of states until they complete or fail. Tasks are initialized in the `NEW` state. The task progresses forward through a number of states, and its state doesn't go backward. For example, a task never goes from `COMPLETE` to `RUNNING`. | ||||||
| are initialized in the `NEW` state. The task progresses forward through a |  | ||||||
| number of states, and its state doesn't go backward. For example, a task never |  | ||||||
| goes from `COMPLETE` to `RUNNING`. |  | ||||||
| 
 | 
 | ||||||
| Tasks go through the states in the following order: | Tasks go through the states in the following order: | ||||||
| 
 | 
 | ||||||
|  | @ -40,21 +35,22 @@ Tasks go through the states in the following order: | ||||||
| | `SHUTDOWN`  | Docker requested the task to shut down.                                                                     | | | `SHUTDOWN`  | Docker requested the task to shut down.                                                                     | | ||||||
| | `REJECTED`  | The worker node rejected the task.                                                                          | | | `REJECTED`  | The worker node rejected the task.                                                                          | | ||||||
| | `ORPHANED`  | The node was down for too long.                                                                             | | | `ORPHANED`  | The node was down for too long.                                                                             | | ||||||
|  | | `REMOVE`    | The task is not terminal but the associated service was removed or scaled down.                             | | ||||||
| 
 | 
 | ||||||
| ## View task state | ## View task state | ||||||
| 
 | 
 | ||||||
| Run `docker service ps <service-name>` to get the state of a task. The | Run `docker service ps <service-name>` to get the state of a task. The | ||||||
| `CURRENT STATE` field shows the task's state and how long it's been  | `CURRENT STATE` field shows the task's state and how long it's been | ||||||
| there. | there. | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| $ docker service ps webserver | $ docker service ps webserver | ||||||
| ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR                              PORTS | ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR                              PORTS | ||||||
| owsz0yp6z375        webserver.1         nginx               UbuntuVM            Running             Running 44 seconds ago                                       | owsz0yp6z375        webserver.1         nginx               UbuntuVM            Running             Running 44 seconds ago | ||||||
| j91iahr8s74p         \_ webserver.1     nginx               UbuntuVM            Shutdown            Failed 50 seconds ago    "No such container: webserver.…"    | j91iahr8s74p         \_ webserver.1     nginx               UbuntuVM            Shutdown            Failed 50 seconds ago    "No such container: webserver.…" | ||||||
| 7dyaszg13mw2         \_ webserver.1     nginx               UbuntuVM            Shutdown            Failed 5 hours ago       "No such container: webserver.…"   | 7dyaszg13mw2         \_ webserver.1     nginx               UbuntuVM            Shutdown            Failed 5 hours ago       "No such container: webserver.…" | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ## Where to go next | ## Where to go next | ||||||
| 
 | 
 | ||||||
| - [Learn about swarm tasks](https://github.com/docker/swarmkit/blob/master/design/task_model.md) | - [Learn about swarm tasks](https://github.com/docker/swarmkit/blob/master/design/task_model.md) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue