You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction


The article describes how to configure a new synchronization between the r_keeper_7 databases

The minimum version of r_keeper_7 for synchronization to work is 7.6.4.

Synchronization Description


Interaction scheme


To enable synchronization, specify the setting below in the server ini file.

[DBSYNC]

UseDBSync = 1

After starting in this mode, the directory server will create a file rk7.udb.SQLite next to the rk7.udb base file and a folder in which it will store backup copies, log files and a filtering configuration file for transferring to client applications.
By default, this is the DBSync \ outgoing folder in the database folder.

The transmission to client applications occurs over the network. Network access to this folder is provided using the WebDAV protocol. For WebDAV to work, each server runs nginx, access to which is automatically passed through the server's HTTP interface. If a static ReqSourceURL is not specified in the ini files of client applications, the client applications by default find out the host and port for connecting to it from the server themselves, connecting to it by the network name.

The scheme of interaction of modules in synchronization 2.0 is presented below:

Synchronization setup


Open the directory server settings file - rk7srv.INI and add the UseDBSync = 1 setting to the [DBSYNC] section. There is no default section, so you need to specify it too.

Save the file and start the directory server.

Open the manager station.
Go to Settings> OLAP Reports> Report Servers
Select your report or reference server. In the properties, check the Use Free Listen Port box
In the HTTP API configuration section, HTTP Restrictions section, select HTTP Access from the drop-down list

If you don't know how to specify privilege on an object: HTTP Access - read the article Configuring Interfaces.
Save the settings and restart the server.
The DBSync folder will appear in the RK7 \ base \ folder, containing the outgoing folder. In outgoing, the directory server will accumulate backup copies and log files for transfer to client applications.
Register the same setting in other applications: report server, cash register server and cash registers.
Save the configuration files and run the applications.

Synchronization check


You can view the folder with a browser to check the synchronization. To do this, open a link of the form:

https: // http_host: http_port / rk7api / v1 / dbsync /
http_host is the IP address of the desired server. In our case, this is 127.0.0.1
http_port - server port. It is set in the [TCPSOC] section. If not specified, you can find out by opening the web interface - for this, click on the tray icon 2 times with the left mouse button.
For example, for a directory server:
For example, let's open the link https://127.0.0.1:54318/rk7api/v1/dbsync/ - my directory server. Instead of port 54318 - specify your own.

An authorization window will appear.

Specify a username in Latin with the HTTP_Access privilege and a password.
Click Login. A list of files in the folder will appear:
If the list appears, synchronization is working. Additionally, you can check the synchronization by changing the name of the dish in the menu and check it at the cash register.

Similarly, you can check the cash register server and the report server.

Synchronization stop handling, online database update


In the [DBSYNC] section, you can write additional settings that control the synchronization mode.
The StopSyncAction parameter is used on the cash register server and on the report server to indicate what they need to do if synchronization is stopped - for example: the directory server or the upstream report transit server is disabled.
In the corresponding config files:

rk7srv.ini - for the directory server
repsserv.ini - for the report server
In the [DBSYNC] block, you must write StopSyncAction = and the following of 3 values:

Nothing - the server will create an entry in the log about stopping synchronization

[DBSYNC]
StopSyncAction = Nothing
RestartApp - the server will create an entry in the log about stopping synchronization, then automatically reboot

[DBSYNC]
StopSyncAction = RestartApp
ReloadReferences - the server will create an entry in the log about stopping synchronization, update the backup and download the collections. A more recent version of the r_keeper 7 database will be kept.

[DBSYNC]
StopSyncAction = ReloadReferences


Description of ini files


Directory Server


Directory server settings file - rk7srv.INI

DBSync]; Enabling the maintenance of the second SQLiteCMN database for the general (main) and local reference databases,
; and recording their log files and backups for the database synchronization mechanism to work.
; After starting in this mode, the directory server will make the rk7.udb.SQLite file next to the rk7.udb base file
; and the folder where backups, log files and filtering settings file will be stored
; for transferring to client applications. For more details, see the description of the OutputPath parameter below.
; By default, this is the DBSync \ outgoing folder in the database folder.
; Network access to this folder is automatically provided by the WebDAV protocol,
; for which each server runs its own nginx, access to which is automatically forwarded
; through the server's HTTP interface. If a static ReqSourceURL is not set for them in the ini of client applications (see below),
; By default, client applications find out the host and port for connecting to it from the server themselves, connecting to it using the network name.
; To check, you can connect to this folder, for example, with a web browser, using a URL like https: // <http host>: <http port> / rk7api / v1 / dbsync / UseDBSync = 1
 
; The folder into which the generated bakap files, log files and the filtering settings file will be placed.
; It is possible not to set it, since by default it is the DBSync \ outgoing \ folder next to the file of its own directory database
; directory server. Client applications take files from it to update their databases.
; They can access it either through the built-in WebDAV, or directly as a folder in the file system, or in any other way.
; OutputPath = <DataBasePath> DBSync \ outgoing
 
; Make a backup through so many transactions. By default, every 1000 log files.
; BackupOnVersionsDelta = 2000
 
; After accumulating what is the total size of the log (as a percentage of the size of the last backup) to make a new backup.
; By default, 30% - new back

Report Server


Report server settings file - repserv.ini
[DBSync]
; Enabling receiving backups, logs and filtering settings file from an upstream server for synchronization
; with it its main database of reference books, as well as the inclusion of maintaining a second database SQLiteCMN for local reference books,
; and recording its log files and backups for the database synchronization mechanism to work.
; After starting in this mode, the report server will create the DBSync \ outgoing folder next to the rk7.udb base file,
; in which it will accumulate backups, log files and a file of filtering settings for transferring to its client
; applications, as in the main database of directories, received from the upstream server and applied to their own database,
; and on the local base, generated when editing local directories on this server. UseDBSync = 1
; For the outgoing folder settings, see the description of the analogous section of the directory server parameters.
; Access to the OutputPath folder on the upstream server can be opened via the WebDAV protocol and by third-party means,
; in this case, in the ReqSourceURL parameter, you need to specify the URL from where to request (Request) data.
; ReqSourceURL = http: // <serverIP>: <WebDAVPort> / rk7api / v1 / dbsync
; If this parameter is empty, downloading via the WebDAV protocol will be disabled.
; This is useful if the upstream server is located on the same computer or in a local network, and it is possible
; give access to its outgoing folder directly by means of the file system.
; ReqSourceURL =
; To balance the load on the network and servers, you can set how many seconds the download processes via WebDAV should wait
; between requests to the server about the appearance of a new log file or a new backup. The default is an interval of 2 seconds.
; ReqInterval = 2
; To balance the load on the network and servers, during the download process via WebDAV, you can adjust
; how many percent of the backup size should the log files be in order for this backup to be downloaded at the start of the client's work,
; and these log files were not downloaded and rolled.
; The default is 100 percent: if the required log files are larger than the backup, the backup will be downloaded.
; If you specify 200, then the log files must be 2 times larger than the backup, so that the download of the backup was selected,
; and if you specify 50, the backup can be 2 times more logs, but the backup is downloaded.
; Choose a value for this parameter based on your network speed, the speed at which the log files are applied,
; system slowdown when using a large number of log files, etc.
; ReqStartLoadBackupMultiplier = 100
; By default, when connecting via WebDAV, backups for the OutputPath folder are made locally, taking into account the settings
; conditions for taking backups and regardless of servers. Therefore, they are obtained not for the same data versions for which backups
; filmed on other servers. If there is a need for synchronization of backups or to reduce some of the loads,
; made it possible to enable the mode of receiving backups by downloading them from an upstream server. It is disabled by default.
; ReqToDownloadBackups = 0
; The folder (relative to the exe file) from where backups and log files from the nearest upstream server will be taken
; to update your database. By default, it is set equal to <DatabasePath> DBSync \ incoming
; If the ReqSourceURL parameter (see above) is not set empty, then files will be downloaded to it via WebDAV.
; If ReqSourceURL is empty, then here you can specify the path to the DBSyncOutputPath folder of the upstream server
; reference books or reports, if it is located in the same network or on the same computer, or to a copy of it received
; from a remote server using any third-party tool.
; InputPath = <RefServerBaseFolder> \ DBSync \ outgoing
; The folder into which the processed backup and log files will go. The files of the database of local directories will also be written there.
; It can be omitted, since by default it is the <DatabasePath> DBSync \ outgoing \ folder next to the report server reference database file.
; OutputPath = <DataBasePath> DBSync \ outgoing
; The mode when the report server will delete the processed files from the InputPath folder after copying them to the OutputPath.
; This is useful if they are downloaded to the InputPath folder personally for a given report server.
; If an upstream server outbound folder is specified as an inbound folder, and it is shared by multiple clients,
; this mode is not appropriate, and the upstream server itself monitors the cleaning of this folder.
; In this regard, if InputPath = <DataBasePath> DBSync \ incoming then by default RemoveProcessed = 1, otherwise 0.
; RemoveProcessed = 0
; To exchange files via http, you can set a system user with a password
; For http server:
; ServerLoginInfo =: <Password>
; For http client:
; ReqSourceLoginInfo = [<User>]: <Password>
; <User> - for external WebDAV servers only. To connect to RK7 servers, there is no need to specify <User> (the network name will be used)!
; The same as on the directory server
; BackupOnVersionsDelta = 2000
; BackupOnJournalSizeMulti


Cash server


POS server settings file - RKEEPER.INI
[DBSync]
; See the description of a similar section of the report server parameters, bearing in mind that the database of local directories on the cash register server is also taken exclusively from the upstream server.
[CONFIG]
; See the description for a similar section of report server parameters.

Cash register and printing station


POS and print station settings file - wincash.ini and winprint.ini
[DBSync]
; See the description of a similar section of the report server parameters, but the parameters responsible for filling and cleaning the OutputPath folder and performing backups are ignored
[CONFIG]
; The path to your own folder for the database of POS directories.
; A cash register in database synchronization mode will also have its own database, and must understand where to put it.
; If not specified, the application folder will be used.
BasePath = ..
; Instead of the DBSyncMoveToOutput parameter used on servers, the checkout station has the name DBSyncRemoveProcessed
; This is the mode when checkout processed files from the DBSyncInputPath folder will be deleted after processing.
; This is useful if they are transferred to the DBSyncInputPath folder by some third-party mechanism, personally for this checkout.
; By default 1 if DBSyncInputPath = <DataBasePath> + 'DBSync \ incoming', otherwise 0.
; DBSyncRemoveProcessed = 0
; For the rest, see the description of a similar section of the cash register server parameters.


  • No labels