key-networks / ztncui

ZeroTier network controller UI
GNU General Public License v3.0
1.56k stars 230 forks source link

Move controller to another server #13

Closed saifulmr closed 5 years ago

saifulmr commented 6 years ago

Hi, I am testing ztncui in a small development environment.

I have currently ztncui running from docker. It has only port 3443 exposed and works fine as expected.

Lets say our ztncui is runnning on Server1 on https://aaa.aaa.aaa.aaa:3443

Now I am testing to copy the same docker image to another server. Please know my image already have some networks and clients created, and they can communicate between each other.

Server 2. Copied docker image is running on https://bbb.bbb.bbb.bbb:3443

If I take server1 down, and try to create a join a new client, I don't see the request coming to server2.

How can I make the server2 to act as the same network controller as server1.

Thanks & Best Regards, Saiful Alam

key-networks commented 5 years ago

@saifulmr please accept my apologies for taking so long to address this request.

To copy from one docker host to another, it is best to use volumes - please see https://github.com/key-networks/ztncui-containerized#persist-data-in-volumes on how to do this.

Then, to copy volumes from one host to another, first stop the docker container on host aaa.

Then copy the volumes across from aaa to bbb by executing this on aaa: docker run --rm -v ztncui:/from alpine ash -c "cd /from ; tar -cf - . " | ssh user@bbb.bbb.bbb.bbb 'docker run --rm -i -v ztncui:/to alpine ash -c "cd /to ; tar -xpvf - " ' and: docker run --rm -v zt1:/from alpine ash -c "cd /from ; tar -cf - . " | ssh user@bbb.bbb.bbb.bbb 'docker run --rm -i -v zt1:/to alpine ash -c "cd /to ; tar -xpvf - " '

Points to note:

Please let me know if this works for you.

Thanks Steve