Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

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

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

Synchronization Description

Interaction

...

Procedure

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

[DBSYNC]

UseDBSync=1

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

The transmission Transfer to client applications occurs is performed 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 enabled by the WebDAV protocol. To work with WebDAV, every server runs the nginx that is automatically accessed through the HTTP interface of the server. If ini files of client applications do not have a static ReqSourceURL, the client applications by default find out individually request the host and port for connecting to it from the server themselves, by default when connecting to it by using the network name.

The scheme of interaction of modules Below is the module interaction procedure in synchronization 2.0 is presented below:

Synchronization

...

Settings

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

;;first line comment to avoid problems with BOM

[REFSERVER] Server = RK7TEST

UDBFILE = ..\..\base\rk7.udb

MainLang = .\localize\rkeeper7\rkeeper7.ru.xlf

AltLang = .\localize\rkeeper7\rkeeper7.en.xlf

WorkModules = ..\..\base\workmods

ErrorLogSize = 10485760

DisableSMARTVerify = 1

UseNetChecking=1

LicServerIP=l.ucs.ru:60606

Usesql=1


[DBSYNC]

UseDBSync=1


[NETKERN]

Protocols = tcpsoc.DLL

Save the file and start run the directory server.

  1. Open the manager station.
  2. Go to

...

  1. Settings > OLAP

...

  1. Reports > Report Servers
  2. Select your report server or

...

  1. directory server. In the properties, check the box Use Free Listen Port

...

  1. In

...

  1. the HTTP

...

  1. Restrictions section of the settings section HTTP API , select HTTP Access
  2. If you don't know how to

...

  1. create and configure the HTTP Access role, please check this section.
  2. Save

...

  1. settings and restart the server.

The DBSync folder The DBSync folder containing the outgoing folder will appear in the folder RK7\base\ folder, containing the outgoing folder. In outgoing, the outgoing the directory server will accumulate store backup copies and log files for transfer transferring them to client applications.Register

Indicate the same setting in other applications: report server, POS server and POS stations.

[DBSYNC]

UseDBSync=1

Save the settings 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 synchronizationTo check synchronization, you can open a folder in a browser. To do thisso, open a the link of the formfollowing format:

https://   

http_hosthost   

:   

http_port   

port /rk7api/v1/dbsync/

  • where http_host is the IP address of the

...

  • required server. In

...

  • this case it is 127.0.0.1
  • http_port

...

  • is the server port. It is

...

  • indicated in

...

  • the [TCPSOC]

...

  •  section. If it is not specified, you can

...

  • check it by opening the web interface

...

  • . An example for the directory server:

For As an example, let's open the link link https://127.0.0.1:54318/rk7api/v1/dbsync/ -  (this is my directory server. Instead of port 54318 - specify your own.An authorization ). The authentication window will appear.

Specify a username Enter the user name in Latin characters with the the HTTP_Access privilege  right and a the password.Click Login. A

Click Sign in. You will see the list of files in the folder will appear:

If the list appearshas appeared, synchronization is workingenabled. Additionally, you can check the synchronization You can perform an additional synchronization check by changing the name of the a dish in on the menu and check checking it at the cash registerPOS station.

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

Synchronization stop handling, online database update

...

in the same way.


Description of INI Files

Directory Server

The settings file for the report server is rk7srv.INI

[DBSync] ; Enabling the second database SQLiteCMN

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

...

Directory server settings file - rk7srv.INIDBSync]; Enabling the maintenance of the second SQLiteCMN database for the general (main) directory database and the local reference databasesdirectory database,

; and recording of their log files and backups for the database synchronization mechanism by databases to workfunction.

; After starting When run in this mode, the directory server will make the create (next to the database file rk7.udb.SQLite file next to the ) the file called rk7.udb base file.SQLite

; and the a folder where backupsit will store backup copies, log files and the filtering settings file will be stored

; for transferring them to client applications. For See more details below, see in the description of the OutputPath parameter below.

; By default, this is the folder DBSync\outgoing in the folder in containing the database folder.

; Network access to this folder is automatically provided enabled by the WebDAV protocol,.

; for which each To that end every server runs its own nginx , access to which that is automatically forwardedaccessed

; through the server's HTTP interface of the server. If a static ReqSourceURL is not set for them in the ini ini files of client applications do not have a static ReqSourceURL (see below),

; By default, client applications find out individually request the host and port for connecting to it from the server themselves, by default when connecting to it using the network name.

; To checkperform checks, you can connect establish a connection to this folder, for example , with through a web browser, using a the URL like of the format https://<http host>:<http port>/rk7api/v1/dbsync/ UseDBSync = 1
 


; The folder into which the generated bakap that will contain created backup files, log files and the filtering settings file will be placed.

; It is possible not to set it, since by default it is the You can do without indicating it as the default folder is DBSync\outgoing\ folder next to the file of its own directory database file

; of the directory server. Client applications take files from it to update for updating their databases.

