Sync Problem Between 2 Servers Bidirectionally


Power2All

Recommended Posts

Hi,

 

I put 2 folders (/var/www/ and /file-storage/demo/) to sync with 2 machines.

Both have 2 different secret keys, although same on both servers.

 

Added the IP and port and such.

 

Now for example, /file-storage/demo/ is empty on both.

I copy a backup in /file-storage/demo/ and the debug mode shows it reads the files and such.

After a while, I notice both locations are empty again.

 

What is wrong with this ?

 

Also, the GUI is not being enabled when in config file is assigned, same for the LOG file not being put on the location which I give it to (command prompt).

 

Here all the details, please explain me what I might do wrong, or if this is a possible bug.

 

Also a short point-list I noticed that is wrong, or I perhaps made a mistake:

* Logging to file not working, takes default .sync/sync.log thingy.

/root/.btsync/btsync --config /root/.btsync/btsync.conf --log /root/.btsync/btsync.log

* /var/www/ syncs fine, but /file-storage/demo/ is not...

* Lots of data information in the debug logging, but sofar I didn't see any transfering.

After a while I noticed both locations in /file-storage/demo/ to be empty.... Why ?!

* We use Hamachi VPN. Works fine, and firewall is set to allow all connections within the VPN to function.

All tested and working fine with rsync and such, including FTP active and passive mode.

* We need eventually to sync up more then 2 servers of 1 folder location, but right now it seems to be not syncing properly big files...

 

Server1 (/root/.btsync/btsync.conf)

{        "device_name": "server2 BTSync",        "listening_port" : 50000,        "storage_path" : "/root/.sync",        "check_for_updates" : true,        "use_upnp" : false,        "download_limit" : 0,        "upload_limit" : 0,        "folder_rescan_interval" : 300,        "webui" :        {                "listen" : "0.0.0.0:8888",                "login" : "admin",                "password" : "****"        },        "shared_folders" :        [                {                        "secret" : "****",                        "dir" : "/var/www",                        "use_relay_server" : false,                        "use_tracker" : false,                        "use_dht" : false,                        "search_lan" : false,                        "use_sync_trash" : false,                        "known_hosts" :                        [                                "25.109.37.87:50000"                        ]                },                {                        "secret" : "****",                        "dir" : "/file-storage/demo",                        "use_relay_server" : false,                        "use_tracker" : false,                        "use_dht" : false,                        "search_lan" : false,                        "use_sync_trash" : false,                        "known_hosts" :                        [                                "25.109.37.87:50000"                        ]                }        ]}
Server2 (/root/.btsync/btsync.conf)

{        "device_name": "server2 BTSync",        "listening_port" : 50000,        "storage_path" : "/root/.sync",        "check_for_updates" : true,        "use_upnp" : false,        "download_limit" : 0,        "upload_limit" : 0,        "folder_rescan_interval" : 300,        "webui" :        {                "listen" : "0.0.0.0:8888",                "login" : "admin",                "password" : "****"        },        "shared_folders" :        [                {                        "secret" : "****",                        "dir" : "/var/www",                        "use_relay_server" : false,                        "use_tracker" : false,                        "use_dht" : false,                        "search_lan" : false,                        "use_sync_trash" : false,                        "known_hosts" :                        [                                "25.107.8.21:50000"                        ]                },                {                        "secret" : "****",                        "dir" : "/file-storage/demo",                        "use_relay_server" : false,                        "use_tracker" : false,                        "use_dht" : false,                        "search_lan" : false,                        "use_sync_trash" : false,                        "known_hosts" :                        [                                "25.107.8.21:50000"                        ]                }        ]}
Netstat output on server 1.

Shows that webGUI is not binded...

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:50000           0.0.0.0:*               LISTENtcp        0      0 25.107.8.21:10000       0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:30865           0.0.0.0:*               LISTENtcp6       0      0 :::22                   :::*                    LISTENudp        0      0 0.0.0.0:3838            0.0.0.0:*udp        0   1280 10.0.1.20:38411         0.0.0.0:*udp        0      0 0.0.0.0:68              0.0.0.0:*udp        0      0 0.0.0.0:50000           0.0.0.0:*udp        0      0 0.0.0.0:33679           0.0.0.0:*raw        0      0 0.0.0.0:1               0.0.0.0:*               7raw        0      0 0.0.0.0:1               0.0.0.0:*               7
Link to comment
Share on other sites

So when you define shares in config, webgui is disabled ?

Also, I notice it's finally transfering files.

I see .!sync files growing.

But it's reaaaaaly slow.

Is that normal ?

Is there a way to set piece-sizes manually ?

Like let it send like 2MB or something sized pieces over ?

Link to comment
Share on other sites

Problem found.

 

Ok another question then.

 

Server1 works fine, is not behind a firewall, all ports accessible.

Server2 is behind a closed down firewall, allowing NO port forwarding and NO UPnP fixes.

So is it possible for BTSync to do a Bi-Directional sync with only connecting Server2 to Server1 ?
It's like this: rsync can download a file and upload a file initiated by Server2 only.

 

Could anybody tell me ?

Link to comment
Share on other sites

Power2All,

 

It actually depends on your NAT behaviour. UPnP and PMP won't work, so it will try hole punching. If your NAT is smart enough to start switching ports - BTSync won't manage to connect and will initiate connection thru cloud.

 

If it is not smart enough - BTSync will install a direct packet exchange (I avoid "connection" here as BTSync actually sends UDP datagrams and does not connect as it would be done over TCP protocol).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.