05. Working in Grid Mode

Up to now, I have had my OpenSim region operating in Standalone Mode. It is now time to get it working in Grid Mode, in readiness for connecting to the OSGrid. I had a few problems getting this mode to work, but advice from Jenni in the #opensim irc channel had me up and running in no time. Here is the finished working procedure:

Step 1. Configure Opensim
Make a copy of your OpenSim.ini file, and rename the copy to OpenSim.ini.standalone (so you can go back later if you wish). Open your OpenSim.ini file, and in the [Startup] section make gridmode=true, then in the [Network] section change the following keys from 'null' to '1234' as follows: grid_send_key = "1234" grid_recv_key = "1234" user_send_key = "1234" user_recv_key = "1234" Save the OpenSim.ini file.

Step 2. Launch the UGAIM Services
In the bin folder, locate the following 5 server services, named the UGAIM services, after their initial letters:

OpenSim.Grid.UserServer.exe
OpenSim.Grid.GridServer.exe
OpenSim.Grid.AssetServer.exe
OpenSim.Grid.InventoryServer.exe
OpenSim.Grid.MessagingServer.exe

Starting with the first (and the order is important), double-click to launch it. The console will pause to ask you some questions. You can accept the defaults for all, except the following:

Answer 1234 for all questions involving keys

Database connection string should look like this:
Data Source=localhost;Database=opensim;User ID=root;Password=xxxxxxx;

Note: I would type this database connection string out in advance, in notepad, then copy it to the clipboard, as you will have to paste this in to each of the 5 consoles, and will save you some work). Don't forget the final semicolon!

The UserServer will then generate an xml file (UserServer_Config.xml) with these settings in, which you can open in Notepad and edit. I only wanted to change the default_startup_message="Welcome to OGS" to "Welcome to Anubia"

Then start each of the other services, in the order given, accepting all the defaults, except answering 1234 for all questions involving keys. As with the UserServer service, xml files will be generated for each service.

Step 3. Launch OpenSim.exe.
When it has finished loading, you can connect.

Step 4. Configure the Viewer
To connect to your region in gridmode, you must make a change to your viewer. In SL, change the port number at the end of the Target from 9000 to 8002. Similarly, if you are using Hippo, go into Grids, select your grid (region) and change the Login URI port number from 9000 to 8002. You are now ready to connect.

Strangely, I failed to connect at first. On the second attempt (after a full restart of all the above services) I then got in, but only for a couple of seconds before the viewer crashed. Restarting the server services once more, and logging in with my viewer produced, 'You are already logged in' messages, but I persisted and kept trying to login, and restarting everything. Curiously, on the third or fourth attempt, everything worked, and I was in!

Reverting
If you wish to revert to Standalone Mode, rename the OpenSim.ini file to OpenSim.ini.gridmode, and rename your OpenSim.ini.standalone file back to OpenSim.ini. Then change your Port number on your viewer from 8002 back to 9000, and you should be good to go (but again, strangely, it took me 2 or 3 attempst to get back in properly). You do not need to change any of the keys from '1234' back to 'null'.

The next tutorial will show you how to connect to the OSGrid.

