How do you deal with multi server environments and custom apps?

Red Squirrel

[H]F Junkie
Joined
Nov 29, 2009
Messages
9,211
I have multiple servers in my house, and most have some custom app of some sort, whether it's a web based thing or full blown C++ app.

I like to code stuff in real time so I can test without having to copy files all over the place every time I make a change. So I have a central folder on my main server where the dev and prod stuff goes. This folder is then shared out to the servers and the applications are executed from there.

The problem I constantly run into is the dreaded Linux permissions issue. Unike Windows, there is zero inheritance in Linux, making permission management a huge nightmare. If there's one thing in Linux that was very poorly designed, it's the file permissions.

If I write something from one server it will have a different set of permissions from if I write it from another server, and I wont be able to modify it from another server. It's a royal pain and I'm always fighting with this. I can do force group and force user, but it only seems to work to some extent. It's hit and miss.

Is there a better way to approach this? I could just keep the files local to each server, but then I'd end up with a billion mounted shares on my workstation for development. I really want to just keep it all centralized. Also makes backups easier as I'm only backing up a single folder on a single server instead of starting remote rsync sessions on each server.

One thing I'm wondering is if I should use NFS, but that does funky permission crap too. I almost want to be looking at iSCSI, but from my understanding, it's not really meant to be treated as a share, only one PC should be accessing it at once.

Basically, I just want to do way with per file permissions, and I want per share permissions instead.
 
I use subversion and back up the repository fairly often, this keeps everything up to date and backed up.
 
There are cluster filesystems that can be accessed by multiple nodes at the same time. I believe Gluster is one of them.

However, a simpler solution would be to use a user management system like Kerberos or LDAP - that way, you would have the same accounts on each system.
 
There are cluster filesystems that can be accessed by multiple nodes at the same time. I believe Gluster is one of them.

However, a simpler solution would be to use a user management system like Kerberos or LDAP - that way, you would have the same accounts on each system.
Or AD, if you have a directory. winbind works pretty flawlessly.
 
Set the same UID for your users on all systems and you won't have this permissions issue.
 
Set the same UID for your users on all systems and you won't have this permissions issue.
This.

As NetJunkie said, ensure the UID and GID are the same across systems, and you shouldn't have any issues. LDAP would solve this issue rather nicely as well.

How do you share the folder now?
 
hmm did not figure it would be that simple, so could I technically just have a central passwd and shadow and whenever I make a change I just copy it accross all systems? I'd also have to do the smb file, I forget the name off hand now.

I usually use samba for sharing. I also sometimes use sshfs if the server is not on my network.

Ldap is something I need to read up on too, I know the basics, but maybe it would be my ultimate solution. The main server is a domain controller, but it's just a samba domain controller, so it's really basic. Could probably make it use ldap.
 
Come to think of it, I guess what I could also do is store the code in that central location, but make it part of my compile script to rsync it to the host where it actually runs on. In a way this may be better as if the central location goes down at least the other server can keep chugging along.
 
LDAP would be used as a backend to Samba. You could also use LDAP to synchronize non-system users and groups across the network. Or you could try to join all your linux machines to the Samba server (Windows XP works, 7 with a registry change)

Samba's domain controller functionality isn't basic, it is simply emulating an NT4 domain controller.

You could try playing with Samba4...
 
Back
Top