# Synchronised Home Directory / Workspace



## splitice (Apr 5, 2014)

I want to create a synchronised / remote home directory setup, the idea would be to provide working space to staff members to use on remote nodes. This space would be in sync between all nodes, ideally not actually stored on the nodes themselves but on a remote server and accessed via something like NFS.

NFS is an option, however due to its semantics and being in kernel, it could be difficult to get setup (i.e would like it to be dismounted when not in use).

Preferably user-space (FUSE). Bonus points if it has block level support (i,e its possible to use to dump possibly large log files). I am not looking to run something like mysql on it, ideally it would be to serve as a script library + work space.

Ideas people?


----------



## Francisco (Apr 5, 2014)

What about btsync? I'm positive I've seen people using it.

Francisco


----------



## tchen (Apr 5, 2014)

s3ql  not as far as pure block-level, but it does split files and reads/writes only those parts required (effectively yes).


----------



## howardsl2 (Apr 5, 2014)

Have a look at my SSHFS tutorial for CentOS and Ubuntu (using FUSE). It is quick and easy. 
https://blog.ls20.com/using-sshfs-to-share-folders-between-your-servers/


----------



## mojeda (Apr 6, 2014)

Francisco said:


> What about btsync? I'm positive I've seen people using it.
> 
> 
> Francisco


btsync syncs files to local computers.

What about Samba?


----------



## Francisco (Apr 6, 2014)

mojeda said:


> btsync syncs files to local computers.
> 
> What about Samba?


I thought btsync kept everything in sync in all directions?

Francisco


----------



## splitice (Apr 6, 2014)

Some interesting suggestions so far, good work.



hwdsl2 said:


> Have a look at my SSHFS tutorial for CentOS and Ubuntu (using FUSE). It is quick and easy. https://blog.ls20.com/using-sshfs-to-share-folders-between-your-servers/


Interesting, as far as I know SFTP put transfers the entire file which sucks a little.



tchen said:


> s3ql  not as far as pure block-level, but it does split files and reads/writes only those parts required (effectively yes).


Very interesting, entirely user space too. Neat.



Francisco said:


> What about btsync? I'm positive I've seen people using it.
> 
> Francisco


We already use btsync in our infrastructure.

Its not really suitable due to:

 - Frequent updates arent handled well (remote slave back over the top of master) if any nodes clock is out by more than 1-2 seconds.

 - *Doesn't synchronise permissions, any unix specifics or symlinks*

 - Requires a separate share / hash to be created for every user, and a seperate daemon to be constantly running due to the re-index being slow / intensive

Keeping permissions intact is very important for the setup I am considering with multiple staff members involved, not to mention how annoying / impossible it is to fix permissions on large scripts (with includes etc).

