Ah yes I figured that thanks for the reply. I'm also wondering if there is a way to log everything that happens with the script, because I have experienced some random downtime of the server, and I have no where to look for errors. I'm also wondering if the script cleans the server.log as well because that I don't want
We haven't yet implemented any logging functionality, but no, it doesn't touch the server.log file in any way. At any rate, the script itself shouldn't cause any issues with stability. All I can tell you is to make sure that the ramdisk has enough space for all of your worlds with a bit left over, and to make sure you're not giving the JVM too much RAM in your invocation.
@Toasty my ramdisk is over 2 gb big and my server keeps timing out when backing up. (Every 6 hours service minecraft backup ramdisk..) any ideas how I could fix that?
Are you backing up the whole ramdisk, or just the worlds? ( "backup ramdisk" or "backup worlds") What error do you get when the backup times out? As far as the backup process is concerned, there's nothing in the script specifically that expects a backup to take a certain amount of time. The only time the script is expected to wait for a specific period of time is when the ramdisk is being unloaded prior to stopping the service.
Okay. I was also thinking about the backup service, I do have the same problem as @beleg has my server times out and i backup my server every 2 hours. Also i get the problem where the backups need to be deleted and i manually have to do this which can get pretty irritating after a while :/
no errors. the minecraft server itself just has an lagg for 30 seconds then everyone recieves the time out message and when the .tar process is done the server is back up again (without restarting)
@beleg that seems like a performance issue. I talked to some other people who have made similar scripts a number of months ago about how they handle backups, and the ones who had large world files ( >1GB) all opted for using rsync instead. My server's maps have never gotten horribly large, so I never worried about the potential performance issues of doing a full backup. Regardless, we saw this being a problem quite some time ago and started work on implementing rsync for incremental backups. Basically, your server is timing out because a full backup of 2GB of data with a checksum is too taxing for your server. Unfortunately I don't have a time frame for the complete inclusion of rsync, but it's the at the top of our feature list. @Fronix That's one reason why we haven't built automatic backups into the script yet. We don't have a function to parse backups and clean them systematically, so the backups folder would just get full of old backups. It's something we've planned on adding to the script for quite some time now though.
@Toasty please do that when you find the time. It's really annoying for my players :/ But I don't see why my minecraft server is down when running the cheksum I have 12 x 3.4 ghz cores I thought that would fix such problems xD
@beleg It's an I/O issue more than a raw performance issue. The only way to fix it via hardware would be to use an SSD for storage. Theoretically it might be possible to alleviate the issue with a second ramdisk that acts as a storage buffer. I.E. copy the live world files from the active ramdisk to the backup ramdisk, re-enable saving, then copy the data from the backup ramdisk to the disk in the background. Since the I/O ops would complete much more quickly between two ramdisks, your server would probably continue to run just fine (albeit with a short lag spike). Though that's just a thought, really. It increases the chance of data loss and rsync really is the better solution for large world files. At any rate, as I mentioned before rsync is at the top of the feature list.
I've implemented a preliminary fix for this issue, and it's available in the development branch. If running the stop command fails, just run it again a few seconds later and it should properly unload and unmount the ramdisk (for sure this time). Just grab the script from this link: https://github.com/Codeprogrammers/codecraft-init-script/zipball/develop Quite a bit has changed in the script though. All the configuration is done in a separate file which is stored in the /etc folder as it rightfully should. @Fronix & @beleg Should have rsync support here within the next two weeks. I won't promise anything since I've got a few other projects that just landed in my lap, but it looks like a definite possibility for the time-being.
@Toasty, I don't know if the script is bugged but for some reason the ramdisk isnt on /mnt/ramdisk any more its loaded on /home/<uname>/servers/<myserver>/ramdisk and in there i can only find a map called worlds with a checksum.rar in it. And i also had to create a new directory called ramworlds? I'm very confused here, my server is starting to crash because of insufficient space, and I'm assuming that it means the ramdisk is getting full because it creates new directory backups IN the ramdisk but renaming them to the date,time and seconds.
Since you've got a new folder called "ramworlds" I'm going to assume you're using the development version I linked to previously. As I mentioned earlier, a lot has changed. Configuration is now done in a separate file stored in the /etc directory, so make sure to take a look at that and configure the script properly. The version you're using is basically alpha quality and hasn't been tested, so expect it to be buggy until we've had time to polish it up a bit and release a beta version. At any rate, the new folder, "ramworlds" is where you should store any worlds that you want to be loaded into the ramdisk. This enables you to only put specific worlds into the ramdisk, instead of being forced to put all of your worlds in the ramdisk. Don't worry about making symbolic links for anything as the script will now handle that for you. Make sure to put the path to your worlds folder in your bukkit.yml file under the "world-container:" option. If the option isn't there, just add it in somewhere under the "settings" section. For example, my bukkit.yml file has "world-container: /opt/codecraft/worlds" under the settings section. There's also a new setting in the config file. Previously, I had the script use tmpfs for the ramdisk and this wasn't configurable. Now (thanks to Paswaru) there's an option to use either ramfs or tmpfs. The difference being that tmpfs will only use the amount of RAM set in the "RD_SIZE" option, while ramfs will start out at that size and grow accordingly. If your ramdisk is running out of space, either increase the RD_SIZE option (for tmpfs), or use the ramfs option. Just keep in mind that ramfs doesn't have a limit on it's growth, so it could cause your whole system to run out of available RAM and freeze/crash. As for your issue with the ramdisk folder being in the wrong place, I tested out the script on my dev server and didn't have any issues, so it's probably due to an improper configuration or permissions issues. Make sure that the new config file is correct for your server, and that the user you're running bukkit under has ownership and r/w privileges to the proper directories. The documentation won't be updated until we push the code to a release branch, so you'll have to bear with it for now.
@Toasty Okay I fixed my problem now. Thank you for replying so fast, im looking forward to the new releases.
Unless you have a reasonable amount of spare memory, tmpfs is by far the better choose between the two. tmpfs can be swapped to disk if your system starts becoming low on memory. Ramfs can't be swapped, so once your system runs out of memory, the kernel is going to be very unhappy to say the least. On the other hand, tmpfs is a fixed size device, so if your world files grow to fill up the drive. Java is going to throw an exception and CraftBukkit is going to be very unhappy. Either way, keep an eye on your system when using a ramdisk. I have an idea to check the free space/memory and if it gets critically low, having it stop CraftBukkit as a safe guard to both situations. I just need to find the time to write and test the code.
@Toasty, okay we have had some real issues with the dev version. I'm not sure exactly if this really happens but players are saying that the world is rollbacking when the server is online (not sure that is even possible). And these ramdisk folders are really making me confused, and why a backup on worlds and ramdisk? What is the difference :O
There should be a folder called "ramdisk" that only appears while the server is running, if the ramdisk option is enabled. If you want a specific world to be loaded into the ramdisk, put it in the "ramworlds" folder. If you don't want a world taking up space in the ramdisk (a less heavily trafficked one, for example), just put it in the "worlds" folder. If the ramdisk option is not enabled, all worlds in both folders will still be loaded up, just not in a ramdisk (obviously). As for the backup options: 'backup worlds' will back up all the worlds on your server, ramdisk or not. 'backup ramdisk' basically takes a snapshot of the ramdisk at that point in time. Anything, worlds or otherwise, that may reside in the ramdisk will be backed up. I don't know why the worlds would roll back while the server was online. Seems like a bukkit/plugin issue, possible related to I/O. Could also be a permissions issue, or something related to configuration, or even a performance problem. I wouldn't be able to tell you much more than that without detailed information of your setup.
Ok major noob here so be warned....i think i followed the instructions to the point and when i started my init script with screen it sayed mounting ramdisk loading ramdisk and then the screen terminated...now i figured it didnt work but i can see that my minecraft is running. However im not sure im running on a ramdisk because when i stop my server everything gets saved ...even though i havent set up that cron thing yet. Another thing when i try to use ./minecraft rdbackup I get the message /etc/init.d/minecraft {start|stop|restart|status|worldbackup|rdbackup} . TLDR how can i be sure that my ramdisk is running properly PS. what is the lock file, im not really sure where i should make the directory to this go
Ok figured it most out minus the lockfile. Had a problem with ramdisk unmounting before it unloaded so i incresed the sleep time seemed to fix it for now. Also figured out the commands to backup (didnt realize they changed). however im not sure if this is intended or not but everytime i stop the server or backup it saves as a different name instead of overwriting the existing file this is a problem with my server as we have multiple maps and it adds up space fast, so i was wondering if there was a way to set the script up to overwrite or set up a seperate script to delete the old backups/saves to clear out space.
The script is still in development. We plan on having the script automatically cull backups according to adjustable parameters, but for now you'll have to delete unnecessary ones yourself. As far as backups are concerned, best practices often suggest you keep multiple ones, so don't delete them just because they're old. I'd suggest you keep at least the 5 previous backups. If your worlds are exceedingly large, you could get by with just the previous two backups. We've been having a couple of issues with the lockfile. What OS are you using? (i.e. Ubuntu/Debian or CentOS/RHEL)
and its not a problem so much as i dont know what it is/ where to point it Ah nvm seems there is a file by that name in that location not really sure how it got there but there is a minecraft file in /var so i guess its working...just not sure what it does
Assuming your using the non-developmental release. Change line 65 from Code: lockfile="/var/lock/minecraft" to Code: lockfile="/var/lock/subsys/minecraft"
i'm unable to run this script on a user without root privileges, the error message is: mount: must be superuser to use mount i've got this in /etc/fstab Code: none /mnt/minecraft/ramdisk ramfs user,noauto,ro 0 0 can i get some help with this?
Only root users can mount and unmount file systems. This is a security feature built into most distributions of Linux. The script is designed to be called as a root user (as stated in step three of the setup guide). The bukkit/minecraft server process itself will be run as the user you specify in the config (not root), as will the screen session. You do NOT need to put the mount in fstab. In fact, there's a good chance that putting that in fstab will cause issues with the script (the script expects to be able to both mount and un-mount the ramdisk).
oh ok thanks for clearing this up, i didnt realize that it was made to be ran from root i just thought you ran it that way, hopefully this keeps others from making the same mistake. i appreciate your work on this, its been very helpful.
@Toasty, Okay the develop version doesn't work very well any more. I try to get only my /world/ map to be loaded into the ramdisk but instead all of my maps gets loaded in there. My folder setup: In ramworlds i have my /world/ map and its also in the /worlds/ folder but still all my maps get loaded into ramdisk.
We reverted that feature in the development branch (i.e. only load specific world into ramdisk using folders). I re-implemented that feature in the feature-ramworlds branch by cherry-picking some older commits. Also, just to give everyone a heads up, development is currently on hold again (and has been for a couple weeks now). I'll get back to this when I'm not busy.
Thank you, I really liked the option to choose what map to put it ramdisk. The only option now is rdiff backups and rsyncing