Database configuration

From NComputing Knowledge Base
Revision as of 00:47, 15 June 2015 by Admin (talk | contribs)

Jump to: navigation, search

NoTouch Center stores its data into a SQL database. The primary database is MySQL, but we also support Oracle and Microsoft SQL Server. Both the NoTouch Center Windows installer and the Stratodesk Virtual Appliance come with MySQL included, so actually the fact that a database is used is transparent to you and you don't have to worry about that.

If, and only if, you want to use an external database, be it another MySQL that you have installed somewhere, or an existing instance of Oracle or Microsoft SQL server this information is for you.

Database configuration information

The configuration information of which database to use is stored in the tcmgr.properties file. You find that file in the etc subdirectory of NoTouch Center's installation directory:

  • On Windows, the full path to the file is
  C:\Program Files\Stratodesk\NoTouch Center\lmc\etc\tcmgr.properties
  /opt/center/etc/tcmgr.properties

The tcmgr.properties file is a plain text file. Use any text editor like Notepad (Windows), vi or nano (Linux) to edit this file. Do NOT use Microsoft Word or generally speaking a word processor.

Edit the file only when NoTouch Center is stopped. Otherwise your changes will be overwritten by NoTouch Center when you restart it. To stop NoTouch Center,

  • Windows. Go to the "Services" overview and stop the "NoTouch Center" service or execute the "Stop NoTouch Center" link in the "NoTouch Center"->"NoTouch Center Control" start menu group as Administrator.
  • Stratodesk Virtual Appliance. Go to "Management" and click on the "Stop" link. If you are already logged in via SSH and have root privileges, type "stop center"

These are the relevant properties:

  • lmc.dbhost= DNS host name or IP address of the database server. Default: localhost
  • lmc.dbname=name of the database that will be used on the database server. Default: easyadmin
  • lmc.dbuser= username that is used to connect to the database. Default: easyadmin
  • lmc.dbpass=password of the database user. Default: easyadmin
  • lmc.dbtype= a string value denoting the type of database used. Default: mysql
    • mysql for MySQL
    • jtds for MS-SQL
    • oracle for Oracle
    • derby for Apache Derby (unsupported)
    • hsqldb for HSQL (unsupported)
    • hsqldbmm for HSQL in-memory (unsupported)
  • lmc.dbport=an optional TCP port number if it is non-standard for the given database type. Default: empty

External database operation

Database preparation

NoTouch Center needs its own "database" (sometimes referred to as tablespace or schema), and a user account name and password that has all privileges in this database, including modifying table definitions. Some databases call this "DDL administration".

By default, we suggest a database name of "easyadmin", a username of "easyadmin", and a password of "easyadmin".

MySQL

In MySQL, the commands to create and prepare such a database are:

  create database easyadmin;
  grant all on easyadmin.* to 'easyadmin'@'localhost' identified by 'easyadmin';

Microsoft SQL Server

In MS SQL Server Studio, first create a user named "easyadmin". Then right-click on the "Databases" entry in the tree view, and select "Create Database". Assign a name for your database (we suggest "easyadmin") and make sure the user "easyadmin" is chosen as the owner of the database.

Oracle

Please consult the Oracle documentation on creating users and tablespaces. If using Oracle XE, the database name will be hardcoded to "XE".

Initial set-up

When NoTouch connects first time to an empty database, it will create all database tables and fill in essential values needed for operation. Pay close attention to the log output (center.log or Console if starting in foreground). NoTouch Center will write clear and descriptive error messages to the log if it can not connect, there are configuration or database errors.

Disabling the built-in MySQL

Both the NoTouch Center Windows installer and the Stratodesk Virtual Appliance come with MySQL. If you use an external database, you can deactivate MySQL.

Stratodesk Virtual Appliance

  1. Login to the Virtual Appliance via Secure Shell and gain root privileges as described
  2. Stop the MySQL services by executing these command:
    • stop mysql
  3. Make sure MySQL stays deactivated:
    • echo "manual" >> /etc/init/mysql.override

Windows

When installing NoTouch Center with the easy Windows installer, you have the option to deselect MySQL during installation. If you disable the checkbox, MySQL will not be installed.

If you have already installed NoTouch Center including MySQL, simply disable the "NoTouch Center Database" service in the Windows Services overview.

Database migration

Sometimes people have to move their database to a new server, for whatever reasons. In that case you need to let NoTouch Center know about the change so that it can connect to and use its database.

Please always use your database servers tool to import and export. So for example if you move the NoTouch Center database from an older MS SQL server to a newer version on a different server, properly export it on the old one using the Microsoft SQL Server tools and and import it on the new one. Make sure user account, password and privileges are intact on the new system as well.

NoTouch Center does not support cross-migration from Oracle to MS SQL or vice-versa (there may be third-party tools though), but you can migrate both formats to MySQL. In fact, this is done automatically, if you migrate standalone NoTouch Center into Virtual Appliance.

If you have moved your database to a new server, please change NoTouch Center configuration according to the information below in this article.

NoTouch Center on Windows with an external database

Installation with an external database

Subsequently, during first connect with your browser to NoTouch Center, a dialog box will appear asking for a working database configuration. Please fill in the data to complete the installation.

Changing database configuration

  1. Log in to the Windows system locally or via RDP or any desktop sharing product
  2. Stop NoTouch Center service with the standard Windows services dialog
  3. Edit the file <Program Files>\Stratodesk\NoTouch Center\lmc\etc\tcmgr.properties with a standard text editor like Notepad
  4. Save and exit the text editor
  5. Start the NoTouch Center service

Stratodesk Virtual Appliance

VA deployment with an external database

  1. Deploy the Stratodesk Virtual Appliance as documented.
  2. Login to the Virtual Appliance via Secure Shell and gain root privileges as described
  3. Stop both the NoTouch Center service and the MySQL services by executing these command:
    • stop center
    • stop mysql
  4. Make sure MySQL stays deactivated:
    • echo "manual" >> /etc/init/mysql.override
  5. Start the NoTouch Center service again, intentionally making it fail to connect to its database:
    • start center
  6. Connect with your browser to NoTouch Center. A dialog box will appear asking for a working database configuration. Please fill in the data to complete the installation.

Changing VA NoTouch Center database configuration

  1. Login to the Virtual Appliance via Secure Shell and gain root privileges
  2. Stop the NoTouch Center service by executing this command:
    • stop center
  3. Open the NoTouch Center configuration file:
    • nano /opt/center/etc/tcmgr.properties
  4. Change these values:
    • lmc.dbhost
    • lmc.dbname
    • lmc.dbtype
      • mysql for MySQL
      • jtds for MS-SQL
      • oracle for Oracle
    • If necessary, also lmc.dbport (Port number; 0 should be fine), lmc.dbuser (database username), lmc.dbpass (database password)
  5. Save and exit by pressing Ctrl-X
  6. Restart NoTouch Center:
    • start center
  7. Check the screen for potential error messages