gpt4 book ai didi

docker - docker 堆栈部署中的 "starting container failed: su…"

转载 作者:行者123 更新时间:2023-12-02 18:39:35 27 4
gpt4 key购买 nike

目前我在 docker swarm 工作,
我在裸机服务器上使用 docker swarm 制作了 2 个节点集群。
我试图在每个节点中运行单个容器,并且它们正在运行。但是当我编写 docker-compose.yml 文件来运行副本时。它给出了错误,我的 docker-compose.yml 在这儿。

version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: brainplow/shopnroar:latest
deploy:
replicas: 2
restart_policy:
condition: on-failure
resources:
limits:
cpus: "0.1"
memory: 50M
ports:
- "8000:8080"
networks:
- webnet


web-dhaar:
# replace username/repo:tag with your name and image details
image: brainplow/dhaar:latest
deploy:
replicas: 2
restart_policy:
condition: on-failure
resources:
limits:
cpus: "0.1"
memory: 50M
ports:
- "9090:9090"
networks:
- webnet


visualizer:
image: dockersamples/visualizer:stable
ports:
- "8010:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
networks:
- webnet
redis:
image: redis
ports:
- "6379:6379"
volumes:
- /home/docker/data:/data
deploy:
placement:
constraints: [node.role == manager]
command: redis-server --appendonly yes
networks:
- webnet
networks:
webnet:

当我运行 docker service ls它给出以下,
ID                  NAME                       MODE                REPLICAS            IMAGE                             PORTS
h6irzq0swdat getstartedlab_redis replicated 0/1 redis:latest *:6379->6379/tcp
tuchpcxd159x getstartedlab_visualizer replicated 0/1 dockersamples/visualizer:stable *:8010->8080/tcp
mt5jxxfty0om getstartedlab_web replicated 0/2 brainplow/shopnroar:latest *:8000->8080/tcp
igz1ceqtawkk getstartedlab_web-dhaar replicated 0/2 brainplow/dhaar:latest *:9090->9090/tcp
hdya9obuk7ok redis replicated 0/5 myservice:latest

当我运行 docker service ps igz1ceqtawkk

它给了我这个错误,
zg7ostkj1ycn         \_ redis.4         myservice:latest    Masternode          Shutdown            Rejected 4 minutes ago        "No such image: myservice:late…"   
xxscungxgmbv \_ redis.4 myservice:latest Slavenode Shutdown Rejected 4 minutes ago "No such image: myservice:late…"
6i5qq5msn6ig redis.5 myservice:latest Masternode Ready Rejected 2 seconds ago "No such image: myservice:late…"
zsvxwm9nsjj6 \_ redis.5 myservice:latest Masternode Shutdown Rejected 32 seconds ago "No such image: myservice:late…"
yshbkh62eb7x \_ redis.5 myservice:latest Slavenode Shutdown Rejected about a minute ago "No such image: myservice:late…"
zat104nz0evk \_ redis.5 myservice:latest Slavenode Shutdown Rejected 3 minutes ago "No such image: myservice:late…"
zd4rcb9eeqbb \_ redis.5 myservice:latest Slavenode Shutdown Rejected 3 minutes ago "No such image: myservice:late…"

有时这个
zy72uf810mka         \_ getstartedlab_web.5   brainplow/shopnroar:latest   Masternode          Shutdown            Failed 21 minutes ago      "starting container failed: su…"   
zzpe0lwoe7cd \_ getstartedlab_web.5 brainplow/shopnroar:latest Masternode Shutdown Failed 30 minutes ago "starting container failed: su…"
zt3eu0jb2uou \_ getstartedlab_web.5 brainplow/shopnroar:latest Slavenode Shutdown Failed 41 minutes ago "starting container failed: su…"
zxesxvq2vumv \_ getstartedlab_web.5 brainplow/shopnroar:latest Masternode Shutdown Failed 2 hours ago "starting container failed: su…"

谁能告诉我为什么会这样。

这是我的 docker info
Containers: 2430
Running: 0
Paused: 0
Stopped: 2430
Images: 5
Server Version: 17.09.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
NodeID: wf9o88zy9w4xek011esw9oaa5
Is Manager: true
ClusterID: at6z6315v8d8zs43u1u3dqqca
Managers: 1
Nodes: 2
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 158.69.23.109
Manager Addresses:
158.69.23.109:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.33-mod-std-ipv6-64
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.04GiB
Name: Masternode
ID: 3GY6:RP6D:W3SU:FAJV:ZOJP:THFX:TYDF:UZKB:3FJN:WJKC:I23H:MBHO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: brainplow
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support


docker node ls

ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
wf9o88zy9w4xek011esw9oaa5 * Masternode Ready Active Leader
n3n38nos3kzcq4g4gl8l0s48c Slavenode Ready Active

谁能告诉我为什么我的容器没有在服务中运行。我坚持下去了。

和我的 docker version
Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:42:18 2017
OS/Arch: linux/amd64

Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:40:56 2017
OS/Arch: linux/amd64
Experimental: false

提前致谢。在这方面真的需要帮助。

最佳答案

现在问题解决了。这是由于内核版本。我正在研究裸机云,并在其上安装了 Ubuntu 16.04。但我忘了安装这个版本附带的内核。

用自己的内核重新安装Ubuntu后,问题就解决了。

关于docker - docker 堆栈部署中的 "starting container failed: su…",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46712302/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com