; They can access it either through the built-in embedded WebDAV , or directly as a folder in the file system , or in any other way.

; OutputPath = <DataBasePath> DBSync <DataBasePath>DBSync\outgoing
 


; Make How many transactions are required for a backup through so many transactions. By default, every 1000 log filesevery 1000 log files are backed up.

; BackupOnVersionsDelta = 2000
 
; After accumulating what is  2000


; What total log size (a percentage of the last backup size) is required to make a new backup.

; By default, this is 30%: a new backup is made once the total size of log files

; created since the log (last backup reaches 30% of the size of the last backup.

; BackupOnJournalSizeMultiplier = 30


; What total size of log files should be reached so that the earliest of them are deleted from the OutputPath.

; Indicated as a percentage of the last backup size; by default, this is 300.

; That is, the default size of stored log files equals three sizes of the database.

; BackupMaxTotalSizeMultiplier = 300


; Minimal log file storage time in hours

; By default, logs are stored for no less than 8 hours

; MinSaveJournalHours = 8


; What number of the last backup) to make a new backupbackups should be reached so that the earliest of them are deleted from the OutputPath.

; By default, 30% - new back

Report Server

two backups are stored: the last one and the next-to-last one (as a safeguard)

; BackupCountLimit = 2


; To protect file exchange through http, you can set a system password; a parameter value must start with ":"

; ServerLoginInfo = :<Password>


; Enabling the nginx debugging mode. 1 means 'enabled'. The default value is 0.

; NginxDebug = 0

Report server

The report server settings file is Report server settings file - repserv.ini

[DBSyncDBSYNC]

; Enabling receiving Allowing to receive backups, logs and the filtering settings file from an the upstream server for synchronizationsynchronizing

; the main directory database with it its main database of reference books, as well as the inclusion of maintaining a and enabling the second database SQLiteCMN for local reference books,directories

; and for recording its log files and backups for the database synchronization mechanism by databases to workfunction.

; After starting When run in this mode, the report server will create the DBSync \ outgoing folder (next to the database file rk7.udb base file,
) the folder called rk7.udb.SQLiteDBSync\outgoing

; where it will store ; in which it will accumulate backups, log files and a file of the filtering settings file for transferring them to its client

; applications , as in both through the main directory database of directories, that are received from the upstream server and applied to their own its database,

; and on through the local base, database that are generated when editing local directories on this server. UseDBSync = 1 1

; For As for the outgoing folder settings, see the description of the analogous similar section of dealing with the directory server parameters.

; Access to the OutputPath folder on the upstream server can be opened granted via the WebDAV protocol and by third-party means,via external means;

; in this case, in the ReqSourceURL parameter, you need to specify please indicate the URL from where to request data (Request) data.

; ReqSourceURL = http://<serverIP>:<WebDAVPort>/rk7api/v1/dbsync

; If this parameter is has an empty value, downloading via the WebDAV protocol will be disabled.

; This is useful if the upstream server is located on the same computer or in a the local network , and if it is possible

; give to grant access to its outgoing folder directly by means of through the file system means.

; ReqSourceURL =

; To balance the load on the network and serversserver load, you can set specify how many seconds the download processes should pass for processes of downloading via WebDAV should wait

; between requests to the server about the appearance of a new log file files or a new backupbackups. The default is an interval of 2 secondsis 2 seconds.

; ReqInterval = 2 2

; To balance the load on the network and serversserver load, during the download process downloading via WebDAV , you can adjust

; how many percent the percentage 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,that log files can take up so that when the client starts working, this backup will be downloaded

; instead of downloading and rolling those log files
; and these log files were not downloaded and rolled.

; The default is 100 percent: value is 100 percent; if the size of required log files are is larger than the backup, the backup will be is downloaded.

; If you specify 200indicate 200, then the log files must be 2 times be 2 times larger than the backup , so that the download of the backup was selected,for it to be downloaded,

; and if you specify 50indicate 50, the backup can be 2 times more be 2 times larger than logs, but the backup is it will still be downloaded.

; Choose a value for You should select the value of this parameter based depending on your the network speed, the speed at which the log files are applied,

; the system slowdown when using a large number of many log files are applied, etc.

; ReqStartLoadBackupMultiplier = 100 100

; By default, when connecting connected via WebDAV, backups for the OutputPath folder are made locally , taking into account considering the settings

; for conditions for of taking backups and regardless of independently from servers. Therefore, they are obtained made not for the same data versions for which backups

; filmed are taken on other servers. If there is a need for synchronization of it is necessary to synchronize backups or to reduce some of the loads,

; made it possible to enable the mode of receiving backups by downloading them from an there is a capability of enabling the mode in which backups are downloaded from the upstream server. It is disabled by default.

; ReqToDownloadBackups = 0 0

; The folder (relative relatively to the exe file) from where backups and log files will be taken from the nearest closest upstream server will be taken

; to update your databasefor the database to be updated. By default, it is set equal to <DatabasePath> DBSync <DatabasePath>DBSync\incoming

; If the ReqSourceURL parameter (see above) is not set empty, then it is to this folder that files will be downloaded to it via WebDAV.

; If the ReqSourceURL is empty, then here you can specify the path to the DBSyncOutputPath folder of the upstream server

; reference books or reports, directory server or report server if it is located in the same network or on the same computer, or to a copy of it ; alternatively, you can specify the path to its copy received

; from a the remote server using any third-party toolvia some external means.

; InputPath = <RefServerBaseFolder>\DBSync\outgoing

; The folder into which the where processed backup and log files will gobe placed. The Database files of the database of local directories will also be written added there.

; It can be omitted, since by default it is the <DatabasePath> DBSync You can do without indicating it as the default folder is <DatabasePath>DBSync\outgoing\ folder next to the directory database file of the report server reference database file.

; OutputPath = <DataBasePath> DBSync <DataBasePath>DBSync\outgoing

; The mode when where the report server will delete the deletes processed files from the InputPath folder after copying them to the OutputPath.

; This is useful if they are downloaded to the InputPath folder personally individually for a given report server.

; If an upstream server outbound the incoming folder is specified as an inbound folder, the outgoing folder of the upstream server and it is shared by multiple several clients,

; this mode is not appropriateinappropriate, and the upstream server itself monitors the cleaning of this folder is monitored by the upstream server.

; In this regardTherefore, if InputPath= <DataBasePath> DBSync <DataBasePath>DBSync\incoming then , by default RemoveProcessed = 1 1, otherwise 0otherwise 0.

; RemoveProcessed = 0 0

; To exchange files via http, you can set specify a system user with a password

; For the http server:

; ServerLoginInfo = :<Password>

; For the http client:

; ReqSourceLoginInfo = [<User>]:<Password>

; <User> - is only for external WebDAV servers only. To connect to RK7 servers, there is no need to specify the <User> (the network name will be used)!

; The same as on the directory server

; BackupOnVersionsDelta = 2000
; BackupOnJournalSizeMulti

Cash server

= 2000

; BackupOnJournalSizeMultiplier = 30

; BackupMaxTotalSizeMultiplier = 300

; MinSaveJournalHours = 8

; BackupCountLimit = 2

; NginxDebug = 0 [CONFIG]

; The type of the database used. The mechanism is intended to work with SQLite, so it is required to indicate SQLiteCMN or SQLiteUCS.

; Must be the same as the database type specified on the directory server.

; For now, it is impossible to specify it so there is no need to indicate it here either.

; DataBaseKind = SQLiteCMN

; Filtering settings have not changed: if required, it is enabled via SyncSchdFile.

; But when synchronization is performed by databases, filtering settings are used for reading from the database

; so they are required not only on the repeater unit but also have to be configured on each POS server and on each POS station.

; Therefore:

; When UseDBSync is enabled, servers save their filter to the OutputPath for clients to use.

; When UseDBSync is enabled and if not indicated otherwise in the SyncSchdFile parameter, clients use the filtering settings file

; from the folder specified by the InputPath parameter. It has to get there from the OutputPath of the upstream server.

; Moreover, only RestFilterIn and skipDeleteIn are used from the file specified in this parameter while the schedule is not used.

; SyncSchdFile =

POS Server

The POS server settings file is POS server settings file - RKEEPER.INI

[DBSyncDBSYNC]

; See the description of a the similar section of dealing with the report server parameters , bearing keeping in mind that the local directory database of local directories on the cash register POS server is also taken exclusively solely from the upstream server.

[CONFIG]

; See the description for a of the similar section of dealing with the report server parameters.

Cash register and printing station

POS Station and Printing Station

The settings files for POS stations and printing stations are wincash.ini and POS and print station settings file - wincash.ini and winprint.ini

[DBSyncDBSYNC]

; See the description of a the similar section of dealing with the report server parameters , but the parameters responsible for filling and cleaning the OutputPath folder and performing making backups are ignored

[CONFIG]

; The path to your own the folder for the database of the POS station directories.

; A cash register in database synchronization mode will also have In the mode of synchronization by databases, a POS station also has its own database , and must understand should see where to put place it.

; If not specifiedindicated, the application app folder will be used.

BasePath = ..

; Instead of the DBSyncMoveToOutput parameter used on servers, the checkout station has the name DBSyncRemoveProcessedparameter is called DBSyncRemoveProcessed for POS stations

; This is the mode when checkout where the POS deletes processed files from the DBSyncInputPath folder will be deleted after upon processing them.

; This is useful if they are transferred to placed into the DBSyncInputPath folder individually for a given POS by some third-party mechanism, personally for this checkoutexternal mechanism.

; By The default 1 if value is 1 if DBSyncInputPath=<DataBasePath> + 'DBSync\incoming', otherwise 0otherwise 0.

; DBSyncRemoveProcessed = 0 0

; For the restOther than that, see the description of a the similar section of dealing with the cash register POS server parameters.