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

send SIGHUP to docker daemon after change daemon.json , docker network doesn't reload correctly #1264

Closed
wangweihong opened this issue Jun 15, 2016 · 5 comments

Comments

@wangweihong
Copy link

environment:
Linux bogon 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
docker Version:
1.11.2

  1. I started a etcd server on my node1(192.168.14.130).and create /etc/docker/daemon.json in node2 like this:
    {
    "cluster-advertise": "192.168.14.87:2375",
    "cluster-store": "etcd://192.168.14.130:2379"
    }
    node2 is fresh, it didn't configure docker cluster configuration before.
  2. Run " kill -SIGHUP pidof docker", docker info command get right infos:
    [root@bogon ~]# docker info
    ...
    Labels:
    com.example.environment="production"
    Cluster store: etcd://192.168.14.130:2379
    Cluster advertise: 192.168.14.87:2375
  3. see what docker netowork ls shows
    [root@bogon ~]# docker network ls
    NETWORK ID NAME DRIVER
    fc1fa519d860 bridge bridge
    a34729eddc3e bridge10 overlay
    63795cfb1874 bridge11 overlay
    c8f6150341f0 bridge2 overlay
    c8f6150341f0 bridge2 overlay
    f7caa25698eb bridge5 overlay
    e21e3206baff bridge6 overlay
    4bfd9837011f bridge7 overlay
    d83655b1d8dc bridge9 overlay
    71f7ce2a1f59 host host
    864d033a3a1d isolated_Network overlay
    394cbced64d6 none null
    f44205d44b1b test1 overlay
    fe691a8573c8 test2 overlay
  4. modify daemon.json ,change cluster-store
    {
    "cluster-advertise": "192.168.14.87:2375",
    "cluster-store": "etcd://192.168.14.130:2379**/test3**"
    }

5.run setp 2, 3 again
[root@bogon ~]# kill -SIGHUP pidof docker
[root@bogon ~]# docker info
...
Labels:
com.example.environment="production"
Cluster store: etcd://192.168.14.130:2379/test3
Cluster advertise: 192.168.14.87:2375

[root@bogon ~]# docker network ls
NETWORK ID NAME DRIVER
fc1fa519d860 bridge bridge
a34729eddc3e bridge10 overlay
63795cfb1874 bridge11 overlay
c8f6150341f0 bridge2 overlay

docker network ls show infos stored in etcd://192.168.14.130:2379 instead of etcd://192.168.14.130:2379/test3

  1. docker network ls show correct infos after restart docker daemon
    [root@bogon ~]# systemctl restart docker
    [root@bogon ~]# docker network ls
    NETWORK ID NAME DRIVER
    fd8072220683 bridge bridge
    082f0f6947bd bridge3 overlay
    958c9f00d0e5 bridge4 overlay
    9f380b2f9829 bridge5 overlay
    bce851833ab5 docker_gwbridge bridge
    cc1c38e19959 host host
    b1f56b75853a network 1 overlay
    4d52f6e74d73 network 2 overlay
    4f74db38d8f2 network 3 overlay
    841cce023697 network 4 overlay
    182a7c53433d none null

Is this a bug?

@aboch
Copy link
Contributor

aboch commented Jun 15, 2016

See https://github.com/docker/libnetwork/blob/master/drivers/overlay/overlay.go#L292

Initial requirement was to only accept a datastore config if one was not already present.

@wangweihong
Copy link
Author

@aboch so you mean, if I want to change a datastore config, I can't send SIGHUP to docker daemon to make it works, because it still hold the last datastore config.

@aboch
Copy link
Contributor

aboch commented Jun 15, 2016

yeah, libnetwork drivers will discard a new datastore config (received via SIGHUP daemon reload) if they already have a global scope datastore configured

@wangweihong
Copy link
Author

@aboch Will it support reconfigure already configured datestore config without requiring to restart docker daemon in the future?
I think restart docker daemon to reconfigure is not a good experience.
Suppose situation like this: departmentA and departmentB both has 100 nodes. They have different datastore config . if I want to join 50 nodes in departmentA to departmentB . I have to change these nodes' datestore config, and restart their docker daemon one by one.What i am worry is directly restart docker daemon usually corrupt containers in it.

@aboch
Copy link
Contributor

aboch commented Oct 11, 2016

@wangweihong It is not on the plans at the moment.

Will go ahead and close this issue, as what can be done with SIGHUP was clarified.

@aboch aboch closed this as completed Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants