Installation and administration

System requirements

Software requirements

Operating systems

There are NitrosBase distributions for the following operating systems:

  • Windows Server 2016 and later, and Windows 10;
  • Ubuntu 16.0 and later.

Software libraries

There are the following ways to connect to NitrosBase:

  • via С API,
  • via С# API,
  • via ODBC,
  • using MS SQL Reporting Services.

Respective libraries and drivers are included in the distributions. Runtime environments needed for these librariers to function should be deployed on a machine where NitrosBase is installed.

Otherwise, one has to use the testsql utility (included in the distributions for both Windows and Linux).

TIP

See also the «Connectors and APIs» document for more details.

Hardware requirements

  • CPU cores: 4 or more,
  • CPU frequency: 2.0 GHz or more,
  • RAM: 16 GB or more,
  • HDD free space (SSD is preferable) — 128 GB or more.

Installation

TIP

NitrosBase distributions are portable. It is sufficient to unpack the archive anywhere in the file system.

Linux and Windows distributions are almost equivalent structurally and functionally unlike otherwise stipulated explicitly.

Folder structure

Unpacked distribution contains the following folders:

  • bin — server and client executables, auxiliary libraries;
  • data — demo database data;
  • docs — documentation;
  • include — C/C++ headers;
  • lib — client libraries and drivers;
  • samples.c++ — code samples.

Windows ODBC driver installation

Unlike the Linux NitrosBase distribution, the Windows one contains the ODBC driver. In order to install the driver, run Windows shell (cmd.exe) as an administrator, then change directory to bin and run nb_odbc_install.bat.

In order to uninstall the driver, run nb_odbc_uninstall.bat.

Demo databse deployment

Execute two shell files consequently
(.sh files under Linux, .bat files under Windows).

start runserver.bat

After that, the server will be started and the sntest1 database will be created.

sntest_prepare.bat

The sntest1 database will be filled with data.

Now one can check workability using the testsql utility:

echo select name,lastname,age from person limit 10 | testsql.exe -m speed -t nb -d sntest1 -H 127.0.0.1 -P 3020 -i -v 

NitrosBase server

The NitrosBase server maintains the database and handles requests to it. A single server maintains a single database. In order to maintain multiple databases, one should start multiple servers.

Syntax

server.exe -c create|open|close -d <dbname> [-p <datapath>]
[-n <cluster_node>] [-m worker|watchdog] [-b] [-P <port>] [-N nodes..]
[-R <restorepath>]

--help или -h      -- help  
    
--command=<action>
 -c <command>  	  -- command:
                     create - create new database and start server for it
                     open   - start server for database specified
                     close  - stop server of database specified
--dbname=<dbname>
 -d <dbname>   	  -- database name (see also notes about cluster mode)

--dbpath=<path>
 -p <path>     	  -- path to directory with database files

--clusternodes=<nodes>
 -N <nodes>       -- (cluster mode) number of cluster nodes

--node=<cluster_node>
 -n <cluster_node> -- (cluster node)
                      node number (from 0 to cluster_nodes-1);
                      that number will be added to the database name
                      from the <dbname> parameter; after e.g. -n 1 -d dbfoo
                      the database name will be dbfoo1.
--mode=<mode>
 -m <mode>     	  -- working mode:
                     supervisor - watchdog mode, restarts server
                     automatically every time failure occurs (default)
                     worker - no restart after failure
--background
 -b            	  -- process will be started in background mode

--port=<port>
 -P <port>     	  -- TCP port listened by server

--restorepath=<restorepath>
 -R <restorepath> -- path to directory with backups

Thus, the server has three commands (create, open, close) and two modes (supervisor, worker):

NitrosBase client

The testsql utility is used as a client (the utility also may be used as a client of other DBMSs).

Syntax

testsql -h

testsql -m compare
-t dbtype1
(-c connstr1|-d dbname1 -h host1 -u user1 -p pw1 -P port1)
-t dbtype2
(-c connstr2|-d dbname2 -h host2 -u user2 -p pw2 -P port2)
(-q query|-i) [-v]

testsql -m speed|shell
-t dbtype
(-c connstr|-d dbname -h host -u user -p pw -P port)
(-q query|-i) [-v]

-h                      -- help

-m compare|speed|shell  -- mode:
      compare - compares query execution against
                different DBMSs
      speed   - profiles query execution speed
      shell   - interactive mode

-t odbc|mysql|pgsql|nb  -- DBMS, "nb" for NitrosBase

-d dbname               -- database name
-H hostname             -- database host name
-u username             -- database user name
-p password             -- database user password
-P port                 -- server TCP port
-c <connstr>            -- connection string, instead of -H -u -p -P -d
-q <query>              -- query to execute
-n <iterations>         -- repeats query N times
-i                      -- reads query from standard input
-v                      -- outputs query results; always on
                           in compare 'compare' and 'shell' modes