|
This section describes how to make LinkServer use another database engine. By default, LinkServer uses an embedded database engine that's good for small installations (up to 100 devices). For larger installations it's recommended to use some production-grade database server, such as MySQL, Oracle, Microsoft SQL Server, PosrgreSQL, or other database management systems. To learn more about how LinkServer uses the database, see the database section.
To switch LinkServer to another database engine, use the following procedure:
| 1. | Install and configure your database engine if it was not yet installed. |
| 2. | Create a new database in your database engine. This database will be used by LinkServer to store its data. You can call it linkserver or aggregate. |
| 3. | Create a new user account in your database engine. This account will be used by LinkServer to access the database. You can call it linkserver or aggregate. |
| 4. | Grant the new user account permissions for the LinkServer database. It will require permissions to CREATE and ALTER tables. Also, it must be able to INSERT, UPDATE, DELETE and SELECT data in all tables. |
| 5. | Shut down LinkServer if it's running. |
| 6. | Go to your LinkServer installation folder. |
| 8. | Write -classpath/a <JDBC_Driver_File_Path> in the first and only line of this file. JDBC_Driver_File_Path is the full path of JDBC (Java Database Connectivity) database driver file (or name of this file, if it is located in the LinkServer installation directory). This file usually has a .jar extension. For example, the JDBC driver for MySQL database engine is called MySQL-connector-java-X.X.XX-ga-bin.jar, where X.XX.XX is the driver version. The JDBC driver may be provided by the original maker of the database (Oracle etc), or by a third party. |
| 10. | Change the Database Driver Global Configuration Setting setting to the name of Java class representing the database driver. This name is provided by the JDBC driver manufacturer. For example, MySQL database driver class is called “com.MySQL.jdbc.Driver”. More information on Global Configuration Settings may be found here. |
| 11. | Set the Database URL Global Configuration Setting to point to your database engine. Its format is also provided by the JDBC driver manufacturer. For MySQL it has the following format: jdbc:MySQL://[host][:port]/[database], where [host] is the IP or hostname of the MySQL server (can also be an empty string or localhost), [port] is the port number on which the MySQL server is running (optional - the default port is used if it's not specified), and [database], which is the name the of database containing LinkServer data. You can use “LinkServer” for the database name. For example, if your MySQL server runs on 192.168.0.1, on the default port, use the following URL: jdbc:MySQL://192.168.0.1/LinkServer. |
| 12. | Specify the correct Database Username and Database Password Global Configuration Settings. These credentials are used to access the database specified by the Database URL setting. |
| 13. | Set the Database Dialect Global Configuration Setting to the predefined value corresponding to the type of your database. See Database Dialect global configuration setting for more info. |
| 14. | Save the new settings. Do not restart the server, even if you're prompted to do that. |
| 15. | Stop the server, then start it again with the “-c” command line switch. Under Windows, run “LinkServer.exe -c”. This switch will force LinkServer to create all required tables in the new database. |
| 16. | Wait until server startup finishes, stop it again and then restart it without the "-c" command line switch. |
| 17. | Voila! All done, you're now using your new, production-grade database, with new tables. |

|
Note that there is no way to automatically transfer all data stored in LinkServer database to a new database engine. It is recommended to switch to the production-grade database engine immediately after LinkServer installation in a commercial environment.
|
|