Tag365 2 Posted February 15, 2016 Share Posted February 15, 2016 (edited) Using this program, you can host an array filesystem over a network. Set up is as simple as installing an autorun.lua script on the computer or server that hosts the ServerFS filesystem, and installing a boot script on the clients that will access the ServerFS filesystem. How it works: The "Host", the computer or server hosting the ServerFS fileserver, runs an autorun script which will allocate all non-primary filesystem components to a single virtual "ServerFS" component. It then receives messages over the network and when a message is received relating to the ServerFS the Host will then respond to the sender with a message with data related to the method it was trying to call. A "Client", a computer or server connecting to the ServerFS Host, has a boot script installed which runs at startup and sets up a virtual component which functions like a normal filesystem component. Calling one of the virtual component's methods will cause the Client to send messages to the Host computer and wait for the Host to respond. The boot script also automatically mounts the virtual filesystem component to the "srv" directory. Requirements: The component must have a type of "modem" or "tunnel" in the computer or server. Network cards and Wireless Network cards have a type of "modem", while Linked cards have a type of "tunnel". Therefore, you can use a Network card, Wireless Network card, or Linked card to connect to the Host computer. The other components required are the filesystems you want in the Host's RAID array. You must also have at least one filesystem attached to the Host computer. How to set up ServerFS: The "Host", the computer or server hosting the ServerFS fileserver. Step 1: Install a modem or tunnel component (a Network card or Linked card will work for this, as each card acts as a modem or tunnel component respectively) to the Host computer or server, then install any filesystem components you want in the array. Step 2: Get the autorun.lua script on to the Host. If the Host has an internet component installed execute "pastebin get cg1ieKUi /autorun.lua" and the required autorun script will be downloaded, or if you are the server host get the script at http://www.pastebin.com/raw/cg1ieKUi and add the script to the root of the filesystem that hosts the operating system. Step 3: Run the autorun.lua script. The autorun script will allocate all non-primary filesystem components to a virtual filesystem array, and then will host the ServerFS functionality. The "Clients", or computers connecting to the ServerFS fileserver served by the Host. Step 1: Install a modem or tunnel component to the Client (a Network card, Wireless network card, or Linked card will work), then connect the Client to the Host. Do not connect it to the Host directly if a large amount of components are inserted to the Host, as this can cause the Client to stop and show a "Too many components connected" error. Step 2: Install the boot script to the Client's boot filesystem. If the Client has an internet component installed execute "pastebin get HAgcbg41 /boot/98_serverfilesystem.lua", or if you are the server host get the script at http://www.pastebin.com/raw/HAgcbg41 and add the script to the path of "/boot/98_serverfilesystem.lua" on the filesystem that hosts the operating system. Step 3: Reboot the computer. On startup a "srv" directory will be mounted. Additional Information: Please note that accessing functions of the server filesystem is noticeably slower than accessing the other filesystems on your network because the Host has to receive the request of the client from the network (which adds a delay that can be reduced by adding a CPU or APU to the relay if there is any), then process the request, and then send the processed information to the client. Don't expect it to be as fast as accessing functions of a filesystem attached to your computer. If the network has relays connected, if too many requests are sent at in to short a timespan this can cause requests to be dropped by the relay and cause problems. You should shut down the Host computer before adding or removing filesystems from or to the Host computer, as not doing so can cause issues where the server will attempt to access filesystems that are not attached to the computer. For anyone that says that the files you create from the client are blank, this issue is caused by a change of the filesystem handling in an update to the OpenComputer mod, where file handles are not numbers anymore. I already made an updated version which is compatible with the updated handling of file handles and fixes the error by using numbers for file handle identification. The updated version to fix the issue has now been published. Update the script on the Host, then test to see if that fixed your issue. If not then report the issue you are having (post the issue again and that you updated the script if the same issue occurs). Download: The hosting autorun.lua script is at http://www.pastebin.com/cg1ieKUi The 98_serverfilesystem.lua script to add in the boot directory of your clients is at http://pastebin.com/HAgcbg41 Edited June 16, 2017 by Tag365 Fixed path for the install command Quote Link to post Share on other sites
jhagrid77 4 Posted February 16, 2016 Share Posted February 16, 2016 Seems cool, will try it out this weekend. Try to add more information though, such as if any specific actions are needed, such as mounting hard drives. Also is it kinda like a remote host, where you can sort of control what is done, or is it like a RAID where you can store and access data? Quote Link to post Share on other sites
Tag365 2 Posted February 17, 2016 Author Share Posted February 17, 2016 This is a remote RAID where you can store and access data from across the network. Filesystems will be detected by the autorun script and included in the array. You can read and write to the filesystem remotely. Quote Link to post Share on other sites
jhagrid77 4 Posted February 17, 2016 Share Posted February 17, 2016 Very nice and useful. Quote Link to post Share on other sites
Tag365 2 Posted February 17, 2016 Author Share Posted February 17, 2016 Do you plan on using this? Quote Link to post Share on other sites
jhagrid77 4 Posted February 17, 2016 Share Posted February 17, 2016 Yes, as it is a pain for me to connect a raid as I like to use multiple servers to hook it up to but then the terminals get all messed up. Quote Link to post Share on other sites
jhagrid77 4 Posted February 17, 2016 Share Posted February 17, 2016 Are there any specific components required such as a network card or wireless card? Quote Link to post Share on other sites
Tag365 2 Posted February 18, 2016 Author Share Posted February 18, 2016 The component must have a type of "modem" or "tunnel" in the computer or server. Network cards and Wireless Network cards have a type of "modem", while Linked cards have a type of "tunnel". Therefore, you can use a Network card, Wireless Network card, or Linked card to connect to the Host computer. The other components required are the filesystems you want in the Host's RAID array. Quote Link to post Share on other sites
jhagrid77 4 Posted February 18, 2016 Share Posted February 18, 2016 May I suggest a "cleaner" way to "print" this information? Quote Link to post Share on other sites
Kodos 3 Posted February 19, 2016 Share Posted February 19, 2016 Seems like this is broken in OC 1.6 dev builds pending a fix from Sugoi/Payonel with process cache being weak keyed. Looking forward to using this, though. Quote Link to post Share on other sites
Tag365 2 Posted February 19, 2016 Author Share Posted February 19, 2016 In order for me to fix it, you need to tell me what is the error message, or if it does not throw an error, what is happening. Also, you need to give me information on how to get version 1.6 of OpenComputers. Quote Link to post Share on other sites
jhagrid77 4 Posted February 20, 2016 Share Posted February 20, 2016 To get version 1.6 of OpenComputers (or any latest Snapshot) go to https://oc.cil.li/index.php?/topic/27-development-snapshots/ and then download for which ever version you would like. Quote Link to post Share on other sites
jhagrid77 4 Posted February 20, 2016 Share Posted February 20, 2016 I have a question, is it possible to have multiple hosts? Quote Link to post Share on other sites
Tag365 2 Posted February 22, 2016 Author Share Posted February 22, 2016 It is not designed to handle multiple Hosts being online and on the same network. I have not tested it yet, so it may or may not work correctly. Quote Link to post Share on other sites
jhagrid77 4 Posted February 23, 2016 Share Posted February 23, 2016 It doesn't there is an issue with it. Quote Link to post Share on other sites
Tag365 2 Posted February 23, 2016 Author Share Posted February 23, 2016 As I said it is not designed to handle multiple Hosts running, as it doesn't favor any Host on the network, the first to respond is the one that is used. Quote Link to post Share on other sites
jhagrid77 4 Posted February 24, 2016 Share Posted February 24, 2016 Hmm maybe you could configure it to look for others, or make it work like actual servers, where you can connect by say an IP or it's UUID. Quote Link to post Share on other sites
danman1354 0 Posted May 19, 2016 Share Posted May 19, 2016 Every time I write a file to the host i have to reset it before any computer on the network can see it in the srv directory, including the pc that wrote it. Evewn when I get it to show up when I ls, if i open (edit) it, the file is always blank. Then if i save the file (test.txt), when i open and ls the srv directory on another pc, it will show test.txt and test.txt~, both being empty.What am I doing wrong? Quote Link to post Share on other sites
Pigpork 0 Posted July 14, 2016 Share Posted July 14, 2016 PLEASE put a image/video tutorial! When my client computer access the srv folder, there is nothing and on the server computer I installed a program. Quote Link to post Share on other sites
ivskran 0 Posted December 11, 2016 Share Posted December 11, 2016 Hey, awesome work here! But I cannot get it to work using linked cards. Also, when creating a new file, the file is saved in the server, but not its contents, i.e when I edit it, it returns a blank page. Quote Link to post Share on other sites
Sukasa 0 Posted February 4, 2017 Share Posted February 4, 2017 I also cannot get this entirely to work; while the system boots properly and I can create folders / list their contents, the moment I try to work with any files, it falls over. doing something like `cd /srv` and `edit testfile` will seem to work, but the moment I try to save in edit, it throws an error: bad argument #1 (string expected, got nil): stack traceback: [C]: in function 'error' machine:631: in function <machine:628> (...tail calls...) /bin/edit.lua:117: in upvalue 'setSsatus' /bin/edit.lua:527: in local 'handler' /bin/edit.lua:583: in local 'onKeyDown' ... On the server's side, I have attached its output log After that, I attempted to run the command `echo "test" >> test`, and got another error. I have attached that as well Quote Link to post Share on other sites
Mods_o_joy 0 Posted February 8, 2017 Share Posted February 8, 2017 Was hoping this worked, the server program throws error, using linked cards on fully decked out T3 Servers. Quote Link to post Share on other sites
Mods_o_joy 0 Posted February 9, 2017 Share Posted February 9, 2017 Ok i fixed the SERVER SIDE issues, the client program is saying Failed to mount server file already exists, i'l work on fixing it next. not sure if we can put up fixed code, the original maker has been gone for a long while now. EDIT: Client side seems to work just fine, but it wont connect with the server. Quote Link to post Share on other sites
maxime993 0 Posted March 1, 2017 Share Posted March 1, 2017 comment on colle le program de opencomputer dans le jeux ? Quote Link to post Share on other sites
Tag365 2 Posted March 26, 2017 Author Share Posted March 26, 2017 On 2/4/2017 at 0:41 PM, Sukasa said: I also cannot get this entirely to work; while the system boots properly and I can create folders / list their contents, the moment I try to work with any files, it falls over. doing something like `cd /srv` and `edit testfile` will seem to work, but the moment I try to save in edit, it throws an error: bad argument #1 (string expected, got nil): stack traceback: [C]: in function 'error' machine:631: in function <machine:628> (...tail calls...) /bin/edit.lua:117: in upvalue 'setSsatus' /bin/edit.lua:527: in local 'handler' /bin/edit.lua:583: in local 'onKeyDown' ... On the server's side, I have attached its output log After that, I attempted to run the command `echo "test" >> test`, and got another error. I have attached that as well This is caused by a change of the filesystem handling in an update to the OpenComputer mod, where file handles are not numbers anymore. I already made an updated version which is compatible with the updated file handles and fixes the problem by using numbers for file handle identification. However I have not published the updated version yet and I still have the files on my old computer. So wait for the updated version to be published. The updated version to fix the issue has now been published. Test the updated version now to see if that fixed your issue. Quote Link to post Share on other sites