Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos7.3 docker compose network cannot connect, After you restart docker, it's normal #5106

Closed
ss75710541 opened this issue Aug 16, 2017 · 4 comments

Comments

@ss75710541
Copy link

system version:

# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)

docker info

Containers: 26
 Running: 24
 Paused: 0
 Stopped: 2
Images: 22
Server Version: 17.03.2-ce
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.702 GiB
Name: srymaster1
ID: JCWM:T3P3:4OUX:LFSX:ZSSD:NXKQ:BMDF:GJAZ:TI24:X3DC:VFQR:PTZH
Docker Root Dir: /data/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Cluster Store: consul://192.168.1.241:8500
Insecure Registries:
 192.168.1.241
 127.0.0.0/8
Live Restore Enabled: false

docker-compose.yml

docker image offlineregistry.dataman-inc.com:5000/library/centos7-base is centos7.2

version: '2'
services:
  centosa:
    image: offlineregistry.dataman-inc.com:5000/library/centos7-base:latest
    container_name: centos-base-testa
    restart: always
    command: "tail -f /var/log/yum.log"
    depends_on:
      - centosb
    logging:
      driver: journald

  centosb:
    image: offlineregistry.dataman-inc.com:5000/library/centos7-base:latest
    container_name: centos-base-testb
    restart: always
    command: "tail -f /var/log/yum.log"
    logging:
      driver: journald
docker-compose up -d
# docker exec -it centos-base-testa bash
[root@584d59bb7be9 /]# ping centosb
ping: unknown host centosb
@ss75710541
Copy link
Author

This problem occurs only when docker does not reboot for the first time

@ss75710541
Copy link
Author

ss75710541 commented Aug 16, 2017

restart docker daemon , it's normal

[root@srymaster1 test_centos]# service docker restart
Redirecting to /bin/systemctl restart  docker.service
[root@srymaster1 test_centos]# docker exec -it centos-base-testa bash
[root@584d59bb7be9 /]# ping centosb
PING centosb (172.22.0.3) 56(84) bytes of data.
64 bytes from centos-base-testb.testcentos_default (172.22.0.3): icmp_seq=1 ttl=64 time=0.161 ms
64 bytes from centos-base-testb.testcentos_default (172.22.0.3): icmp_seq=2 ttl=64 time=0.118 ms
64 bytes from centos-base-testb.testcentos_default (172.22.0.3): icmp_seq=3 ttl=64 time=0.112 ms

@ss75710541
Copy link
Author

After revising the journald and restarting journald, this problem arises

/etc/systemd/journald.conf

[Journal]
Storage=auto
Compress=yes
MaxFileSec=1day
MaxRetentionSec=1week

@shin-
Copy link

shin- commented Aug 16, 2017

Can you report this on https://github.com/moby/moby ? I'm inclined to believe this issue is not caused by Compose but happens at the engine level instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants