找回密码
 注册
查看: 808|回复: 1

记一次docker启动失败问题总结Cannot connect to the Docker daemon at unix:/var/run/docker.soc

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-6-22 11:51:13 | 显示全部楼层 |阅读模式
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.688767002+08:00" level=info msg="Starting up"7 E  p) g* N+ ]* Z$ `
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.691966214+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc
7 i7 W2 I( g# W% W9 c) Y( N- _$ B" IJun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.692007875+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
% N: g2 K: x7 C) h3 G- ]# q  N6 [5 G( VJun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.692053506+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
7 R8 z+ p4 U# \; i2 f5 @% N, KJun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.692095723+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc  {# {) C8 I4 V! ^# A+ O% t
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.694155125+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc- x$ T( a1 L' E' Y0 r
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.694200596+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
4 K8 X) Z  |& _* M* X) _3 z" iJun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.694221675+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc/ O9 K( P+ R+ c8 W# T; u
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.694237395+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
9 Y2 o( s2 F) {& L4 u4 pJun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.782587671+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2"- v1 f# H. O% ~- ?  X1 ^, |- [; F  e
Jun 22 11:15:38 openstack dockerd: time="2022-06-22T11:15:38.923229051+08:00" level=info msg="Loading containers: start."2 V* S& n2 S: k- a; F, P- c- [# A
Jun 22 11:15:41 openstack dockerd: time="2022-06-22T11:15:41.746420451+08:00" level=error msg="ecd807d55b2549900134475d67ba42c6f692c0d2db9058c5acc43c5d1a3651fb cleanup: failed to delete container from containerd: no such container", Y# D# h# w- ], m
$ b  @# y; J2 F0 k# `! |
% y' Z; Y( _& }( }, i; i
1、Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
答:
docker这种报错一般情况都是docker未启动对于这种情况只用重启docker就行了:
service docker restart  
还有一种情况则是docker配置文件出错按照提示查看报错,并找到相应位置进行更改:
systemctl status docker.service   或    journalctl -xn
1 l  {( |  [5 I' m4 h1 |4 x

" t9 ^, U9 S( K/ ^& m! O
% n* e9 ~: r; b7 t. l% d) w
( O% s2 P$ p1 y: b$ ^3 M. `# [

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-22 12:44:35 | 显示全部楼层
解决过程:
' _# N/ `8 Z' c. R2 ?# r- l5 n9 l2 k编辑文件:+ a1 d( Z7 O! d6 ]0 M5 o6 O$ |
[root@openstack ~]# vim /etc/docker/daemon.json
5 o" i3 `/ z7 K+ r: f
- a$ x/ b: B" B! ]1 M0 }3 R2 Z1 L{
4 q& m3 _: i( C* N* @     "bip": "150.17.10.1/16"7 T1 j& I. s9 y' X( h, J
}% @' a, d: ~/ p" s/ p
4 h8 d* ~1 J# n; D2 S$ D
[root@openstack ~]# vim /etc/systemd/system/docker.service.d/kolla.conf
. V' M, L) Q# X& y+ X
' i% o3 v# K# y[Service]
( f" }, p- ?2 E! RMountFlags=shared
$ f: b0 E- L" s& X- A. X# cExecStart=! q# h7 C7 ~' J8 r
ExecStart=/usr/bin/dockerd --insecure-registry xx.xx.xx.xx:4000 --log-opt max-file=5 --log-opt max-size=50m
" j! D# J8 Y' r" S, @( M; I) w/ a5 x) B/ B- X% y; B% T
系统重新reload
! O2 @6 r+ l% z( m1 u% u2 ^/ {3 \systemctl daemon-reload
& t0 b1 G7 D& E7 b3 u  x重启docker服务:5 o9 }& t' u  M1 f! U
systemctl restart docker.service : W+ Y7 S8 }- e' }6 C! `' `. X
检查:
7 g; d8 ]0 j& L( b+ M[root@openstack ~]# docker ps  / B, \2 i5 ^) R. g8 ?
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED             STATUS                         PORTS     NAMES
3 O! r/ v1 N* t7 S% b7 @% q
8 |) ?7 ?+ M/ m5 j) z2 \
. R9 K& ^' p6 j: R+ \[root@openstack ~]#  docker info 2 {& k9 J- t# `/ x
Client:
+ t1 t8 m' m! D) y7 A+ e Context:    default6 J( o/ A- `. |, O) k
Debug Mode: false
; h! a  e6 S! X. M  a Plugins:
# O1 u0 C$ A) S9 g5 x, w7 x  app: Docker App (Docker Inc., v0.9.1-beta3)
  w5 b8 s7 o+ S1 @  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
- N5 W4 k) H$ n& o4 R9 b1 z6 `  scan: Docker Scan (Docker Inc., v0.17.0)$ @" a$ r; x) x/ p1 N8 i; c

) s9 Q2 z0 `$ C% S, A4 VServer:; c* e; h  s( _2 L! b
Containers: 31- L( ^3 b' t: o% h0 v# G) ^
  Running: 30
$ E) E4 N7 s; u4 v: h) b  Paused: 0
3 A) G5 e2 b: P( d8 c5 I5 r- J6 G  Stopped: 1
" S, \1 }9 o9 q" d, W2 b' K' X Images: 31
! b+ U# G7 Z) [ Server Version: 20.10.17
$ d  P: D/ ~2 |4 v4 n. k2 s" E+ U Storage Driver: overlay2
$ b- c$ B  S/ K4 ]$ y  y; \  Backing Filesystem: xfs
9 t: Y. ~* _& H+ B7 R" E  Supports d_type: true9 H$ `6 l2 j! P/ ^9 t( S- @3 J
  Native Overlay Diff: true
6 X  L' J) X, Y( I  userxattr: false
) _9 K( ?2 m) ^, p# Y0 k5 I Logging Driver: json-file0 W+ p! `0 t' ~" n, P* x3 E2 U5 J
Cgroup Driver: cgroupfs; _, U+ O0 B" @) ^' H5 I7 V
Cgroup Version: 1
7 q' ^; z& E% s( U Plugins:
8 }+ r# x7 }# m9 J6 b+ F; A' B! G  Volume: local
# F# a: Y2 j9 {! W: v4 `9 [  Network: bridge host ipvlan macvlan null overlay
0 k9 c- T! c" x* M) S# i  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
) T+ b9 A; j/ r' W5 A Swarm: inactive
. @. j* Z' ^7 w- D% @4 ] Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
  M0 x4 E. _2 s0 h$ p( G Default Runtime: runc
0 j& p- Y! [" `8 H, ]4 i Init Binary: docker-init
7 ]# v4 n5 w* E. f9 x) c containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae13 J4 K$ C' e* v, O4 [
runc version: v1.1.2-0-ga916309
" G# {' O% ^6 _( j. Q/ q8 _ init version: de40ad06 `, f$ z1 E# |2 i$ {
Security Options:, d" [+ o% P. E( y
  seccomp
% f3 U" Y  O' O$ Z+ a- K: }" ]) K   Profile: default
8 Z( n  `" w/ ~. D" Z& |+ U Kernel Version: 3.10.0-1160.el7.x86_64
* g' B1 f& s/ i; d' G; \ Operating System: CentOS Linux 7 (Core)) |; S# t7 R' p3 _# ?. Z
OSType: linux
# U+ x; V& @# p9 y Architecture: x86_64
, n% p) x' j( A* t8 i CPUs: 16
) s# d; F9 M7 G) T2 t7 E: A( a0 t Total Memory: 15.51GiB
: l' ?" k' v! i  w; v: | Name: openstack.novalocal
# y; x" p' Z! T" [8 s7 ~$ Y ID: IL2Z:QYIC:CVO4:DKSU:RAVA:ONC2:ZSBT:JLHA:FBWV:JY7W:E7SS:W7AA7 t7 R/ l/ l$ {2 R* G3 A1 u
Docker Root Dir: /var/lib/docker
0 J8 H  `6 g2 `% |+ R' `2 v/ j; m Debug Mode: false
* m/ Z. n- W$ b# F; |( D! c% z Registry: https://index.docker.io/v1/; E& i% @5 Z3 n4 p
Labels:% ^  v  {0 `; s( i( I. P4 e
Experimental: false2 H5 P/ N0 L% U% a8 e
Insecure Registries:
0 E/ c8 O+ R4 K  192.168.0.75:4000
$ z: L- B- D" S6 `2 i9 H  k8 s  127.0.0.0/8
9 b1 u7 P. u0 E Live Restore Enabled: false
3 Q( }& M6 A: p6 ^, o) l2 J# I' D% V1 {9 V* m1 Z, i7 U1 s+ R
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:22 , Processed in 0.016429 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表