Database Settings/de

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Verwenden verschiedener Datenbankeinstellungen für verschiedene Dienste)
(Verwenden verschiedener Datenbankeinstellungen für verschiedene Dienste)
Line 141: Line 141:
 
'''Hinweis: Diese Konfiguration ist sehr fortgeschritten und muss sowohl für die ROBUST-Konfiguration als auch für die Standalone-Version (was hier impliziert wird) aktualisiert werden.'''
 
'''Hinweis: Diese Konfiguration ist sehr fortgeschritten und muss sowohl für die ROBUST-Konfiguration als auch für die Standalone-Version (was hier impliziert wird) aktualisiert werden.'''
  
'''Für größere Grids ist es sehr zu empfehlen, die Service auf mehrere Datenbanken aufzuteilen.'''
+
'''Für größere Grids ist es sehr zu empfehlen, die Dienste auf mehrere Datenbanken aufzuteilen.'''
  
 
Momentan gibt es mehrere Dienste in OpenSimulator.
 
Momentan gibt es mehrere Dienste in OpenSimulator.

Revision as of 04:07, 31 January 2019

Wenn Sie die Vorgehensweise für das Datenbank-Setup schnell kennenlernen möchten, finden Sie weitere Informationen unter #Quick Setup.

TODO: Diese Seite muss zum Einrichten der Datenbanknutzung in Robust verbessert werden, obwohl die Konfigurationsparameter mit den Dateien StandaloneCommon.ini / GridCommon.ini identisch sind.

Contents

Struktur

Bei OpenSimulator 0.7.1 und höher müssen Sie StorageProvider und ConnectionString so einstellen , dass OpenSimulator eine Verbindung zu einer Datenbank herstellen kann. Normalerweise müssen Sie StandaloneCommon.ini für Standalone oder GridCommon.ini für den Rastermodus bearbeiten.

In diesen Dateien finden Sie den Abschnitt [DatabaseService]. Hier wird die Datenbank konfiguriert. Es gibt eine Reihe von Einträgen. Die einzigen Einträge, die unkommentiert werden sollten (durch Entfernen des Semikolons am Anfang), sind diejenigen, die für die gewünschte Datenbank zutreffen. Alle anderen müssen auskommentiert werden (indem Sie ein Semikolon vor der Zeile einfügen).

Beispiele

MySQL

Für MySQL kommentieren Sie die erforderlichen Zeilen und konfigurieren sie entsprechend. Zum Beispiel die Zeilen

StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensimdb;User ID=opensim;Password=h0tgrits;Old Guids=true;"

In diesem Fall wird eine Verbindung zu einer MySQL-Datenbank namens opensimdb auf demselben Rechner hergestellt, auf dem der Simulator (localhost) läuft. Der Benutzer, der sich verbindet, ist opensim mit dem Kennwort h0tgrits.

PostgreSQL

Für PostgreSQL kommentieren Sie die erforderlichen Zeilen und konfigurieren sie entsprechend. Zum Beispiel die Zeilen

StorageProvider = "OpenSim.Data.PGSQL.dll"
ConnectionString = "Data Source=localhost;Database=opensimdb;User ID=opensim;Password=h0tgrits;Port=5432;"

In diesem Fall wird eine Verbindung zu einer PostgreSQL-Datenbank namens opensimdb auf demselben Computer hergestellt, auf dem der Simulator (localhost) ausgeführt wird. Der Benutzer, der sich verbindet, ist opensim mit dem Kennwort h0tgrits. Wenn Sie die Portnummer in der PostgreSQL-Installation geändert haben, können Sie die Verbindungszeichenfolge "Port = 5432" hinzufügen, wobei 5432 in den installierten Port geändert werden kann.

  • Das PostgreSQL-Datenbankmodul ist nicht in Version 0.7.6. Es ist immer noch am Rande des Quellcodes.

SQLite

SQLite ist etwas anders. Stattdessen würden Sie die Zeile unkommentieren (oder unkommentiert lassen).

Oder Sie können andere INI-Dateien einschließen. Sie finden eine solche Zeile:

Include-Storage = "config-include/storage/SQLiteStandalone.ini";

Nach dem Lesen dieser INI-Datei werden dann die Dateien config-include / storage / SQLiteStandalone.ini gelesen. Wenn Sie die Datei SQLiteStandalone.ini öffnen, finden Sie in den einzelnen Abschnitten StrageProvider- und ConnectionString-Zeilen. Da SQLite keine Einrichtung von Benutzern oder Kennwörtern erfordert, müssen keine weiteren Einstellungen vorgenommen werden, es sei denn, Sie möchten, dass sqlite andere Dateinamen für seine Datenbanken verwendet.

MSSQL

HINWEIS: Die MSSQL-Unterstützung wird in OpenSimulator 0.8.1 aufgehoben, da sie seit mehr als 2 Jahren nicht gewartet wurde und Fehler und Unterstützung für die neuesten OpenSimulator-Funktionen fehlen.

ANMERKUNG: Es gab eine andere Möglichkeit, eine Verbindung zur MSSQL-Datenbank herzustellen, die "mssql_connection.ini" im Verzeichnis bin / verwendet. Bei OpenSimulator 0.7.1 oder höher wird es NICHT gelesen, auch wenn Sie es richtig eingestellt haben. Verwenden Sie ConnectionString stattdessen in * Common.ini. Weitere Einzelheiten finden Sie im Abschnitt #MSSQL.

Database Parameters

Parameter Possible Values Description
StorageProvider "OpenSim.Data.SQLite.dll" (SQLite)
"OpenSim.Data.MySQL.dll" (MySQL)
"OpenSim.Data.PGSQL.dll" (PostgreSQL)
"OpenSim.Data.MSSQL.dll" (Microsoft SQL Server)
"OpenSim.Data.Null.dll" (disable persistence)
Der Name der Speicheranbietermodule, die sich in bin / folder befinden. Die drei oben genannten werden von OpenSimulator offiziell unterstützt (obwohl MSSQL teilweise ist). Wenn Sie "OpenSim.Data.Null.dll" wählen, behält OpenSimulator alle Daten in seinem Speicher, anstatt DBMS zu verwenden.
ConnectionString See #ConnectionString Syntax Eine Zeichenfolge, die OpenSimulator Informationen zu einer Datenquelle angibt. Normalerweise kann es den Hostnamen oder die IP-Adressen des Datenbankservers, die Datenbankservicenamen, den Benutzernamen, den Schemanamen und das Kennwort enthalten. Die Syntax variiert zwischen Datenbanken.
EstateConnectionString See #ConnectionString Syntax Entspricht ConnectionString, wird jedoch nur für den Estate Service verwendet. (wahlweise)

ConnectionString Syntax

MySQL

Data Source=[1];Database=[2];User ID=[3];Password=[4];Old Guids=true;

  • [1] The hostname or ip address of database server
  • [2] Database name
  • [3] Username for the database above
  • [4] Password for the user above

Example: If you have created the database "opensim" in localhost, and then created the user "opensimuser" and its password is "opensimpassword", it will be:

ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensimuser;Password=opensimpassword;Old Guids=true;"

PostgreSQL

Data Source=[1];Database=[2];User ID=[3];Password=[4];Port=[5]

  • [1] The hostname or ip address of database server
  • [2] Database name
  • [3] Username for the database above
  • [4] Password for the user above
  • [5] Port number for the server (default=5432)

Example: If you have created the database "opensim" in localhost, and then created the user "opensimuser" and its password is "opensimpassword", and the server port number is 5435 it will be:

ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensimuser;Password=opensimpassword;Port=5435"

SQLite

URI=file:[1],version=3,UseUTF16Encoding=True;

  • [1] The path to the database file (relative to the bin/ directory - If there is no file on this path, it will be created automatically)

Example: If you want to create the database for Inventory Service in the directory "bin/db", it will be:

