Folder Syncing in sequence A to B and B to C


Recommended Posts

Hi Team,

We have a specific requirement where we want to sync folders from Location A to a folder in Cloud EC2 instance and then from Cloud to Location B.

Currently when we share the folder, then it sync's from Location A to both Cloud and Location B simultaneously.

Can someone please help with a configuration where we can achieve this.

Thanks,
Rupesh

Link to comment
Share on other sites

Rupesh,

disable tracker, relay and Search LAN on each. use predefined hosts between A and EC2, and then  between EC2 and B. You will need to share standard folders though. 

So A will be connected to EC2 (but not B), B will be connected to EC2 (but not A), and EC2 will be connected to both. 

Link to comment
Share on other sites

Hi Helen,

Thanks for the quick reply. 

We tried doing this in local LAN. We got BitTorrentSync installed on three Windows machines (lets call then PC1, PC2  and PC3).
Then we shared a folder between these three.
Then in PC1, the the shared folder, we went to preferences and unticked "User relay server when required", "Use Tracker Server", "Search LAN".
Then we ticked "Use Predefined Hosts" and added the ip address of PC2 and the port number.

Port number was taken from the Preferences -- Advanced -- Listening Port.

Then in PC2 we did similar configuration by adding IP of PC1 and Port of PC2.
This way we were trying to see if the sync happens only between PC1 and PC2, since PC3 was not configured in either of the machines.

To be on the safer side, we even unticked the check boxes in PC3.

Now when we add a file on PC1, it should ideally get synced with only PC2 as it is defined in the predefined hosts. Also nothing should get synced with PC3, since neither PC1 nor PC2 has its ip + port defined in the predefined list.

However the file copied in  PC1 still got simultaneously synced with both PC2 and PC3.

Can  you please help in identifying what we are doing wrong.

Thanks for your kind help.

Regards,

Rupesh

Link to comment
Share on other sites

@Rupesh Mashru It's due to fact that you added folder and then changed it preferences. While you did that, Sync already used LAN discovery to locate PC3. And once located, it just cached so even when you disable LAN and Tracker discovery, PC1 and PC2 still remember PC3.

For the clean test in lab environment do the following:

1. Remove the folder.
2. Open power user preferences
3. Set folder_defaults.use_tracker, older_defaults.use_relay and folder_defaults.use_lan_broadcast to false
4. Now add folder to PC1, share it to PC2 and PC3. They won't connect until you explicitly put their IP:ports into Known Hosts. But you can also add the hosts to older_defaults.known_hosts.

Link to comment
Share on other sites

Hi RomanZ,

Thanks for your reply. We followed the steps an it worked locally on LAN.

However when we tried doing it between a local computer to EC2 on Amwazon cloud and back to a local computer it did not work.

We were not able to add the folder shared from local computer to the Bittorrent sync on EC2 instance of cloud.

After entering the link for sharing, it kept saying "Connecting".

When we tick the use tracker and use relay then it works. But with those two options off and adding the EC2 instance public ip address and port in "Predefined Hosts" it does not work.

Please help in resolving this issue with your expert opinion.

Thanks,
Rupesh

Link to comment
Share on other sites

Hello Helen,

We have the same requirements as Rupesh.

The problem is my second client (Mac) still has 2 peers online even though I configured it to sync with the first client only.

How can I restrict the second client to sync with the first one?

You can find my configurations below.

BTSync Server - Linux (192.168.1.2)

{
    "device_name" : "btsync-server",
    "listening_port" : 4444,
    "storage_path" : "/var/lib/btsync",
    "pid_file" : "/var/run/btsync/btsync.pid",
    "agree_to_EULA": "yes",
    "upload_limit" : 512,
    "shared_folders" :
    [
        {
            "secret" : "READ WRITE KEY",
            "dir" : "/tmp/my-btsync",
            "use_relay_server" : false,
            "use_tracker" : false,
            "search_lan" : false,
            "use_sync_trash" : true,
            "overwrite_changes" : true,
            "known_hosts" :
            [
                "192.168.1.3:4444"
            ]
        }
    ]
}