We use btsync to synchronise packages and it works well enough for that (even if it does struggle with the 200,000+ .git/* files). It also has other issues, such as dynamically choosing its ports and not supporting any form of bind address.



mojeda said:


> btsync syncs files to local computers.
> 
> What about Samba?


Given how slow it is on local networks I don't imagine it would work suitably, plus as a kernel mode module I would probably use nfs instead if came to that.


----------



## mojeda (Apr 6, 2014)

Last I checked you can specify the ports that btsync uses as well as the IP.


----------



## perennate (Apr 6, 2014)

mojeda said:


> Last I checked you can specify the ports that btsync uses as well as the IP.


And?


----------



## drmike (Apr 6, 2014)

Seems like options are:

1. A distributed/replicated filesystem.

2. Btsync or similar P2P

3. SSHFS + ????

I use SSHFS quite a bit.   It's nice cause once up and perfected it just works.   Plus you can use many common tools with it.  My favorite, good old rsync.   I just run an aggressive CRON job with rsync.   But better ways to do that, say based on actual underlying disk activity.

Btsync is on my to-do list.  Sounds intriguing, but not preserving file permissions sucks.

Shortcoming of generic rsync implementation is lack of versioning and preservation of prior files/edits.  That can likely be worked around creatively also.  Lots of scripts out there with all sorts of wizardry and cooked up hackery.


----------



## drmike (Apr 6, 2014)

and... of course...

#4, SSHFS  + Unison


----------



## splitice (Apr 6, 2014)

mojeda said:


> Last I checked you can specify the ports that btsync uses as well as the IP.


The Web UI port can be specified and disabled, but ports for transfers and data communication can not be.


----------



## splitice (Apr 6, 2014)

Currently s3ql is looking very promising, I just need to work out what an appropriate backend would be. I am not sure about the S3 datastore and Google Cloud Storage. Personally I would prefer to use a Backupsy instance or something akin.


----------



## willie (Apr 6, 2014)

In my experience trying to work on an active remote disk is painful even over a LAN.  Better to work locally and sync on demand, using rsync or git depending on the data.


----------



## mikho (Apr 7, 2014)

willie said:


> In my experience trying to work on an active remote disk is painful even over a LAN. Better to work locally and sync on demand, using rsync or git depending on the data.


Really depends on what you are working with. 
Opening a gazillion files over lan/wan can be painful if you have bad latency.


It's all about the connection.


----------



## mojeda (Apr 7, 2014)

splitice said:


> The Web UI port can be specified and disabled, but ports for transfers and data communication can not be.








These are separate from the web ui. However I was wrong about being able to make btsync use a specific IP, not just the web ui.


----------



## tchen (Apr 7, 2014)

splitice said:


> Currently s3ql is looking very promising, I just need to work out what an appropriate backend would be. I am not sure about the S3 datastore and Google Cloud Storage. Personally I would prefer to use a Backupsy instance or something akin.


At the end of the backends docs, there's the bit about local storage.  Frankenstein a sshfs mount (silly as it may sound).


----------



## splitice (Apr 11, 2014)

mojeda said:


> These are separate from the web ui. However I was wrong about being able to make btsync use a specific IP, not just the web ui.


It still creates a port for each active transfer. Yes the listen port can be set.


----------



## Taronyu (Apr 12, 2014)

The problem I had with sshfs is that I first had to browse to my directory I needed and only then Sublime text was able to see the files. Might have been a unstable connection but ai never tried again.


Send from my Galaxy S3


----------



## blergh (Apr 12, 2014)

I've had better luck with btsync than sshfs, should be the other way around, no?


----------



## WebSearchingPro (Apr 13, 2014)

blergh said:


> I've had better luck with btsync than sshfs, should be the other way around, no?



The nice thing about btsync is the P2P factor, slowly adding more devices makes it collectively faster and more robust.


----------



## Francisco (Sep 22, 2014)

I know I'm a terrible person for necro'ing this thread but hopefully the mods don't smite me.

Still on topic, has anyone played with syncthing?

It looks like it addresses the permission syncing as well as other things up for discussion.

Francisco


----------



## BrianHarrison (Sep 23, 2014)

willie said:


> In my experience trying to work on an active remote disk is painful even over a LAN.  Better to work locally and sync on demand, using rsync or git depending on the data.


That's my experience too, even with <1ms network latency. Local sync is necessary.


----------



## splitice (Sep 23, 2014)

Still using btsync currently for package transfer between remote server.

GlusterFS internally and in one case within the same country (Ramnode <-> DO AMS2)

And rsync to keep some supporting utilities in sync (monitor scripts)

I really want to play with s3fs but not prepared to leap into Amazons world yet.


----------



## drmike (Sep 23, 2014)

Francisco said:


> Still on topic, has anyone played with syncthing?


Currently trying a basket of these solutions.

Syncthing is on the list.

Have Seafile up and going and it's rather cool   Little different and in place challenging - like good luck as-is mirroring say /home/yourdirectory in whole.  My experience at least... But it works fine mirroring say /home/username/Desktop and related other major spots.

Tested on LAN and no pesky Apache or Nginx or whatever web configuration which I just detest.  It does have a web interface built in and a slew of clients for everything major:

http://seafile.com/en/download/


----------



## k0nsl (Sep 24, 2014)

Ya, I'm using Syncthing for a few thing and am very satisfied with it. Easy to setup and work with, all very smooth.

I haven't run into any issues yet, either. It just works 



Francisco said:


> I know I'm a terrible person for necro'ing this thread but hopefully the mods don't smite me.
> 
> Still on topic, has anyone played with syncthing?
> 
> ...


----------



## Francisco (Sep 24, 2014)

k0nsl said:


> Ya, I'm using Syncthing for a few thing and am very satisfied with it. Easy to setup and work with, all very smooth.
> 
> I haven't run into any issues yet, either. It just works


Linux permissions work without issue?

Francisco


----------



## k0nsl (Sep 24, 2014)

To tell you the truth, I have not ran into any issues with permissions. But my main purpose of use is to shuffle data to some backup server which has Syncthing running and connected to one of the boxes here at home, like this:






Makes for easy management. I'm thinking about doing something more useful with it, soon. Just have to evaluate it some more to see if it would be a good idea: for example, let it deal with local cPanel/WHM backups. Not sure yet.

But I like it and it works great so far 



Francisco said:


> Linux permissions work without issue?
> 
> Francisco


----------



## drmike (Sep 24, 2014)

We should get some tutorials constructed - even if short cliff notes versions for the various file replication tools at play here (BTSync, Syncthing, Seafile, etc.).

Anyone have such for BTSync before I waste 2 hours searching and failing?


----------



## splitice (Sep 24, 2014)

@k0nsl Probably QQ's.

Can the web UI be disabled with syncthing? Are the logs usefull though? CLI interface?

Can the network address & ports be specifically bound?


----------



## k0nsl (Sep 24, 2014)

As for ports, yes - those can be explicitly set in the configuration file. It's very straightforward.

In the configuration the Web GUI can be disabled:



<gui enabled="true" tls="true">
    <address>0.0.0.0:8080</address>
</gui>



splitice said:


> @k0nsl Probably QQ's.
> 
> Can the web UI be disabled with syncthing? Are the logs usefull though? CLI interface?
> 
> Can the network address & ports be specifically bound?


----------

