docker-compose启动报错

报错消息如下:

[root@localhost mychaincode]# docker-compose down
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
[root@localhost mychaincode]# docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
[root@localhost mychaincode]# pwd
 

问题原因:

docker-compose 是docker的管理控件,因此它的运行依赖于docker进程的运行,因此先要去检查docker进程是否已经正常启动。

[root@localhost mychaincode]# ps aux |grep docker
root      6723  0.0  0.0 112720   980 pts/2    R+   13:22   0:00 grep --color=auto docker
 

[root@localhost mychaincode]# service docker status
Redirecting to /bin/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

7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.259523190+08:00" level=info msg="Processing signal 'terminated'"
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.265154032+08:00" level=info msg="stopping healthcheck following gr...ntainerd
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.265222697+08:00" level=info msg="stopping event stream following g...ins.moby
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.265252803+08:00" level=info msg="stopping event stream following g...ace=moby
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28+08:00" level=info msg="Stop CRI service"
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.267148341+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.267174075+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.267252895+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:34:28 localhost.localdomain dockerd[6740]: time="2018-07-22T13:34:28.267265815+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:34:29 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
 

可见当前docker并未运行,需要启动他

[root@localhost mychaincode]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost mychaincode]# service docker status
Redirecting to /bin/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 日 2018-07-22 13:35:08 CST; 4s ago
     Docs: https://docs.docker.com
 Main PID: 7294 (dockerd)
    Tasks: 20
   Memory: 45.2M
   CGroup: /system.slice/docker.service
           ├─7294 /usr/bin/dockerd
           └─7300 docker-containerd --config /var/run/docker/containerd/containerd.toml

7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.255752453+08:00" level=info msg="ClientConn switching balancer to ...ule=grpc
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.255797634+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.255993038+08:00" level=info msg="pickfirstBalancer: HandleSubConnS...ule=grpc
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.256010582+08:00" level=info msg="Loading containers: start."
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.751837319+08:00" level=info msg="Default bridge (docker0) is assig...address"
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.944446766+08:00" level=info msg="Loading containers: done."
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.957431564+08:00" level=info msg="Docker daemon" commit=0ffa825 gra....06.0-ce
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.957920530+08:00" level=info msg="Daemon has completed initialization"
7月 22 13:35:08 localhost.localdomain dockerd[7294]: time="2018-07-22T13:35:08.966841953+08:00" level=info msg="API listen on /var/run/docker.sock"
7月 22 13:35:08 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost mychaincode]#
 

然后再启动docker-composer up就正常了

/home/wjs/mychaincode
[root@localhost mychaincode]# docker-compose up
Starting mychaincode_membersrvc_1 ...
Starting mychaincode_membersrvc_1 ... done
Starting mychaincode_vp0_1 ...
Starting mychaincode_vp0_1 ... done
Attaching to mychaincode_membersrvc_1, mychaincode_vp0_1
 

你可能感兴趣的:(docker-compose启动报错)