Client 1 - Linux (192.168.1.3)

{
    "device_name" : "btsync-client01",
    "listening_port" : 4444,
    "storage_path" : "/var/lib/btsync",
    "pid_file" : "/var/run/btsync/btsync.pid",
    "agree_to_EULA": "yes",
    "upload_limit" : 512,
    "download_limit" : 512,
    "shared_folders" :
    [
        {
            "secret" : "READ ONLY KEY",
            "dir" : "/tmp/my-btsync",
            "use_relay_server" : false,
            "use_tracker" : false,
            "search_lan" : false,
            "use_sync_trash" : true,
            "overwrite_changes" : true,
            "known_hosts" :
            [
                "192.168.1.2:4444"
            ]
        }
    ]
}

Client 2 - Mac (192.168.1.4)

Key: READ WRITE KEY
Use relay server when required: unchecked
Use tracker server: unchecked
Search LAN: unchecked
Use predefined hosts: 192.168.1.3:4444

Thanks in advance!

Cheers,

juanpablo

Edited by juanpablo
Removed syntax highlighting
Link to comment
Share on other sites

Hi Helen/RomanZ,

My issue still not resolved. It works perfectly when done locally on three machines.
However when we try the same on a local machine, Cloud EC2 and a remote machine, it does not work.
While sharing the folder, it does not show any peers connected until the "PreDefined Hosts" are not entered.

But when we enter the predefined hosts, it shares files directly from A to C, even if the service on B is shut down.
Here A is a local machine, B is Cloud EC2 and C is remote machine
In A we are adding the IP and Port of B.
In B we are adding IP and Port of A and C.
In C we are adding IP and Port of B.
The three check boxes "Use Relay Server", "Use Tracker", "Search LAN" are unchecked for the shared folder, before sharing the folders.

Also when we try to change the settings in the Power Users options, and restart the service, the settings get turn off again. Is there any specific way that it needs to be done. Please advice.

Please help.
Thanks,
Rupesh

Link to comment
Share on other sites

@juanpablo

Client Mac and Server Linux should be connecting to Client Linux both, but not to each other, right? How many peers Server has? from your description - it shall so be two. 

The thing is that Mac can remember hosts IP from pervious connections - these are kept in memory for 7 days. 

On Client Linux predefine both - Server and Client Mac. Currently you have only one host there. 

 

@Rupesh Mashru

I don't think it's possible to disable them before sharing, as you say. Yes, it can be done on source where you "add folder", but not on targets who connect though the key. If you share a folder and disable tracker and relay after adding it to Sync, so peers manage to connect through tracker.

So the problem here is that defaults are not saved. Try deleting settings.dat  and settings.dat.old files from storage: quit service, delete the files, change the defaults, restart Sync. If settings are not still honored, any details about your service? 

Link to comment
Share on other sites

Hi Helen,

We tried the below with no luck:

1) Uninstall Bittorrentsync from all machines. Reinstall with the latest version.
2) Set the three flags in the power user settings. Was able to get it saved from the application.
3) Configure the predefined hosts also from the application.
Here A is a local machine, B is Cloud EC2 and C is remote machine
In A we are configure the IP and Port of B.
In B we are configured IP and Port of A and C.
In C we are configured IP and Port of B.
4) Then we added a new folder in A, copied the link and added to B. Copied the link from B and added to C.
But after this it showed 2 of 2 peer connected in all three machines.

Then when a file was added in A, it got synced simultaneously to all three locations.
Please help.

Thanks,
Rupesh

Link to comment
Share on other sites

@Rupesh Mashru

I have just checked this case once again and worked as expected A and C didn't connect to each other. Added file on A, and C downloaded it from B.

You say you shared link. Please make sure that you use standard folders, and try using keys. 

If the problem remains, there is most likely another means for A and C to find each other. And to determine how exactly they connect to each other, can you please send the logs from all three machines to us? 

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.