Giter Club home page Giter Club logo

docker_volume_synchronizator's People

Contributors

fabrizio2210 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

boredazfcuk

docker_volume_synchronizator's Issues

Use the endpoint /events to poll containers

Instead of issuing the command "docker service ps .." command in order to check if some variation occurred, it should be used the endpoint /events exposed by the unix socket.
This approach will reduce a lot the CPU consumed.
In first attempt, /events can be used just to see if some changes occurred and then use the same command as before to verify if interesting changes occurred.
After a better approach can be use, filtering on which events are interesting.

Error: Service to sync not found

Hi,

I've tried running this Docker service (https://hub.docker.com/r/fabrizio2210/docker_volume_synchronizer) as I want to sync two data volumes, but ran into and error. In the logs I can see:

++ service=core_sync_squid
++ '[' -z core_sync_squid ']'
+++ findValueByLabel core_sync_squid async.service
+++ _my_service=core_sync_squid
+++ _label=async.service
++++ docker service ls --format '{{print .Name}}'
+++ for _service in $(docker service ls --format '{{print .Name}}')
+++ '[' core_sync_squid == core_squid ']'
+++ for _service in $(docker service ls --format '{{print .Name}}')
+++ '[' core_sync_squid == core_sync_squid ']'
+++ docker service inspect core_sync_squid '--format={{ index .Spec.Labels "async.service"}}'
+ set +x
+++ return
++ serviceToSync=
++ '[' -z '' ']'
++ echo 'Service to sync not found'
Service to sync not found
++ exit 2
cat: '/var/run/*.pid': No such file or directory

If I run this command from the command prompt:

docker service inspect core_sync_squid '--format={{ index .Spec.Labels "async.service"}}'

I get no results, which I would expect to see as it replicates the log. However, if I run:

docker service inspect core_sync_squid  --format="{{ index .Spec.TaskTemplate.ContainerSpec.Labels \"async.service\" }}"

then it returns :

squid

which is what I think the script is expecting to see. So, I think that there may be an error on line 253, of src/lib.sh could be incorrect.

I've tried changing this, and building the docker container locally, but a native build on ARM hardware fails at RUN [ "cross-build-start" ] with an exec error, so presumably this is incorrect architecture.

If I run the build on my amd64 hardware, it compiles successfully, but I get the same exec error when the node is deployed to the ARM hardware I'm running it on.

Any help would be greatly appreciated.

Filter just own changes in http://localhost/events

The watchdog is identifying changes although they are not related to the service.
The problem is that other services are triggering events and the watchdog doesn't filter by name of the service.

For example the following event is triggering the watchdog

{"status":"exec_die","id":"cc928e18ce819b5222464bc70e73c6d9f31e8c6bf0ff9b9a2cdfb72c95a140d5","from":"fabrizio2210/zabbix-server-mysql-alpine:armhf","Type":"container","Action":"exec_die","Actor":{"ID":"cc928e18ce819b5222464bc70e73c6d9f31e8c6bf0ff9b9a2cdfb72c95a140d5","Attributes":{"com.docker.stack.namespace":"Zabbix","com.docker.swarm.node.id":"bjjftibfnf5w38400ub4b1k3g","com.docker.swarm.service.id":"p6v8m5qcwpmqr2bdrh5lx0zj3","com.docker.swarm.service.name":"Zabbix_zabbix-server","com.docker.swarm.task":"","com.docker.swarm.task.id":"q17kmb507ddoxqulpf28xefyw","com.docker.swarm.task.name":"Zabbix_zabbix-server.1.q17kmb507ddoxqulpf28xefyw","com.zabbix.company":"Zabbix SIA","com.zabbix.component":"zabbix-server","com.zabbix.dbtype":"mysql","com.zabbix.description":"Zabbix server with MySQL database support","com.zabbix.os":"alpine","execID":"3a866dc33edeb6a403b2e67ed7f2181688863794183105f373e52403f41eb0ec","exitCode":"0","image":"fabrizio2210/zabbix-server-mysql-alpine:armhf","io.balena.architecture":"rpi","io.balena.device-type":"raspberry-pi","io.balena.qemu.version":"4.0.0+balena-arm","maintainer":"Alexey Pustovalov \[email protected]\u003e","name":"Zabbix_zabbix-server.1.q17kmb507ddoxqulpf28xefyw","org.label-schema.build-date":"","org.label-schema.description":"Zabbix server with MySQL database support","org.label-schema.docker.cmd":"docker run --name zabbix-server-mysql --link mysql-server:mysql -p 10051:10051 -d zabbix-server-mysql:alpine-4.2.5","org.label-schema.license":"GPL v2.0","org.label-schema.name":"zabbix-server-mysql-alpine","org.label-schema.schema-version":"1.0","org.label-schema.url":"https://zabbix.com/","org.label-schema.usage":"https://www.zabbix.com/documentation/4.2/manual/installation/containers","org.label-schema.vcs-ref":"","org.label-schema.vcs-url":"https://git.zabbix.com/scm/zbx/zabbix.git","org.label-schema.vendor":"Zabbix LLC","org.label-schema.version":"4.2.5"}},"scope":"local","time":1601755506,"timeNano":1601755506720369721}

The file to change is https://github.com/fabrizio2210/Docker_Volume_Synchronizator/blob/master/src/wd_conf.sh
in line 61

sync without swarm

Hello,
thank-you for your work.

can I help you to make a version for use without swarm and just for syncronise two folders via docker.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.