From Osgrid Wiki
Jump to: navigation, search

This weeks class will teach you how to maintain your regions, update them, and teach you how to make backups of your data. As you need to. !

 * Goals for this class : 
 * learning to maintain your installation
 * Generating backups & updating regions

If you did all steps in the previous classes correctly, you run your own region on OSgrid now. Either on SQLite database, or on MySQL / other. Typically the simulator itself only generates logs, and needs little maintenance, apart from you looking at those logs and fixing broken stuff. Last week we fine tuned the ini settings a bit, all is up and running happily. Your in your region, everything works, and suddenly some red and yellow text appears in console. Yay!

Let's start by saying that the verbose logging in the simulator does not require you to to "resolve" everything it reports. A lot of what it logs, even when it looks like a warning (yellow) or Error (red), will not impact you, your user experience inworld, or your visitors. Like stated before, a lot of logs are just systems interacting, and sometimes there is a fluke. For example, if your neighbors region is not reachable, you periodically get a yellow warning logged. This does not mean you can / need to take action, as there is very little you can do about it. As long as notifications do not bother you, you can ignore them. Now this is obviously not the "best practice", but until you have gained sufficient knowledge of databases, simulators and code, you're more likely for break things than fix them. If you are qualified to do so, you're unlikely to read this basic guide.

Red errors can be show stoppers, and generally indicate something is seriously failing. If you run into these, at least see if you can extract what is failing, and try to resolve it / find how to fix it. You can read back the errors in opensim.log, and try to extract from it what is failing. To understand what is logged and when, you need to know what happens in the process. When we start OpenSim.exe, this reads OpenSimDefaults.ini. This file provides “reasonable” default configurations. That’s why you can start a standalone sim on your own desktop without a configuration file these defaults are there to let you start running OpenSim immediately. Then OpenSim reads all your “overrides” in the OpenSim.ini. This means that you should never touch OpenSimDefaults.ini (it gets updated with each successive version anyway) and just make whatever changes you need on OpenSim.ini. When that INI is processed, OpenSim will look for extra configuration files, called includes, for additional configurations and add them as well.

Upgrading happens frequently, (mostly monthly) and the only "major issues" you can run into are usually the configuration files. The defaults can change from version to version. So you can simply get your “old” configuration files and just drop it in the new environment, but names might have changed, what used to be the default is now turned off, new options have been added, or old options are made obsolete. Effectively meaning; if you want to properly configure your Simulator at an update, you have to open the old configuration files (OpenSim.ini / GridCommon.ini / osslEnable.ini / Regions.ini) and check them against the new ones manually, line by line, to make sure you have covered everything you need. Mind that major changes by OSgrid (think of switching to a different physics engine, or major configuration changes) are always posted on this URL : http://news.osgrid.org

Now typically a region needs little maintenance if you keep it up to date. This as you install a new version monthly, which is effectively your maintenance cycle. If you make IAR (inventory) and OAR (region) backups frequently, and save them on different disks / partitions/ cloud, you should be fine in case a 'disaster' occurs. Now for those of you that expected an in depth explanation on how we manually clean tables and UUID's from a database, i have to disappoint you. In my 6 years of OpenSim, my 25 regions and over 150.000 prims are exactly there where i put them, and i never touched our optimized my database. ( did migrate disks & swapped databases twice ). Motto : If it works, don't fix it. If you didn't break it, and it stopped working after some update, don't fix it, unless some major change is reported and you can expect different behavior.

So, what do we do for Maintenance, starts with backups using OpenSimulator's built in inventory archive-tools  :

In either case, we need exports of my regions in their current state. For that we will need OAR's to be generated of all regions, in your simulator type :

 change region "your regions name"
 save oar name_of_your_export.oar

(Note that we use "quotes" around the region name and the region name may be case sensitive depending on your operating system) Rinse and repeat for each region on each instance, upload/copy OAR files to the cloud/usb stick/etc. (For convenience, save a copy of every instance's GridCommon.ini / Regions.ini / OpenSim.ini /osslEnable.ini along with the OAR's).

