Advertisement

Mapping computers as drives

Started by May 26, 2003 06:53 PM
10 comments, last by Raduprv 21 years, 3 months ago
I have this problem: I want to map the files from some directory on a computer (over internet), so other computers can see them like those files are actually on their local drives. Example: Computer 1 (mother of all computers): /users/*files* Other computer: /home/users/*files* Umm, I don''t know if people understand exactly what I mean. it should be like a sym link, but that points to files on other computer. I need such a thing because I want to have a server to store the users data, for my MMORPG server, and other servers to get their users from that server, but without things like MySQL, samba, ftp, etc. It would also be very nice if the entire transfer would be encrypted. Any ideas? Thanks in advance <a href="http://hme.sf.net" target=new>Height Map Editor</a> | <a href="http://www.eternal-lands.com" target=new>Eternal Lands</a> | <a href="http://fud.sf.net">Fast User Directory</a>
You could certainly use NFS, just mount a drive to your "Mother" computer -).

I''ve seem some stuff about using SSH to secure NFS.

You could also do an rsync just before your game client starts up to get the most recent files, assuming that fits your model, but I get the impression you want to see the files live on the server, not sync them up.

Probably another option is to just use IPSec between the servers and NFS (or any other VPN).

Interim
Advertisement
Heh,

I would suggest using rsync, unison or CVS to get the feel you''re looking for. NFS is most likely going to be too slow ( both TCP and UDP and accounting for version 2 - 4 ) for you to use over the Internet, and it exposes more risk to your machine than you''d probably want to allow.

If this doesn''t fit your model, you should use a database.

Why do you have the requirement to mount a drive remotely across the Internet? It seems like wasted resources on both sides of the equation, more administration hassle and possibly unmanageable in the long run.

Post some more details perhaps.

.zfod
Basically what I need is a central file server, to store the user names/attributes, and then satellite servers (that will be MMORPG servers) which will validate the users tha log ina ccording to the files contained on the mother of all servers...

Height Map Editor | Eternal Lands | Fast User Directory
BTW, I want to read from a file, rather than from databases because files are easier, i don''t want the overhead of creating a MySQl connection, etc.
Also, there is another reason:
I develop on Windows, mostly (using SDL/SDL_net).
So, I want a good way to test my server, on Windows, and, whehn I compile on Linux, for the final version, I just change a few defines. One of the defines will change the file path, like this:


#ifndef WINDOWS
#define users_file_path /mnt/whatever/path
#else
#define users_file_path ./users
#endif

Height Map Editor | Eternal Lands | Fast User Directory
To keep it simple, just set up SSH between the servers then.

From your "children" just do an SSH command to read the file:

ssh -l "cat /your/file"

You could call this process from your program, read in the results and process it as you wish.

Personally I would look for something more elequent, such as using XML over HTTP with SSL and certificates, but ssh will work.

If you were smart, you could write a little accessor program on Mother to read just what you want from the files, then call it from SSH and read in the results. Something like:

ssh -lMotherLogin 127.0.0.1 "GetUserAttributes InterimUser YourFileName.Txt"

Which of course would kick back data in a format you like:

User=Interim
IsCool=Yes
IsLame=No
IsSilly=Yes
etc...

If you set up SSH with certificates, you can bypass the need to manually input a password, to automate it.

SSH isn''t the fastest response time for this sort of thing, so if speed is your desire, you should build a better solution. XML over HTTPS would be nice, a little CGI program that takes a username and what not as input, returns an XML or some other format you want to read over an SSL connection.

But you wanted simple, I think SSH would probably be one of the simplest (no need for NFS, rsync, CVS, etc.) and ssh is pretty standard now.

Interim
Advertisement
Heh,

What do you think most sane people use with rsync?

Set the environment variable RSYNC_RSH to use SSH ( you can do this with CVS as well with CVS_RSH ):

export RSYNC_RSH=/usr/bin/ssh

The execute on the client:
rsync -azq user@server:/directory/path/ /parent-dir/on/client/

Or if you don't want to set environment variables, execute this on your client machines:

rsync -azq -e /usr/bin/ssh user@server:/directory/path/ /parent-dir/on/client/

( Edit: you might have to set --rsync-path=/path/to/rsync as well here depending on how the server user environment is setup )

This will sync things nicely and securely if you're careful.

Do keep in mind however that rsync loves to hog resources for figuring out which files need to be sync'd. If you plan on doing this in a massive environment you're going to pay for it in hardware costs and I'd suggest investigating a process more suited for your needs.


.zfod

[edited by - zfod on May 28, 2003 4:51:39 PM]
In all honesty though,

Why the hell aren''t you setting up a database? It''s one thing to sync files like a patch server lets say, but for looking up authentication information and user attributes?

I''m not comprehending why you''re shying away from a database, but investigating these other glued-together solutions instead.

MMORPG''s are very data-driven, and that pretty much means sooner or later you''re going to want to put things into a database to make things easier to query ( SQL obviously is more powerful than simple parsing of XML, etc.. and is more extendable ) and relate.

Please explain


.zfod
Also sounds something that LDAP would be ideal for as well.

Interim
I am not looking into databases because I already started this way, I have 3K accounts, and I am too lazy to convert them into a database format, etc.
On the other hand, I might to a small server on the "Mother" that will accept requests from sons about user files, perhaps adding my own encryption to the protocol.

Height Map Editor | Eternal Lands | Fast User Directory

This topic is closed to new replies.

Advertisement