ConnectionString = "URI=file:db/inventory.db,version=3,UseUTF16Encoding=True"

MSSQL

Server=[1];Database=[2];User Id=[3]; password=[4];

  • [1] "servername\instance name" - You can see this string in SQL Server Managerment Studio login dialog(Server:).
  • [2] Database name
  • [3] Username for the database above
  • [4] Password for the user above

Example: If you have installed Microsoft SQL Server Express Edition with default settings on your local machine , created the database "opensim" in localhost, and then created the user "opensimuser" and its password is "opensimpassword", it will be:

ConnectionString = "Server=localhost\SQLEXPRESS;Database=opensim;User Id=opensimuser; password=opensimpassword;"

Verwenden verschiedener Datenbankeinstellungen für verschiedene Dienste

Hinweis: Diese Konfiguration ist sehr fortgeschritten und muss sowohl für die ROBUST-Konfiguration als auch für die Standalone-Version (was hier impliziert wird) aktualisiert werden.

Für größere Grids ist es sehr zu empfehlen, die Dienste auf mehrere Datenbanken aufzuteilen.

Momentan gibt es mehrere Dienste in OpenSimulator.

  • [InventoryService]
  • [AssetService]
  • [AvatarService]
  • [AuthenticationService]
  • [UserAccountService]
  • [GridUserService]
  • [FriendsService]
  • [EstateDataStore]
  • [SimulationDataStore]
  • [PresenceService]
  • [AuthorizationService]
  • [GridService]

Sie können für jeden Dienst eine andere Datenbank verwenden, indem Sie die StorageProvider- und ConnectionString-Eigenschaften überschreiben, wie wir im Abschnitt "Allgemein" [DatabaseService] oben gesehen haben. Wenn Sie beispielsweise MySQL 'opensim' im Allgemeinen, MySQL 'opensim2' für Inventory Service und MSSQL für Authentication Service verwenden möchten, müssen Sie beispielsweise in StandaloneCommon.ini Folgendes schreiben:

[DatabaseService]
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
...
[InventoryService]
ConnectionString = "Data Source=localhost;Database=opensim2;User ID=opensim;Password=***;Old Guids=true;"
...
[AuthenticationService]
...(another parameters for authentication service)...
StorageProvider = "OpenSim.Data.MSSQL.dll"
ConnectionString = "Data Source=(local);Database=opensim;User=opensim;password=********;"

Wenn OpenSimulator StorageProvider oder ConnectionString nicht in den Abschnitten der einzelnen Services finden kann, werden die im Abschnitt [DatabaseService] angegebenen verwendet. Wenn OpenSimulator alle gefunden hat, wird der Parameter in den Abschnitten der einzelnen Dienste verwendet. Die Einstellungen in diesen Abschnitten überschreiben dann die Einstellungen im Abschnitt [DatabaseService].

In diesem Fall führt der Inventarservice Folgendes aus:

  • read [DatabaseService]StorageProvider
  • read [DatabaseService]ConnectionString -> read [InventoryService]ConnectionString and override

Der Authentifizierungsdienst wird:

  • read [DatabaseService]StorageProvider -> read [AuthenticationService]StorageProvider and override
  • read [DatabaseService]ConnectionString -> read [AuthenticationService]ConnectionString and override

Hinweis: Anbieter von SQLite und MSSQL unterstützen einige Dienste nicht.

Hinweis: Für den Estate Service gibt es einen weiteren Parameter EstateConnectionString in [DatabaseService]. Dies ist die mittlere Priorität zwischen [DatabaseService] und [EstateDataStore] ConnectionStrings. OpenSimulator liest ConnectionString zuerst im Abschnitt [DatabaseService], als nächstes EstateConnectionString, schließlich ConnectionString im Abschnitt [EstateDataService] und überschreibt.

Quick Setup

SQLite Walkthrough

By default, OpenSimulator will automatically create its SQLite database files(*.db) in bin/ directory. You don't need to do anything generally. If you want to create the database files in another directory, you can change by editing ConnectionString in bin/config-include/storage/SQLiteStandalone.ini included by config-include/*Commons.ini. See #SQLite section for the detailed syntax.

MySQL Walkthrough

Bitte lesen sie die Anleitung für mysql speziell für ihr Betriebssystem.

Empfehlen kann ich die Ubuntu Anleitung für Linux: https://wiki.ubuntuusers.de/MySQL/

Bei Windows kann auch xampp benutzt werden (Bitte beachten sie die Warnungen): https://www.apachefriends.org/de/index.html

Ansonsten befolgen sie bitte die Anleitungen von Microsoft.

Download

Download and install "MySQL Community Server" from MySQL Downloads Page. On Linux, you can even fetch "mysql-server" or "mysql-community-server" with your native package manager.

Installing MySQL Server

On Windows: Download MSI and run it. Select "Typical". After installation, it will launch "MySQL Server Instance Configuration Wizard". Select "Standard Configuration". In the next screen, you might be happy later if you check "Include Bin Directory in Windows PATH". In the next screen, provide mysql root password. It will complete settings for mysql and startup its service automatically. See MySQL Documentation for more details.

On Mac OS X: Download DMG package and install it normally. After install the server package, you can even install MySQL Startup Item if you want MySQL to start automatically during system startup. After that, startup your MySQL by following commands. See MySQL Documentation for more details.

MySQL must be configured to use UTF8 as its default character set. In the config file /etc/my.cnf (Linux) or my.ini (Windows), add these settings:

 [mysqld]
 character-set-server=utf8

 [client]
 default-character-set=utf8

And it's ready to run.

 $ cd /usr/local/mysql
 $ sudo ./bin/mysqld_safe
 (enter your password, if necessary)
 (press ctrl-Z)
 $ bg
 (press ctrl-D or enter "exit" to exit the shell)

On Linux: RPM install the downloaded package or install "mysql-server" or "mysql-community-server" with your package manager. For more instructions for installation, see MySQL Documentation. After that, startup your MySQL with following command.

$ /etc/init.d/mysqld start

If you want to startup MySQL server automatically, see 2.10.1.2. Starting and Stopping MySQL Automatically in MySQL 5.5 Reference Manual.

Creating MySQL Database

Now you can configure your MySQL with the command line tools.