we also want all the data in our MySQL database to be dumped to a file, which we can later load in a fresh MySQL instance if needed. You can use mysqldump to export the database to a .sql file:

 mysqldump -u Myusername -p NameofMyDatabase > OSgriddata.sql

Upload/copy the SQL file to your cloud/usb stick/etc.

Now were going to make sure all our Servers are up to date for all regions. We install fresh copy's of OSgrid's latest release in a new folder, and after checking them for major changes, we overwrite our configuration files with the previous ones we saved earlier. Download Here

When we also want a backup copy of our inventory, we first sit down, and clean it out. Sort it in folders. Make it manageable. Especially if it's huge this can be a tedious and time consuming job, but you will love yourself for it later. Importing a "clean & sorted" Inventory is very satisfactory. So delete stuff that generates errors / does not work / you no longer need. Ask yourself if you will ever rez those 7000 "primitives" and 1800 "Objects" to see what they are. If not, now is the moment to get rid of that nagging question forever. Throw it out, in the trashbin with it. Once done take the next steps.

  • -empty trash in your viewer.
  • -login to OSgrid website, and in profile, empty trash too.
  • -wait 15 minutes, relog viewer

Now all of that is done, we have a clean and organised inventory, without trash. This is the moment to "pull an IAR"

to save your entire inventory

 save iar first last "/" password filename.iar

to save your Objects folder

 save iar first last "Objects" password Objects.iar

to save your photo album

 save iar first last "Photo Album" password Photos.iar

Upload/copy to cloud/usb stick/etc. (Note the use of "quotes" around the inventory path, this is a good habit to have as "Photo Album" is not the same as Photo Album)

This completes the maintenance cycle. The updates are monthly, and the IAR only needs to be done once every 4 -6 months / as frequent as you consider relevant. Mind that if you have multiple sims and regions, much of this process can be automated. You can either use the functions in your operating system to "launch" commands on timed intervals, but you can also use the modules in OpenSimulator itself. If we look at the code below, which you could put in OpenSim.ini :

     ;; default is module is disabled at the top level
     AutoBackupModuleEnabled = true
     AutoBackup = true
     AutoBackupInterval = 1440
     AutoBackupNaming = "overwrite"
     AutoBackupDir = "X:\opensim\backups\"

This suggests the simulator can generate an OAR all by itself. The module is off by default, but can be enabled and configured to your needs. Now how do we know of all these functions ? Keep track of the OSgrid Forums & the OpenSimulator Wiki where know how is shared between users and where data on how things work is posted.

Mind that if you want something, mostly it's quite possible to have your way. And often it's easy, but sometimes you just have to pioneer yourself a way to your goal. There was always someone before you trying this too, so typically it only involves bashing google with very specific search terms, for possible solutions of that other person that tried something similar. One page you should definitely read is this page. http://opensimulator.org/wiki/Server_Commands I was planning to copy paste the lot in here, but it's a bit much. It will however give you a lot more control over your simulator, and its capabilities. Read through it. You don't need to know it by heart. Just know its there.

If you don't like the 'chatty' log level, or your log file tends to get very big, you can overwrite the OpenSim.exe.config in your bin folder with the copy you find in the optional folder inside the .zip (it is below your BIN folder. Not in it. Below it !). Only do this after you make sure your sim is up and working as it should ! There is a lot of tweaks for logging that you can set yourself in this file, which includes seeing all logging (at debug level), or disabling most of it altogether. You can find details on the parameters of this file in the OpenSimulator wiki, and configure it to your liking in case you don't like the default settings. Mind that if your OpenSim.log grows too big, you can safely just delete it before you start your simulator, the server will write a new one if none is present.

Now obviously some people have questions on running standalones or grid mode. For that we strongly recommend this page in which you will also find much of the data as posted in these courses. Mind that some data on those pages can have become outdated and/or irrelevant. But they also contain info you will not read about anywhere else.