ID NAME REPLICAS IMAGE COMMAND
bdkwsgchcydz time-php 4/4 registry.cntv.net/heqin/tvtime-php:v0.85dongsi
$docker service ps time-php #查看服务的实例
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
d15ambrdd7pyi22951vi497xa time-php.1 registry.cntv.net/heqin/tvtime-php:v0.85dongsi swarm4 Running Running 5 minutes ago
3wtmmggo65cmyutg7zwikb94s time-php.2 registry.cntv.net/heqin/tvtime-php:v0.85dongsi swarm3 Running Running 5 minutes ago
5ulbhndwgswpicx8g62af8k5z time-php.3 registry.cntv.net/heqin/tvtime-php:v0.85dongsi swarm2 Running Running 5 minutes ago
4b9rh8aiwfi88xrdgmyss9ili time-php.4 registry.cntv.net/heqin/tvtime-php:v0.85dongsi swarm2 Running Running 5 minutes ago
$docker service inspect time-php #查看服务的详细信息
[
{
"ID": "bdkwsgchcydz5ixatrbiyr1fx",
"Version": {
"Index": 3074
},
"CreatedAt": "2016-08-31T01:41:18.892483521Z",
"UpdatedAt": "2016-08-31T01:41:18.909164422Z",
"Spec": {
"Name": "time-php",
"TaskTemplate": {
"ContainerSpec": {
"Image": "registry.cntv.net/heqin/tvtime-php:v0.85dongsi"
},
"Resources": {
"Limits": {},
"Reservations": {}
},
"RestartPolicy": {
"Condition": "any",
"MaxAttempts": 0
},
"Placement": {}
},
"Mode": {
"Replicated": {
"Replicas": 4
}
},
"UpdateConfig": {
"Parallelism": 1,
"FailureAction": "pause"
},
"Networks": [
{
"Target": "d83qc9rgkkj1ws8kvmod4x759"
}
],
"EndpointSpec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 80,
"PublishedPort": 8099
}
]
}
},
"Endpoint": {
"Spec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 80,
"PublishedPort": 8099
}
]
},
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 80,
"PublishedPort": 8099
}
],
"VirtualIPs": [
{
"NetworkID": "biu7m9hi8fgbbihfzg48whxqi",
"Addr": "10.255.0.19/16"
},
{
"NetworkID": "d83qc9rgkkj1ws8kvmod4x759",
"Addr": "10.88.0.2/24"
}
]
},
"UpdateStatus": {
"StartedAt": "0001-01-01T00:00:00Z",
"CompletedAt": "0001-01-01T00:00:00Z"
}
}
]
(3)扩展服务实例数
$ docker service scale time-php=10
time-php scaled to 10
$ docker service ls