$ mysql -u root --password
(enter your password, or if you haven't set password for MySQL server, type "mysql -u root" instead)

You can even use MySQL Command Line Client on Start menu on Windows. After login, create user and database for OpenSimulator.

mysql> create database opensim;
mysql> use opensim;
mysql> create user 'opensimuser'@'localhost' identified by 'opensimpassword';
mysql> grant all on opensim.* to 'opensimuser'@'localhost';
mysql> quit

Configuring OpenSimulator

Open StandaloneCommon.ini or GridCommon.ini with your editor. First, comment-out the line for SQLite.

; SQLite
;Include-Storage = "config-include/storage/SQLiteStandalone.ini";

After that, uncomment StorageProvider and ConnectionString property lines in [DatabaseService] section and change the line like that:

; MySql
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensimuser;Password=opensimpassword;Old Guids=true;"

Note that "Data Source=localhost;" actually specifies a TCP socket. If your MySQL server is set up to refuse remote connections (i.e. with skip-networking enabled) you'll need to replace "localhost" with the path to MySQL's UNIX socket.

ConnectionString = "Data Source=/var/run/mysqld/mysqld.lock;Database=opensim;User ID=opensimuser;Password=opensimpassword;Old Guids=true;"

You can find the path to the socket that your MySQL server is using with mysqladmin.

$ mysqladmin -p -u root version

Save and start OpenSimulator. It will access to your new MySQL database instead of the default SQLite databases.

PostgreSQL Walkthrough

Download

Download and install PostgreSQL server from PostgreSQL Downloads Page. On Linux, you can even fetch "postgresql" with your native package manager.

MSSQL Walkthrough

Download

To download Microsoft SQL Server 2008 Express edition: [1] Make sure you download Microsoft SQL Server 2008 Express with Tools ([2]) since you will likely want a nice tool to work with your database. If you already downloaded Microsoft SQL Server before, skip to "Checking Instance Configurations" step.

Installing Microsoft SQL Server

Double-click the downloaded executable and select click Installation and "New SQL Server stand-alone installation or add features to an existing installation". It will start installation process, you only need to click "OK", "Next" or "Install" until you come across the "Feature Selection". In this screen, you need to check "Database Engine Service" and "Management Tools - Basic", then click "Next". In next screen "Instance Configuration", check what is filled in "Named instance:" property - you will later use this later. For example, for default Express Edition, you'll see "SQLEXPRESS". Click "Next". Then go on default until you reach "Server Configuration". In this screen, fill in Account Name and Password field with you windows login name and password. In next "Database Engine Configuration" screen, you will need to enable Mixed Mode. After that provide password, click "Add Current User", and then continue clicking "Next" or "OK" until it completes the installation process. After that, you'll find the entry "SQL Server Managerment Studio" in "Microsoft SQL Server 2008" on the Windows Start menu. Open it and click "connect" to connect to your instance.

Checking Instance Configurations

Right-click on your database server in Management Studio and select Properties, then go to the Security tab and select SQL Server and Windows Authentication mode, click OK. If you have already installed SQL Server before and you find "Windows Authentication mode" enabled instead, change it.

Creating User for Database

Expand the Security node, then right-click the Logins node. Select "New Login..." to open "Login - New" dialog. In this screen, fill "Login name" with the string whatever you like, select "SQL Server authentication", give it a strong password, uncheck "User must change password at next login", and click "OK". In this tutorial, we'll assume you have typed "opensimuser" for Login name, and "opensimpassword" for password.

Creating Database

Right-click on the Databases node and and select "New Database..." to open "New Database" dialog. In "Database name" field, you provide any names for the new database, which we'll assume is "opensim". In "Owner" field, provide the name of newly created database user("opensimuser" in this tutorial). Accept all defaults and click "OK".

Configuring OpenSimulator

Open StandaloneCommon.ini or GridCommon.ini with your editor. First, comment-out the line for SQLite.

; SQLite
;Include-Storage = "config-include/storage/SQLiteStandalone.ini";

After that, add these line in [DatabaseService] section. As of OpenSimulator 0.7.1, there is no sample configurations for MSSQL(Microsoft SQL Server), so you need to add them by yourself.

; MSSQL
StorageProvider = "OpenSim.Data.MSSQL.dll"
ConnectionString = "Server=localhost\SQLEXPRESS;Database=opensim;User Id=opensimuser; password=opensimpassword;"

Save and start OpenSimulator. It will access to your new SQL Server database instead of the default SQLite databases.

Additional Settings

MySQL

MySQL's own configuration is handled in its my.ini file (found in "C:\ProgramData\MySQL\MySQL Server x.y" on recent versions of MySQL on Windows) or my.cnf file (found at /etc/mysql/my.cnf on Ubuntu Linux systems, for instance).

In general, the default configuration is fine for OpenSimulator. However, you may want to check the max_allowed_packet size. Very large objects, such as linksets with a very large number of parts or large mesh objects may generate OpenSimulator assets that exceed the default BLOB size that MySQL can store. On Ubuntu the max_allowed_packet size is 16M, which should be fine. On Windows MySQL it can be set larger. In early versions of MySQL the default is 1M which may be too small. Windows 5.6 MySQL default is 4M.

Notes: OSGrid maximum asset size is reported as 45MB at May 2013. Openvue grid maximum asset size is reported as 16MB as at May 2013.

To change this setting, one would add a line like the following in the [mysqld] section of the my.ini or my.cnf file. E.g.,

max_allowed_packet  = 16M

On Ubuntu 14.04.1 with MySQL latest, this setting was already found to be 16M.

Personal tools
General
About This Wiki