GithubHelp home page GithubHelp logo

raf1hh / bucardo_docker_image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pelgrim/bucardo_docker_image

0.0 1.0 0.0 22 KB

Ubuntu-based Bucardo image for Docker Containers

License: Apache License 2.0

Shell 100.00%

bucardo_docker_image's Introduction

Bucardo

Ubuntu-based Bucardo image for Docker Containers.

Contents


How to use it (plain-text passwords)

  1. Create a folder;

  2. Create a "bucardo.json" inside this folder;

  3. Fill the "bucardo.json" file following this example:

// bucardo.json

{
  "databases":[
    {
      "id": 3,
      "dbname": "example_db",
      "host": "host0.example.com",
      "user": "example_user",
      "pass": "secret"
    },{
      "id": 1,
      "dbname": "example_db",
      "host": "host1.example.com",
      "user": "example_user",
      "pass": "secret"
    },{
      "id": 2,
      "dbname": "example_db",
      "host": "host3.example.com",
      "user": "example_user",
      "pass": "secret"
    }],
  "syncs" : [
    {
      "sources": [3],
      "targets": [1,2],
      "tables": "client",
      "onetimecopy": 1
    },{
      "sources": [1,2],
      "targets": [3],
      "tables": "product,order",
      "onetimecopy": 0
    }
  ]
}
  • Inside databases, describe all databases you desire to sync as a source and/or as a target;

  • The ID attribute must be a unique integer per database, and has nothing to do your database but the way the container will identify it;

  • Once your databases are described, you must describe your syncs;

  • Each sync must have one or more sources, and one or more targets; and these have to be described following JSON standard Array notation;

  • Each entity inside the sources and targets arrays represents an ID referring to the databases described beforehand;

  • The other attribute required is the syncs' table lists. A table list is a String containing the tables sync'd by that sync, separated by a comma and a space, as in the example above.

  • Onetimecopy is used for full table copy:

    • 0 No full copy is done
    • 1 A full table copy is always performed
    • 2 A full copy is done in case the destination table is empty
  1. Start the container:
docker run --name my_own_bucardo_container \
  -v <bucardo.json dir>:/media/bucardo \
  -d plgr/bucardo
  1. Check bucardo's status:
docker logs my_own_bucardo_container -f

How to use it (env-based passwords)

Same as before. The only difference is:

  • In the JSON database definition, type "env" for password instead of the database user password;

  • When you create a container, inform the password as a environment variable named BUCARDO_DB, where ID is the ID you defined earlier in the bucardo.json:

    docker run --name my_own_bucardo_container \
        -v <bucardo.json dir>:/media/bucardo \
        -e BUCARDO_DB3="secret" \
        -d plgr/bucardo

Acknowlegments

This image uses the following software components:

  • Ubuntu Xenial;
  • PostgreSQL 9.5;
  • Bucardo;
  • JQ.

Copyright and License

This project is copyright 2017 Lucas Vieira [email protected].
Licensed under Apache 2.0 License.
Check the license file for details.

bucardo_docker_image's People

Contributors

abcurado avatar pelgrim avatar

Watchers

 avatar

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.