26 comments:

  1. Standalone is working great, always with latest SVN-revision and MySQL (Linux/Mono). Now, trying Gridmode after reading all the recipes and examples, UGAIM starts fine, but starting my usual region with "mono OpenSim.exe -gridmode=true" stops with the error:

    [... snip ...]
    23:32:19 - [OGS1 GRID SERVICES]: Exception while attempting to listen on TCP port 8895.
    23:32:19 - [APPLICATION]:
    APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs
    Exception: System.Net.Sockets.SocketException: No such host is known
    [... snip ...]

    I guess there is some config problem... maybe with the region settings...? And no, the port 8895 is not used by any other application.

    Thx & greetings, Salvi

    ReplyDelete
  2. Works Great!!! Thanks a lot for this nice tutorial.

    ReplyDelete
  3. Sorry but all server starting good, but OpenSim.GridServer crashing always, can i ask why? i post the error

    seconds
    2009-03-08 16:53:21,834 INFO - OpenSim.Data.MySQL.MySQLGridData Connecting to DB... [9]
    2009-03-08 16:53:21,839 INFO - OpenSim.Data.MySQL.MySQLManager [MYSQL]: Connection established
    2009-03-08 16:53:21,841 DEBUG - OpenSim.Data.MySQL.MySQLManager [REGION DB]: Connection wait timeout 28860 seconds

    ReplyDelete
  4. i have the same trouble ... working on windows vista 342-bit without uac

    all server starting but bor the GridServer because connection timeout

    ReplyDelete
  5. Sorry but all server starting good, but OpenSim.GridServer crashing always, can i ask why? i post the error

    seconds
    2009-03-08 16:53:21,834 INFO - OpenSim.Data.MySQL.MySQLGridData Connecting to DB... [9]
    2009-03-08 16:53:21,839 INFO - OpenSim.Data.MySQL.MySQLManager [MYSQL]: Connection established
    2009-03-08 16:53:21,841 DEBUG - OpenSim.Data.MySQL.MySQLManager [REGION DB]: Connection wait timeout 28860 seconds


    I have the same problem, anyone can be help? :(

    ReplyDelete
  6. "Sorry but all server starting good, but OpenSim.GridServer crashing always, can i ask why? i post the error

    seconds
    2009-03-08 16:53:21,834 INFO - OpenSim.Data.MySQL.MySQLGridData Connecting to DB... [9]
    2009-03-08 16:53:21,839 INFO - OpenSim.Data.MySQL.MySQLManager [MYSQL]: Connection established
    2009-03-08 16:53:21,841 DEBUG - OpenSim.Data.MySQL.MySQLManager [REGION DB]: Connection wait timeout 28860 seconds"


    I think I have solved this issue... delete "addin-db-001" folder and re-start "OpenSim.GridServer.exe", then it accepts your configuration and works!

    ReplyDelete
  7. deleting "addin-db-001" folder doesnt work for me. i have the same problem, GridServer is crashing all the time. running on a XP pro sp3 PC with mysql 5.

    ReplyDelete
  8. After 9 connection, grid server reports:
    "Unhandled exception: System.Exception: Resource 'CreateRegionTable.sql' was not found"
    *.sql then this is MySql script, but server created them dynamically or it should be in package?

    ReplyDelete
  9. Probably sounds like a broken record by now ... but yes, I also crash trying to bring up GridServer. Pretty much the same error reported by all of the above. Hangs after 9 connections, then VISTA politely breaks the bad news.

    ReplyDelete
  10. I may be wrong but I have found when running many games servers that Vista doesnt like certain DOS prompts etc.. I havent been able to run a single server on vista.
    Mine crashes at the opensim.grid.userserver.exe. It says it "creating 10DB connections....
    connecting to DB...[0]" then crashes. :(

    ReplyDelete
  11. I have the identical problem. OpenSim.Grid.GridServer crashes after MySQL atarts up the 10 threads.
    Last attempt was to use the MSSQL plugin, why does it want to do that?

    ReplyDelete
  12. It worked: thanks so much! :D

    ReplyDelete
  13. Identical problem here. OpenSim.Grid.GridServer crashes after MySQL stars the 10 threads. Maybe a Vista problem?

    ReplyDelete
  14. Hi Guys,

    This bugged me for ages too, but as ever i was simply missing a tiny detail - to enable the MySql database in OpenSim.ini as described funnily enough on the brilliant tutorial website.

    Here's the details that solved this for me:

    Go to the Opensim Bin folder, and in there you will find the Opensim.ini configuration file. Double-click it and it should open automatically in Notepad. You need to change the following lines (note: placing a semicolon(;) at the start of any line disables it by commenting it out, removing the semicolon enables the line):

    Under the ; ## STORAGE section look for the line that says (; --- To use sqlite as region storage:) Make sure that the plugin and connection lines are commented out, thus: ;

    storage_plugin = "OpenSim.Data.SQLite.dll" ; storage_connection_string="URI=file:OpenSim.db,version=3";

    Then look for the line that says (; --- To use MySQL storage, supply your own connectionstring (this is only an example):) And uncomment out the plugin and connection lines, thus:

    storage_plugin="OpenSim.Data.MySQL.dll"
    storage_connection_string="Data Source=localhost;Database=opensim;User ID=root;Password=XXXX;"; (replace the XXXX above with the password you use for MySQL)

    Next, go down to the [StandAlone] section, and in the Asset Database provider, make sure that only MySQL is uncommented, thus:

    ;asset_plugin = "OpenSim.Data.SQLite.dll"
    asset_plugin = "OpenSim.Data.MySQL.dll"

    User Database provider should all have ONLY the following uncommented, respectively: asset_source = "Data Source=localhost;Database=opensim;UserID=root;Password=XXXX;" inventory_source = "Data Source=localhost;Database=opensim;User ID=root;Password=XXXX;" user_source = "Data Source=localhost;Database=opensim;User ID=root;Password=XXXX;" again, replacing the XXXX with your MySQL password. Do make sure that the SQLite source lines are commented out, thus:

    ; asset_source = "SQLiteDialect;SqliteClientDriver;URI=file:Asset.db,version=3"
    ; inventory_source = "SQLiteDialect;SqliteClientDriver;URI=file:Inventory.db,version=3" ; user_source = "SQLiteDialect;SqliteClientDriver;URI=file:User.db,version=3" Save the Opensim.ini file.

    You should now be fit to go. Start the opensim server, and all the necessary databases will be created for you by MySQL.

    This worked for me and my entire system is up and running.

    I hope this fixes this issue for some of you.

    Best wishes,
    Peter

    ReplyDelete
  15. can any one help me i got grid mode working fin but when i log in with an acc made after grid mode i get "Unfortunately the session for this client on server has crashed. Any further actions taken willnot be processed. Please relog"but the acc i made on the standalone works fine (use MySQL for it from the start)

    EMAIL ME at chaosjarvinen@aim.com

    ReplyDelete
  16. I've followed every single step in the tutorials with maximum atention, of course, MySQL is enablend in Opensim.ini but no way... OpenSim.Grid.Gridserver crashes after MySQL starts 10 threads.

    I have googled for days trying to find a solution, in vain.

    Now giving up.

    ReplyDelete
  17. there are some common causes for these problems, but any one of them can cause all of these. So, here is a check list.
    1. make sure the IP addresses in your opensim.ini network section matches those in your UGAIM (user, grid, asset, inventory, messaging) XML configuration files. the format should be like this:
    "http://your IP address:8002"
    The number after the":" will be different for each of the servers. Watch out for extraneous punctuation like < % , $. they do not belong in here.
    2. inside the bin folder is a region folder. the XML file for each region you create includes an internal IP which should be 0.0.0.0, or 127.0.0.1, and an external IP address that should be 127.0.0.1 if you only want to access the grid from the machine that runs it, or the IP address of your machine if you need to get in from another computer. It helps if the external IP matches the network IP up to the port number after the ":" that is configured in the opensim.ini file
    3.There are a few places in the opensim.ini file where you need to configure the database you want to use, and its connection string. make sure they are all configured correctly.
    4. the user defined as the Master Avatar in the region xml files must be present in the user table of your database. you can use MySQL query browser or the command prompt to verify this. if not, you will need to create that account from the user server using the create user command, and filling in the first name, last name, and password. The Email is optional.
    5. if you have more than one region xml file, remember that each one needs to have a different UUID for that region, and that the UUID of the Master Avatar must match the one in its entry in the user table in the database.
    I hope this helps. If you need more help, contact me at:
    darkeagle6@hotmail.com
    or IM Darkeagle Darkstone in Second Life.

    ReplyDelete
  18. The last version I've downloaded was: osgrid.opensim-12092009,V0.6.9.dd5696e.zip .
    In the bin folder I only could find the MessagingServer and thee UserServer executables.
    In januari 2009 I'd downloaded also a version and I checked again but all in this turorial mention Server executables were in the bin folder.
    Is this page out of date or is there something wrong in the last download?

    Thanks in advance,
    Robert

    ReplyDelete
  19. Run in this order

    OpenSim.Grid.UserServer.exe
    OpenSim.Server.exe
    OpenSim.Grid.MessagingServer.exe

    I believe that OpenSim.Server.exe has replaced OpenSim.Grid.GridServer.exe, OpenSim.Grid.AssetServer.exe and OpenSim.Grid.InventoryServer.exe

    once there up just run OpenSim.32BitLaunch.exe and ypur up and running

    ReplyDelete
  20. works fine in stand alone, however says the user is already logged in. or the region couldn't be found. have replaced the IPs with my local IP. notice that asset_plugin is not in the example ini. have tried it with and without the asset_plugin lines in the opensim.ini

    i have tried a few distribution of opensim and followed various tutorials on how to get it up and running and i hit the same wall each time :/

    ReplyDelete
  21. 23:11:40 - [GRID CONNECTOR]: GetRegionByPosition 00000000-0000-0000-0000-0000000
    00000, 256000-256000 received invalid response
    23:11:40 - not found the region at 1000 1000

    23:11:40 - [LOGIN]: Home region of user bob bob is not available; using computed
    region position 256000 256000
    23:11:40 - [LOGIN]: Sending user to default region 1099511628032000 instead
    23:11:40 - [GRID CONNECTOR]: GetRegionByPosition 00000000-0000-0000-0000-0000000
    00000, 256000-256000 received invalid response
    23:11:40 - [LOGIN]: Sending user to any region
    23:11:40 - [LOGIN]: Region not available for login, System.NullReferenceExceptio
    n: Object reference not set to an instance of an object.
    23:11:40 - [LOGIN END]: XMLRPC informing user bob bob that login failed due to a
    n unavailable region

    ReplyDelete
  22. same error, running windows vista/AMD athlon x2. vista is up to date. opensim version 0.6.8 (vista hates 0.6.9 even in standalone for me).
    grid servers all load (user,gridserver,message) on log in i get :
    [GRID CONNECTOR]: GetRegionByPosition 00000000-0000-0000-0000-0000000
    00000, 256000-256000 received invalid response.

    Sending user to any region

    Region not available for login, System.NullReferenceExceptio
    n: Object reference not set to an instance of an object.

    region is up. region file is good. ive banged my head on this for three days now. after reading 25 pages and tutors on how this works im sure its a vista error. changing to XP and try again. seems either you run Linux or XP if you want it to run in grid/hypergrid. The dev's need to address vista problems. im almost sure its the system not the opensim set up.
    thanks for reading.

    ReplyDelete
  23. 256000-256000 => look, the region coordinates (1000-1000) are multiplicated by 256 !!

    ReplyDelete
  24. Alright an Issue.
    For the first time I actually got the other stuff working.
    But when I go to open Opensim.exe (the 32 bit vers) This Error comes up near the end.

    2010-06-06 19:58:29,750 DEBUG - OpenSim.Services.Connectors.GridServicesConnector [GRID CONNECTOR]: Registration failed: Region overlaps another region
    2010-06-06 19:58:29,765 ERROR - OpenSim.OpenSimBase [STARTUP]: Registration of region with grid failed, aborting startup - at OpenSim.Region.Framework.Scenes.Scene.RegisterRegionWithGrid() in d:\OSGRID\OSGRID RELEASES\opensim-bdeda18\OpenSim\Region\Framework\Scenes\Scene.cs:line 1567
    at OpenSim.OpenSimBase.CreateRegion(RegionInfo regionInfo, Boolean portadd_flag, Boolean do_post_init, IScene& mscene) in d:\OSGRID\OSGRID RELEASES\opensim-bdeda18\OpenSim\Region\Application\OpenSimBase.cs:line 362

    I am trying to make it so I have My own grid.
    And I used the OS Grid ready one as a base (was haveing to many problams with the actual) And i got everything else working.

    NOTE: I am using 0.6.9

    ReplyDelete
  25. I fixed the issue. I went back to base one. And Poked around. In MYSQL create a user named opensim with any pasword you like and so intead of having root as the user ID make it opensim.

    SHould Help :)

    ReplyDelete