Learn about Centmin Mod LEMP Stack today
Register Now

sync files on multiple servers

Discussion in 'System Administration' started by adamus007p, Apr 4, 2020.

  1. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    9:33 PM
    Hello,
    how you handle a problem to sync files when you have multiple server in different geo location?


    is it possible to use rsync or other solution with cron?

    May you share with your scripts or solutions?
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,684
    10,193
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,792
    Local Time:
    5:33 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  3. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    9:33 PM
  4. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    9:33 PM
    Regards:
    Images on cloud/cdn ?


    2. Have you test a Cloudfront CDN on forum?
    Have you test any preconnect or link rel="dns-prefetch"

    Now Cloudfront support http2.
     
  5. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    9:33 PM
    My problem is that I want to sync cache files which are created every few minutes and update it between two servers.


    I have two servers and i use Cloudfront. I have noticed that there is weird situation that some cache file or even jpg is available on one server but not on the second.

    When you will go on second server very often the cache file with css is not visible and the page is broken.

    Cloudfront use only one server to copy from it a static files.

    I don't use a bucket and maybe it is a problem. I could push there files from both servers.
    The problem is how frequent is there a creation on the same cache of css (the same files with different version).


    This is maybe a workaround but I was thinking to use rsync and cron.
    In your list I have found

    https://icicimov.github.io/blog/devops/File-system-sync-with-Csync2-and-Lsyncd/

    Which seems better solution then rsync.

    George if you have any other ideas that I can use please write.

    I want to sync one folder when often files are changed - cache.
    Img files I do it ont time manually or rsync it.

    I want to sync only changes between two VPS one folder with subfolders and files.

    Other idea will be to correct the core of my application but it will take time.
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,684
    10,193
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,792
    Local Time:
    5:33 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    syncing files would be beyond Centmin Mod provided support so would be something for you to investigate and test yourself

    thanks for the heads up on expired cert - currently there is no centmin mod tool to check for this but you can via 3rd party monitoring services some check for ssl certificate validiity. Cloudflare HTTPS based health checks can also check for SSL cert validity at origin side