Configuration
From OpenSimulator
m (→Multiple regions) |
(→Standalone vs. Grid) |
||
Line 11: | Line 11: | ||
==Standalone vs. Grid== | ==Standalone vs. Grid== | ||
− | + | We recommend that you first get OpenSim running in standalone mode before you attempt to connect it to a grid, either your own grid or a public grid. An OpenSim configuration consists of regions (run by region simulators) and 4 core backend services (users, grid, assets and inventory, commonly known as ugai). | |
− | A | + | A system running in standalone mode runs a single region simulator and all 4 core services in a single executable (called OpenSim.exe with OpenSim.ini configured such that gridmode = false). This region simulator can provide multiple regions (much like a webserver can serve multiple websites). |
+ | |||
+ | In grid mode, the 4 core ugai services are started as separate executables. This means that they can be run either on the same machine or spread out across multiple computers. Multiple region servers can be hooked up to these core services. | ||
+ | |||
+ | Naturally, this means that running in grid mode is more complicated than running in standalone mode. This requires an understanding of UUID, X,Y location, server handshake passwords, master avatar first/last/password and a couple of other settings. These are not difficult, but do require a little care in setting up. | ||
+ | |||
+ | If you want to run a local grid of your own you would start these core services up before connecting a region simulator. If you want to connect your region server to a grid that someone else is running, you need only start the region server in grid mode (with the necessary security keys and location information mentioned in the last paragraph). | ||
OpenSim.exe responds to various command line arguments. These include "-inifile", "-configfile", "-gridmode", "-physics", "-config" & "-noverbose". When starting OpenSim in either Windows or Linux, one can add "-physics=OpenDynamicsEngine" to run the OpenDynamicsEngine instead of basicphysics. Most users in standalone mode will not add any command line arguments. For local grid or public grid, the "-gridmode=true" is usually the only argument used. The rest are for more advanced configuration. | OpenSim.exe responds to various command line arguments. These include "-inifile", "-configfile", "-gridmode", "-physics", "-config" & "-noverbose". When starting OpenSim in either Windows or Linux, one can add "-physics=OpenDynamicsEngine" to run the OpenDynamicsEngine instead of basicphysics. Most users in standalone mode will not add any command line arguments. For local grid or public grid, the "-gridmode=true" is usually the only argument used. The rest are for more advanced configuration. |
Revision as of 07:26, 31 July 2008
Contents |
OpenSim configuration file
The simulator configuration is managed using a file called OpenSim.ini. This file is used regardless of whether the sim is running in standalone or grid mode. Detailed information on the options available for setttings in this file can be found here.
Database
Opensim's supports the following database-engines:
- SQLite (default - a lightweight database that comes bundled with OpenSim and can be used without requiring any extra configuration)
- MySQL (fully supported)
- MSSQL (partially supported - some recent OpenSim features may not yet be implemented)
More information on database-support can be found on the OpenSim Database support page.
Standalone vs. Grid
We recommend that you first get OpenSim running in standalone mode before you attempt to connect it to a grid, either your own grid or a public grid. An OpenSim configuration consists of regions (run by region simulators) and 4 core backend services (users, grid, assets and inventory, commonly known as ugai).
A system running in standalone mode runs a single region simulator and all 4 core services in a single executable (called OpenSim.exe with OpenSim.ini configured such that gridmode = false). This region simulator can provide multiple regions (much like a webserver can serve multiple websites).
In grid mode, the 4 core ugai services are started as separate executables. This means that they can be run either on the same machine or spread out across multiple computers. Multiple region servers can be hooked up to these core services.
Naturally, this means that running in grid mode is more complicated than running in standalone mode. This requires an understanding of UUID, X,Y location, server handshake passwords, master avatar first/last/password and a couple of other settings. These are not difficult, but do require a little care in setting up.
If you want to run a local grid of your own you would start these core services up before connecting a region simulator. If you want to connect your region server to a grid that someone else is running, you need only start the region server in grid mode (with the necessary security keys and location information mentioned in the last paragraph).
OpenSim.exe responds to various command line arguments. These include "-inifile", "-configfile", "-gridmode", "-physics", "-config" & "-noverbose". When starting OpenSim in either Windows or Linux, one can add "-physics=OpenDynamicsEngine" to run the OpenDynamicsEngine instead of basicphysics. Most users in standalone mode will not add any command line arguments. For local grid or public grid, the "-gridmode=true" is usually the only argument used. The rest are for more advanced configuration.
Standalone mode
When you start OpenSim in standalone mode, it will ask you several question at the console. The first set of prompts that start with "NETWORK SERVERS INFO", you can just hit return to accept the defaults if you will be running in standalone mode. The prompts that start with "DEFAULT REGION CONFIG" are where you need to start paying attention. Some are self-explanatory. Here are explanations for the others:
- Grid Location. OpenSim regions can be placed anywhere on a 65536 by 65536 grid. In standalone mode, it is safe to leave these X and Y locations at their defaults.
- Filename for local storage. Safe to leave at default.
- Internal IP address; This should always be 0.0.0.0
- Internal IP port for incoming UDP client connection. You can make this any port you want, but it is safe to leave at the default 9000.
- External host name. If you will only be attaching to your sim from a SecondLife client on the same machine, you can leave this at the default 127.0.0.1. If you will be wanting to connect to it from a client on another machine, this should be the IP address or hostname of the machine you are running this sim on. To connect to your new sim, start up secondlife with the following command line switches:
-loginuri http://127.0.0.1:9000/ -loginpage http://127.0.0.1:9000/?method=login
This assumes you are running the secondlife client on the same box. If you are running it on a separate box, substitute the IP address of your sim machine.
To create a user:
type create user <first> <last> <password> <x_loc> <y_loc> in the server console.
Grid mode
You want to run your own grid. Great! Assuming that you already got your sim running in standalone mode, here is what you need to do:
1. Current builds of OpenSim grid mode are using mysql to store the grid information. You must have this installed and configured if you want to run your own grid. See mysql-config for more information.
2. The servers should be started in a certain order. UGAIS: UserServer, GridServer, AssetServer, InventoryServer, Sim. These are all found in the bin directory. In windows, you can just double-click on the executables to start them. In Linux and Mac OS X type mono file name from a prompt. The executable names are:
OpenSim.Grid.UserServer.exe OpenSim.Grid.GridServer.exe OpenSim.Grid.AssetServer.exe OpenSim.Grid.InventoryServer.exe OpenSim.exe
3. Start the UserServer. If you will be running the GridServer on the same box, hit enter to accept the defaults, until it gives you the prompt
OpenUser#
This is the main prompt for the user server. If you will be running the GridServer on another box, change the Default Grid Server URI as appropriate.
4. Start the GridServer. Again, you can hit return at all the prompts if you are running them all on the same machine. If not, change the URIs for the Asset Server and User server to point to where you are running them. You will finally get to the console prompt for the GridServer which looks like this:
OpenGrid#
5. Start the AssetServer. The console prompt for this server will be:
OpenAsset#
6. Start the InventoryServer. The console prompt for this server will be:
INVENTORY#
7. If you are running all of these servers on the same box, which would be the normal configuration. You should be ready to start up your sim. Since the OpenSim.exe starts up by default in standalone mode, you will need to give it a command line switch to tell it to use gridmode instead:
OpenSim.exe -gridmode=true
or:
mono OpenSim.exe -gridmode=true
With any luck, everything will come up without too many errors.
8. Go to the UserServer console, and type 'create user' to create a new avatar. It will prompt you for the name and password, and the X and Y of the sim that should be his home location. Use 1000 and 1000, or wherever you told your sim to live when you brought it up in standalone mode. At the console of any of these servers, you should be able to type 'help' to get a list of commands.
You should now be able to connect to your new grid with your secondlife client. You need to tell your client to point at the UserServer rather than directly at the sim, though:
secondlife -loginuri http://127.0.0.1:8002/
8002 is the default port for the UserServer, and that IP address should be changed to the server you are running the UserServer on, if they are not all on the same box.Happy OpenSimming!
Note: if you are using Windows Vista, remember to start servers as Admin. If not it will prompt you an error in console like "Error - Access denied"
Multiple regions
Using Physical Prim with the OpenDynamicsEngine on *nix, it's recommended that you set your stack reserve level higher then default with the following command; ulimit -s 262144 Or, run the opensim-ode.sh to start up OpenSimulator.
For running multiple regions on the same box, you simply make multiple copies of the 'default.xml' file inside the bin/Regions/ directory. You can do this using the script make.php in share/regions, or you can generate the files by hand.
The fundamental distinction between regions is the UUID (sim_UUID), region name (sim_name), x and y region coordinates (sim_location_x and _y respectively), and port assignment (internal_ip_port).
If you want to create the files by hand:
- first copy the default.xml file in the bin/Regions directory, and name them anything you want (I name mine x.y.xml, where x znd y are the grid coords.)
- Open each xml file and edit the uuid (each must be unique, a generator can be found at uuidgen webpage or use uuidgen), region name, x & y positions, datastore (if you are using the prim thing) and internal ip port. EACH OF THESE MUST BE UNIQUE!
Note that sim_location_x and sim_location_y should be adjacent integers if you want your regions to be adjacent, so you will be able to run back and forth between them. IMPORTANT: THESE GRID COORDINATES ARE NOT IN METERS. THEY ARE SIM POSITIONS. (1000, 1000) is next to (1001,1000), (1000, 1001), and so forth. 1256, 2000, 2048 and similar values are not adjacent to 1000, they are very far away, so you will not see your sims if you use them.
Once you have 2 or more xml files in the regions folder, running a single copy of OpenSim.exe will boot all of your sims! If you come across any errors, there is most likely an error in the xml files.
As of 6-Feb-2008, take care NOT to leave editor backup copies of the files in this directory e.g. emacs style backup names like Regionname.xml~. These are loaded by opensim.exe as if they are extra legitimate region descriptions, and will therefore give errors indicating you are trying to re-use the socket for that region.
Attaching your sim to someone else's grid
To set up the simulation server (i.e., OpenSim.exe) to connect to an external grid, you should edit the OpenSim.ini file in the bin directory. In that file, there is a [Network] section with URLs for the grid, user, and asset servers, as well as send and receive keys (for a basic level of security). The addresses and send/receive keys will vary depending on the grid you are connecting to, and the grid operator should tell you what values to use.
The other file you may have to change is in your bin/Regions directory. This is where your individual region config files are. If you only have one region, it will by default be called default.xml.
This can be edited with any text editor. The grid owner may tell you what X and Y location you can place your sim at (you can't have multiple sims at the same location on the grid). If so, the fields you will need to change in this file are sim_location_x and sim_location_y. And the external_host_name should be set to the hostname or IP address of your simulation server (i.e., the machine that is running OpenSim.exe). A list of public grids that you can attach your sim to is at OpenSim: Grids
Running
StandAlone
Windows
cd bin OpenSim.exe
On Windows Vista, it may be necessary to explicitly "Run as administrator" for opensim.exe to accept connections from a client, even when running as an administrator user. Navigate to the opensim\bin directory, right click opensim.exe, and select "Run as administrator". Connect: opensim://localhost:9000 , or opensim://127.0.0.1:9000, or opensim://myipadress:9000
Linux
cd bin mono OpenSim.exe
OSX
cd bin mono OpenSim.exe
Local Grid
Windows
cd bin OpenSim.Grid.UserServer.exe OpenSim.Grid.GridServer.exe OpenSim.Grid.AssetServer.exe OpenSim.Grid.InventoryServer.exe OpenSim.exe
Linux
cd bin mono OpenSim.Grid.UserServer.exe mono OpenSim.Grid.GridServer.exe mono OpenSim.Grid.AssetServer.exe mono OpenSim.Grid.InventoryServer.exe mono OpenSim.exe
OSX'
cd bin mono OpenSim.Grid.UserServer.exe mono OpenSim.Grid.GridServer.exe mono OpenSim.Grid.AssetServer.exe mono OpenSim.Grid.InventoryServer.exe mono OpenSim.exe
Connect: opensim://myipaddress:9000