-
Notifications
You must be signed in to change notification settings - Fork 11
Running ScalienDB as a Windows Service
Under Windows ScalienDB has the ability to be installed and run as a service. There are two kinds of Windows services that can be installed:
- Scalien Database Controller
- Scalien Database Shard Server
The type depends on the role
config file parameter.
First of all, you must be Administrator to install or uninstall services. To start an elevated command prompt go to Start menu, type cmd
and click on Cmd.exe while pressing Ctrl-Shift.
To install ScalienDB as a Windows service you can start it as you would normally, but you also have to add the --install parameter as the last parameter. E.g.
ScalienDB.exe controller.conf --install
Assuming that the config file contains the role=controller
setting, this will install the Scalien Database Controller service. If the config file contains the role=shard
setting, then the Scalien Database Shard Server service will be installed.
When running ScalienDB as a service, it is recommended that you set the dir
config file variable to the directory where the database is installed.
To uninstall ScalienDB, use the same command line but with --uninstall as the last parameter. E.g.
ScalienDB.exe controller.conf --uninstall
This command won't delete the database files, only removes ScalienDB from the list of Windows services.
After you installed the ScalienDB service you can start it from an elevated command line. To start or stop the controller, type:
net start ScalienController
net stop ScalienController
Similarly to start the shard server, type:
net start ScalienShardServer
You can also use the services.msc
command to start or stop services.
First, download the appropriate (32 or 64 bit) version of ScalienDB from here. Unpack the zip file to C:\ScalienDB
. Of course you can use other folder, but we will use this throughout our example.
Edit both controller.conf
and shard.conf
files (with Notepad or Wordpad) so that they have a line containing dir = C:\ScalienDB
. Open an elevated command prompt (see above), and enter the following two lines:
C:\ScalienDB\ScalienDB.exe C:\ScalienDB\controller.conf --install
C:\ScalienDB\ScalienDB.exe C:\ScalienDB\shard.conf --install
These commands install both the ScalienDB Controller and Shard Server as service. You can use the net start
command to start the services.