操作系统:centos 7.2
docker 版本:18.06.1-ce
安装过程参考:
https://help.aliyun.com/document_detail/60742.html?spm=5176.11065259.1996646101.searchclickresult.4a2d3ab1UgWllw
先把报错贴出来。先声明,原理没搞懂,是百度出来的把问题解决了。。。
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PolicyKit1 timed out (g-dbus-error-quark, 20)
Failed to restart docker.service: Connection timed out
See system logs and 'systemctl status docker.service' for details.
解决这个问题主要是重装 polkit,然后重启。
yum reinstall polkit
reboot
重启后
systemctl status docker.service
然后提示
Error getting authority: Error initializing authority: Could not connect: Connection refused (g-io-error-quark, 39)
[root@iZ23qd40v95Z microservice]# docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:23:03 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:25:29 2018
OS/Arch: linux/amd64
Experimental: false
(期间由重装了docker,但是感觉跟这个没关系)
然后
# mv -f /var/run /var/run.runmove~
# ln -sfn /run /var/run
# mv -f /var/lock /var/lock.lockmove~
# ln -sfn /run/lock /var/lock
参考https://access.redhat.com/solutions/3522441
又重启了一下。。。。
reboot
systemctl start docker.service
好了。。
-----------------------------------------------实录--------------------------------------------------------------
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PolicyKit1 timed out (g-dbus-error-quark, 20)
Failed to restart docker.service: Connection timed out
See system logs and 'systemctl status docker.service' for details.
[root@xxxxxxxxxxxxx docker]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
[root@xxxxxxxxxxxxx docker]#
yum reinstall polkit
Error getting authority: Error initializing authority: Could not connect: Connection refused (g-io-error-quark, 39)
reboot
[root@xxxxxxxxxxxxx microservice]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2018-09-30 09:36:38 CST; 27s ago
Docs: https://docs.docker.com
Main PID: 3183 (dockerd)
Tasks: 22
Memory: 43.3M
CGroup: /system.slice/docker.service
├─3183 /usr/bin/dockerd
└─3190 docker-containerd --config /var/run/docker/containerd/containerd.toml
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.666360149+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4...dule=grpc
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.666595694+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4...dule=grpc
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.666625205+08:00" level=info msg="Loading containers: start."
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.781330769+08:00" level=info msg="Default bridge (docker0) is assigned with an IP a... address"
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.822556492+08:00" level=info msg="Loading containers: done."
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.840399995+08:00" level=info msg="Docker daemon" commit=e68fc7a graphdriver(s)=over...8.06.1-ce
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.840477593+08:00" level=info msg="Daemon has completed initialization"
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.843374677+08:00" level=warning msg="Could not register builder git source: failed ...in $PATH"
Sep 30 09:36:38 xxxxxxxxxxxxx dockerd[3183]: time="2018-09-30T09:36:38.852250928+08:00" level=info msg="API listen on /var/run/docker.sock"
Sep 30 09:36:38 xxxxxxxxxxxxx systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@xxxxxxxxxxxxx microservice]# systemctl start docker.service
Error getting authority: Error initializing authority: Could not connect: Connection refused (g-io-error-quark, 39)
[root@xxxxxxxxxxxxx microservice]# docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:23:03 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:25:29 2018
OS/Arch: linux/amd64
Experimental: false
# mv -f /var/run /var/run.runmove~
# ln -sfn /run /var/run
# mv -f /var/lock /var/lock.lockmove~
# ln -sfn /run/lock /var/lock
参考:https://access.redhat.com/solutions/3522441
reboot
[root@xxxxxxxxxxxxx microservice]# systemctl start docker.service