我有一台 CentOS 7.x 机器,并且按照以下方法安装了 Docker本文安装后我尝试通过以下方式启动 Docker:
systemctl start docker
但出现此错误:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
执行
systemctl status docker.service
我得到:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sat 2019-03-09 14:09:57 EET; 2min 15s ago
Docs: https://docs.docker.com
Process: 17216 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 17216 (code=exited, status=1/FAILURE)
Mar 09 14:09:55 host systemd[1]: Failed to start Docker Application Container Engine.
Mar 09 14:09:55 host systemd[1]: Unit docker.service entered failed state.
Mar 09 14:09:55 host systemd[1]: docker.service failed.
Mar 09 14:09:57 host systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 09 14:09:58 host systemd[1]: start request repeated too quickly for docker.service
Mar 09 14:09:58 host systemd[1]: Failed to start Docker Application Container Engine.
Mar 09 14:09:58 host systemd[1]: Unit docker.service entered failed state.
Mar 09 14:09:58 host systemd[1]: docker.service failed.
输出journalctl -xe
为:
Mar 09 14:09:55 host systemd[1]: Unit docker.service entered failed state.
Mar 09 14:09:55 host systemd[1]: docker.service failed.
Mar 09 14:09:57 host systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 09 14:09:57 host systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun shutting down.
Mar 09 14:09:57 host systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun starting up.
Mar 09 14:09:58 host systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
Mar 09 14:09:58 host systemd[1]: start request repeated too quickly for docker.service
Mar 09 14:09:58 host systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Mar 09 14:09:58 host systemd[1]: Unit docker.service entered failed state.
Mar 09 14:09:58 host systemd[1]: docker.service failed.
Mar 09 14:10:22 host sshd[17227]: Connection closed by 211.192.203.145 [preauth]
Mar 09 14:10:37 host fail2ban.actions[1307]: NOTICE [sshd] Unban 118.172.229.184
Mar 09 14:10:40 host fail2ban.actions[1307]: NOTICE [sshd] Unban 209.141.59.249
Mar 09 14:11:28 host sshd[17238]: Invalid user team1 from 24.138.80.34
Mar 09 14:11:28 host sshd[17238]: input_userauth_request: invalid user team1 [preauth]
Mar 09 14:11:28 host sshd[17238]: pam_unix(sshd:auth): check pass; user unknown
Mar 09 14:11:28 host sshd[17238]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=24-138-80-34.nx.cgocable.ca
Mar 09 14:11:29 host fail2ban.filter[1307]: INFO [sshd] Found 24.138.80.34
Mar 09 14:11:29 host fail2ban.filter[1307]: WARNING Determined IP using DNS Lookup: 24-138-80-34.nx.cgocable.ca = ['24.138.80.34']
Mar 09 14:11:29 host fail2ban.filter[1307]: INFO [sshd] Found 24.138.80.34
Mar 09 14:11:29 host fail2ban.actions[1307]: NOTICE [sshd] Ban 24.138.80.34
Mar 09 14:11:31 host sshd[17238]: Failed password for invalid user team1 from 24.138.80.34 port 35452 ssh2
Mar 09 14:11:31 host fail2ban.filter[1307]: INFO [sshd] Found 24.138.80.34
Mar 09 14:12:06 host sshd[17244]: reverse mapping checking getaddrinfo for no.rdns.ukservers.com [94.46.185.14] failed - POSSIBLE BREAK-IN ATTEMPT!
Mar 09 14:12:06 host sshd[17244]: Invalid user danilo from 94.46.185.14
Mar 09 14:12:06 host sshd[17244]: input_userauth_request: invalid user danilo [preauth]
Mar 09 14:12:06 host sshd[17244]: pam_unix(sshd:auth): check pass; user unknown
Mar 09 14:12:06 host sshd[17244]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=94.46.185.14
Mar 09 14:12:06 host fail2ban.filter[1307]: INFO [sshd] Found 94.46.185.14
Mar 09 14:12:06 host fail2ban.filter[1307]: INFO [sshd] Found 94.46.185.14
Mar 09 14:12:07 host fail2ban.actions[1307]: NOTICE [sshd] Ban 94.46.185.14
Mar 09 14:12:08 host sshd[17244]: Failed password for invalid user danilo from 94.46.185.14 port 59372 ssh2
Mar 09 14:12:09 host fail2ban.filter[1307]: INFO [sshd] Found 94.46.185.14
Mar 09 14:12:26 host fail2ban.actions[1307]: NOTICE [sshd] Unban 92.222.181.159
Mar 09 14:12:35 host fail2ban.actions[1307]: NOTICE [sshd] Unban 103.230.243.192
sudo /usr/bin/dockerd -D -H fd://
`Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd`
执行“dockerd”命令后我也得到了它:
`FATA[2019-03-09T16:47:09.490831472+02:00] Your Linux kernel version 2.6.32-042stab134.8 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer.`
操作系统信息来自cat /etc/os-release
:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
内核版本uname -r
:
2.6.32-042stab134.8
答案1
您无法在 OpenVZ“虚拟机”上运行 Docker,因为它实际上不是虚拟机,而是(非常古老的)容器本身。
您将需要一个新的 VPS 提供商,它不使用 OpenVZ 或其商业版本 Virtuozzo。