Distributed information base. Step-by-step instructions and pitfalls. Distributed infobase: Basics Setting up synchronization in a peripheral database

In 1C 8.3 or in 1C 8.2? Setting up a distributed infobase. Step-by-step instruction.

Information base distribution is used when it is necessary to maintain joint records in databases that cannot, for various reasons, have a physical connection. An example would be accounting for a company that has a division in a large city or small town without the ability to connect to the Internet. Or in some special cases of periodic need to simultaneously work with one database in the office and outside the office, for example at home. In such and similar cases, the use of a distributed information base (DIB) is justified and necessary.


In this article we will look at organizing the distribution of one information database in the 1C Accounting for Russia version 8.3 configuration through a local or network directory. In version 8.2 1C, this instruction will also be useful, because describes essentially one process with significantly small differences.

==== Setting up for the main base ====

Having opened 1C 8.3 in the “Enterprise” mode, let’s go to the “Administration” section. In version 1C 8.2, to get started, you need to go to the main menu “Service” - “Distributed Information Base (DIB)” - “Configure RIB nodes”.

Next, we will consider the process in the context of information security version 8.3. So, going to the “Administration” section, select “Program settings”. In the settings, go to the “Data Synchronization” section. Here we check the box “Use data synchronization” and specify the database prefix. Let us indicate “CB”, implying a central base.

After this, the “Data Synchronization” item appears in the right menu. Let's choose him. In the child window that opens, click the “Set up data synchronization” button. In the drop-down menu, you can select settings for different synchronization use cases. We select “Distributed information base...”.

For general development, familiarize yourself with the contents of the next window and click “Next”.

In the next window, fill in the directory through which the . We will specify data compression to reduce the size of the upload, and you can immediately specify a password for the archive with the data. It is important not to forget him. Confirm the filling with the “Next” button.

The next two windows are designed to specify settings for cases of exchange via an FTP server and via email. As stated earlier, we are considering the exchange method through a directory, so we are skipping the settings for FTP and email.

The next window is intended for specifying exchange parameters in the peripheral database part. Let's indicate its name and prefix. Next is the “Next” button.

Let’s check the exchange parameters we have created and confirm their correctness with the traditional “Next” button.

The necessary set of settings for exchange will be automatically created. It will take some time.

Important! Creating the initial image for the slave node takes a significant amount of time. The size of this significance depends on the computer resources and the volume of accounting in the main database.

Let's assume that we decide to create an image. After clicking on the “Finish” button in the previous window, we will enter the settings to create an image of the slave information security. We will consider the simplest case for local operations. To do this, indicate the necessary details in the window that opens. Let us pay special attention to the “Full name of the file base” parameter. It must be specified in full UNC format, which requires the formation of a local path in a “network” format. For example - “\\Server1C\Databases\RIB”. To the specified path we will add the name of the database file - 1Cv8.1CD.

After clicking on the “Create initial image” button, the process of generating an image for the slave database starts.

After the process is completed, a database file will be created in the specified directory. This newly created database needs to be configured before full use.

==== Setting up for a peripheral base ====

To do this, you need to connect it to 1C. You will find how to do this in the instructions in our article - After connecting, you need to launch the new database in configurator mode and create users. Next, the information security needs to be launched in 1C “Enterprise” mode.

If, for some reason, the creation of users needs to be postponed to a later time, after connecting, you can simply launch the database in 1C “Enterprise” mode. You will be prompted to create an “Administrator” user, agree to it, and the initial filling will be done.

Then you need to continue setting up pairing with the main base. This setting is similar to that discussed above for the main database.

A setup for communication with the main base will be created.

============================================

So, now we have created the main and peripheral bases. Synchronization settings have also been created in each of these databases. Now you can move on to editing these settings and bringing them into a suitable form. You can create automatic exchange rules or perform the exchange manually.

Let's do this in the main database. The peripheral base is configured in the same way.

Editing can be applied to data synchronization rules and schedules.

By clicking the “Configure” button in the “Data synchronization schedule” section, you need to edit the scripts to automatically schedule the work of uploading/loading data for the selected database. You don’t have to edit it, just agree with the default options.

To edit the parameters, just click on the link with the automatic schedule data. And then we edit the temporary parameters for launching tasks. By going through the bookmarks you can change both the time and the dates and days of the week of the launch.

By clicking the “Run task” button in the main script window, you can manually run the task.

By clicking the “Configure” button in the “Data synchronization rules” section, you can perform operations to change task launch scripts, as well as view the log of uploads/downloads. The latter is quite important for administering access and monitoring the regularity of exchanges.

Having finished creating and editing scripts for automatically starting distributed database exchange, you can proceed to uploading and then loading data.

At this point, the configuration of the distributed bathhouse database for the central and peripheral nodes is basically completed.

Download illustrated instructions

Distributed information base. Step-by-step instruction
Distributed Information Base (RIB) 1C:Enterprise
Creating a distributed infobase and setting it up
how to set up rib in 1s 8.2
How to set up a distributed information base in 1C
How to set up in 1C
How to set up in 1C
Setting up a distributed information base (RIB) in 1C
Example of setting up RIB for 1C:Accounting 8
Creation of a distributed infobase and configuration

The technology of distributed information bases (RIB) allows you to create a geographically distributed system based on 1C Enterprise configurations. This allows you to have a common information space even with those departments that do not have a reliable communication channel, combining high autonomy of nodes with the ability to quickly exchange information. In our articles we will look at the features and practical implementation of this mechanism on the 8.2 platform

First of all, let’s ask ourselves: why autoexchange? Modern technologies, combined with inexpensive and fast Internet, make it possible to organize remote work without any difficulties. The choice of methods is as wide as ever: RDP, thin and web clients, connecting networks using VPN - there is a lot to think about. However, all these methods have one significant drawback - a strong dependence on the quality of the communication channel.

Even with ideal operation of the local provider, it is impossible to guarantee 100% availability of the communication channel. Problems with the backbone provider, lack of power supply, physical damage to the communication line and many other factors make this task insurmountable. At the same time, the inaccessibility of the information base at a remote warehouse or retail store leads to quite significant losses. And finally, let’s not forget that there are places (for example, industrial zones on the outskirts of cities) where providing a high-quality communication channel is expensive and/or problematic.

The RIB mechanism allows you to get rid of these shortcomings; each department has its own copy of the information base with which you can work autonomously even in the complete absence of communication with the outside world. And the small amount of transmitted information allows you to use any communication channel, including the mobile Internet, for exchange.

RIB on platform 8.2 is not something fundamentally new, representing a further development of RIB platform 7.7, only now this technology has become more accessible and simpler. Unlike the RIB component, which had to be purchased separately, the RIB is an integral part of many standard configurations and works entirely in user mode, allowing you to do without the Configurator even at the setup stage.

At this point it would be time to move on to the practical part, but we will have to make one more digression. The fact is that the transition to the 8.2 platform, which seems to have already happened, in fact led to the emergence of two types of configurations: based on a managed application, “native” for the 8.2 platform, and adapted from 8.1, continuing to use outdated technologies and mechanisms. Since a significant part of the configurations (Enterprise Accounting, Payroll and HR Management) are adapted or transitional, they cannot be discounted, so the first part of our article will be devoted to these configurations (essentially the 8.1 platform), while in the second we will examine setting up auto-exchange for configurations based on a managed application (platform 8.2).

Let's consider a practical task: setting up automatic exchange via FTP for the Enterprise Accounting 2.0 configuration. Despite the fact that RIB allows you to exchange using email or file shares, we recommend using FTP as the simplest and most reliable method of communication. You can read how to set up your own FTP server, or you can use the FTP service of any hosting provider.

First of all, we need to configure exchange nodes. To do this, launch the configuration with administrator rights and select Transactions - Exchange Plans.

In the list that appears, select Full plan or By organization, if records are kept for several companies in one database and the exchange needs to be made only for one of them. In the window that opens, there is already one node - the central one, we need to edit it by indicating the code and name.

Then we will create another node for the branch, filling it in the same way (to add, click the green circle with a plus). The next step is to create an initial image for this node, which is a ready-made information base in file mode. To do this, right-click on the desired node and select from the drop-down list Create a starting image.

Now let's move on Service - Distributed Information Base (DIB) - Configure RIB nodes.

In the window that opens, click the button Add and configure a new exchange by specifying the remote host, exchange type (via FTP) and server connection parameters.

Bookmark Automatic exchange allows you to set up an exchange schedule, exchange by events (start and end of work, etc.), these settings are made for the user on whose behalf the exchange will be performed, so make sure he has rights to exchange data.

Don't forget to specify the node prefix for document numbering (otherwise you will receive different documents with the same numbers) in Tools - Program Settings; here you can also configure some other exchange parameters. On the same tab, you should select a user to perform exchange tasks; if you do not do this, the schedule will not work. Remember that the exchange will only be made if the user is logged into the program.

This completes the configuration of the central node; now you need to make similar settings for the peripheral node, connecting the initial image as an existing information security system. After which you can start exchanging data. To control you should use Communication monitor, it allows you not only to monitor the success of the upload/download, but also shows any collisions that have arisen or delayed movements (if the user who made the exchange does not have enough rights to perform any actions in the database). The presence of this tool allows you to quickly and effectively solve various types of problems that arise during autoexchange.

At this point, the exchange setup can be considered complete and you can begin working in distributed mode. It is worthwhile to dwell specifically on updating or making changes to the configuration. These actions are only available on the central node; all changes made will be automatically propagated to the peripheral nodes during the next exchange. To make changes automatically, the peripheral database must be in exclusive mode, otherwise you will need to run Configurator and execute Updating the Database Configuration manually.

The RDDB (Distributed Database Management) component is used when it is necessary to exchange information between two or more identical information bases (hereinafter referred to as IS) via a narrow communication channel (for example, modem, e-mail). Below are step-by-step instructions and practical tips for setting up a URDB in 1C:Enterprise 7.7. The example is given for two information security systems, although setting it up for a larger number of databases by analogy with two databases is not difficult. Article author: romix | Editors: evGenius
Latest edition No. 7 from 02/22/08 | Story
URL:

Keywords: URBD, script for auto-exchange, exchange between branches, mail, rom-mail.dll, DialMail.dll, CDO, dialer, URIB

The RDDB (Distributed Database Management) component is used when it is necessary to exchange information between two identical information bases (hereinafter referred to as IS) via a narrow communication channel (for example, modem, e-mail). Below are step-by-step instructions and practical tips for setting up a URDB in 1C:Enterprise 7.7. The example is given for two information security systems, although setting it up for a larger number of databases by analogy with two databases is not difficult.

1) The DistrDB.dll library in the BIN folder of the 1C:Enterprise program is responsible for the operation of the URDB component. This component is purchased and installed separately.

2) For the autoexchange example, we will create two infobases, placing them in folders named c:\1c_base1 and c:\1c_base2. Create these folders, and in each of them - subfolders with the names CP and PC (in Latin letters)

3) In the c:\1c_base1 folder, place a ready-made configuration (say, “Trade and Warehouse”). But it’s better to train on the simplest information base (containing, for example, just one directory with several entries). It is important for us to make sure that data actually migrates from one information security system to another as a result of automatic URDB exchange, and this can be shown using both a complex and the simplest test example.

4) Close all windows in the Configurator and activate the menu item “Administration – Distributed Information Security – Management”. This menu item is available if the BIN folder of the 1C:Enterprise program contains the DistrDB.dll component. If the library has the wrong version or is damaged, simply reinstall 1C:Enterprise on top of the current installation - the DistrDB.dll library will be replaced with its correct version.

5) In the window that opens, click the “Central Information Security” button. In the request window, indicate the code of the new information base (enter the number 1) and its description (for example, “Central Information Security”).

6) Extinguish the warning that appears about the irreversibility of changes by clicking “OK” (the undocumented method is described below on how to return the database to its original state, if necessary).

7) Click the “New Peripheral” button. IB". In the request window, specify code 2 for it and the description – “Peripheral information security”.

8) Single-click the peripheral base and click the “Setup” button. auto exchange". In the window that opens, set the switch to change the “Manual” auto-exchange mode to “Automatic” and click the “OK” button.

9) Click the “Upload data” button. Remember (to the clipboard) the name of the file with the upload “c:\1c_base1\CP\20.zip” - it will be useful to us later. Click OK. Upon completion of the unloading, 1C will write “Unloading completed successfully.”

10) Close the Configurator and enter (also in Configurator mode) the folder (still empty) where the second IB should be located (in our example - c:\1c_base2). Specify that the database should be in DBF/CDX format and click OK.

11) Go to the menu item Administration – Distributed Information Security – Management. In response to the question “The information base was not found. Do you want to load data?" Click “Yes” and specify the name of the upload file (in our example, “c:\1c_base1\CP\20.zip”) and click “OK”. Once the download is complete, 1C will write “Download completed successfully.” We have successfully created a Peripheral Information Security by downloading data from the Central Information Security.

12) Change something (for example, add a new directory item) in one of the infobases. Our goal is to ensure that changes in one (any) information security system are transferred to another information security system through automatic exchange. Use the menu item “Administration” – “Distributed Information Security” – “Auto Exchange” alternately in each of the databases. Newly appearing download files with the ZIP extension in the CP and PC folders must be moved (copied) between information bases according to the CP->CP, PC->PC principle (in real “field” conditions this is usually done using email).

Tips and Recipes

1) To turn a distributed database into a regular one, delete the files 1SDBSET.DBF, 1SDWNLDS.DBF, 1SUPDTS.DBF and their corresponding *.CDX files, as well as 1SSYSTEM.DBF. In principle, it is enough to delete 1SSYSTEM.DBF. After this, you need to restore the relevance point by running the program in exclusive mode. This trick is undocumented (guess why), but it works nonetheless.

2) You can change the 1C configuration, but only in the Central Information Security. This is very convenient - changes in peripheral information security are rolled out automatically.

3) If you have lost (for example, as a result of a mail error) one or more uploads, do not be upset, because... The URDB can monitor such situations and repeat the sending of lost data during the next auto-exchange session.

4) The standard ability to send mail in 1C is implemented via the MAPI interface when interaction occurs with an email client (such as Outlook). My advice - don’t waste your time - with MAPI and various kinds of Outlooks in practice, problems constantly arise that require the developer to “drive quickly” between branches. I do not recommend using a direct modem connection or FTP for the same reason. It is better to send mail using external components, such as rom-mail.dll or DialMail.dll.

Another option is to use CDO
http://avb1c.narod.ru/?=a9
(c) avb, Horn of the Absurd

5) You can get a program that can automatically perform auto-exchange and send upload files by email here:

If you correctly configure several constants (mail addresses, passwords, attendance, etc.), the user only needs to double-click on the shortcut to start Auto Exchange.

The program is implemented as a 1C:Enterprise configuration. A detailed description is contained in the attached DOC file.

6) If you need to automatically dial your provider, use the E-Type Dialer program. It can launch external applications upon successful connection. Another option is to use the external DialMail component, which has the means to work with a modem (advice - the Latin prefix “p” in front of the number gives pulse dialing, 9W in front of the number - calling through “nine” and waiting for a dial tone on the line, etc.).

Note: Windows XP has a built-in dialer called rasdial.exe. Command line switches:
rasdial.exe Item User Password
rasdial.exe Element /DISCONNECT

7) Priority is given to changes made in the Central Information Security. Please note that in typical 1C configurations, information base prefixes are used (see this setting in Constants) so that the codes of directory elements and numbers of documents created in different databases do not coincide, and their uniqueness is not violated.

RIB is a distributed information base, which is a tree-like structure, the branches of which are individual deployed 1C Enterprise databases. These databases are called distributed information base nodes (hereinafter simply nodes). An exchange of information is formed between these nodes to synchronize all nodes (configurations and databases).

The main mechanism is an exchange mechanism with some distinctive and universal capabilities. The main difference is that the RIB exchange mechanism is more specialized and narrow, while universal exchanges provide the user with a wider range of opportunities.

Basic operating principles of RIB

It is possible to change the configuration structure only in the main root node of the distributed infobase. These changes are then propagated hierarchically to the subordinate nodes. Thus, this provides a single configuration structure space across all RIB nodes.

Data can be changed in any of the nodes, which in turn is distributed to all other nodes. Moreover, this data does not necessarily have to be transferred to other participants in the system and their complete identity may not be maintained. The developer can customize the composition of the data that participates in the exchange with other RIB participants as desired. Moreover, settings can be made not only at the configuration metadata level, but also at the level of individual elements, on which special selections can be applied.

As mentioned above, the RIB mechanism is achieved through the use of exchange plans. but in order for a particular plan to be used in this hierarchical structure, its “Distributed infobase” property must be activated.

All data is transmitted to the RIB via messages. The content of these messages is clearly regulated and cannot be arbitrary, as in the universal exchange mechanism. Data is placed in a message using the XML serialization principle. In addition to these data changes, the message also contains information about configuration changes, as well as a certain amount of service information. Changes are registered and placed in the exchange message completely automatically. Neither the user nor the developer can influence this.

Reception and generation of exchange messages in the RIB are set with one command

Exchange plans. WriteChanges(WriteMessages, 0)

The content is read using the command

Conclusion

We can safely say that the RIB mechanism mainly consists of a universal exchange mechanism with some distinctive features that are present only in the RIB structure.

In this article we will talk about setting up a distributed database 1C Enterprise 7.7; the Trade Management 9.2 configuration will be used as an example.

To configure the RIB in 1C 7.7, you need to go to the configurator and go to Administration-Distributed IS-Management.

Then you need to convert your database to RIB, if it has not yet been converted to RIB, to do this you need to click the “Central Information Bank” button.

Set the Code and Description as in the screenshot above and click "OK". A warning should appear as in the screenshot below, ignore it and click “Yes”.
After this, your base will be ready to create peripheral nodes.

Click on the "New Peripheral IB" button and set the field values ​​as in the following screenshot, however, you can use your own designations.

Click OK and move on to the next step - setting up auto-exchange.

In this article I will tell you how to set up auto-exchange using a local network. If you need auto-exchange by mail, then leave your request in the comments or contact me and I will tell you how to do it.

We display everything as on the slide, you can have your own paths to the directories, the checkboxes should be as in the screenshot above. Click OK.

Now we upload the initial image of the peripheral database to disk; to do this, click the “Upload data” button. After downloading the initial image, the RIB management window will look like this:

Let's assume that the computer on which our rib will work is located not far from the main computer with a central base and both computers are connected to a local network.

Now we need to configure the RIB on the client computer; to do this, take our zip file downloaded in the previous steps and create an information base based on it. The screenshots below show the complete sequence of actions.

Click the "Add" button and point to an empty folder and click OK.

We select a new information security system and go to the configurator mode.

We create an empty information bank in an empty folder, so 1C asks us to indicate what format our database will be in, select *.dbf. Click OK.

Now let's load the zip file uploaded in the previous steps into our database; to do this, go to administration - download data.

Specify the path to the file and click OK.
Once the download is complete, click OK and go to administration-distributed ib-auto-exchange.



At this step, it is necessary to take into account the rule: CB unloading directory = PB loading directory and vice versa, i.e. if in the central database we uploaded to the out folder and loaded from the in folder, then in the peripheral database we will load from the out folder and upload to the in folder. Click OK and move on to the next step. We perform automatic exchange. To do this, in the central database, go to administration-distributed ib-autoexchange.


Click the "Run" button, and then do the same on the client base. Perform the autoexchange operation on each computer several times.

Now let's automate the process. To do this, you need to create 4 files on each computer. 2 *.prm files and 2 *.bat files for each upload/download operation.

*.bat file should contain the following line:

"<путь к файлу 1cv77.exe>"config/D"<путь к информационной базе>"/N<логин>/P<пароль>/@"<путь к prm-файлу>"

My loading and unloading files look like this:

"C:\Program Files\1Cv77\BIN\1cv7s.exe" config /D"C:\base\rib\" /Nadmin /P1 /@"c:\download.prm"

"C:\Program Files\1Cv77\BIN\1cv7s.exe" config /D"C:\base\rib\" /Nadmin /P1 /@"c:\upload.prm"

You write your values. Now let's deal with prm files!

Structure of the .prm file:

The “General” section is intended to describe the main parameters of the batch mode. Possible parameters:

Output – path to the log file;
- Quit – whether the configurator needs to be terminated after completing all tasks;
- AutoExchange – whether autoexchange should be performed;
- SaveData – whether it is necessary to save the database;
- UnloadData – whether unloading should be performed;
- CheckAndRepair – whether the database needs to be tested and corrected.

Possible values ​​for these parameters can be 1(Y) or 0(N).

The “AutoExchange” section is intended for defining auto exchange parameters. Options:

SharedMode – indicates the mode of operation from the database. If the parameter is not specified, then exclusive mode will be used;
- ReadFrom - indicates from which databases data should be received. Database identifiers must be specified separated by commas. If all are needed, then put * ;
- WriteTo - indicates for which databases data should be uploaded. If it is necessary for everyone, then put *.

The “SaveData” section is intended for defining the parameters for saving the database. Possible parameters:

SaveToFile – indicates the path where saving will be done;
- FileList – indicates the list of files to be saved. File names are listed separated by spaces or commas;

Section “UnloadData” – is intended for defining parameters for data unloading. Options:

UnloadToFile – specifies the saving path, including the file name;
- IncludeUserDef – indicates whether the list of users should be included in the transfer file;
- Password – specifies the password that will be set to the transfer file.

The “CheckAndRepair” section is intended for defining database recovery parameters. Possible parameters:

Repair – indicates whether it is necessary to restore the database;
- PhysicalIntegrity – indicates whether it is necessary to check the physical integrity of infobase tables;
- Reindex – indicates the need to reindex the database;
- LogicalIntegrity – indicates whether it is necessary to check the logical integrity of tables;
- RecalcTotals – indicates whether it is necessary to recalculate the results of accounting and operational accounting;
- Pack – indicates whether it is necessary to free up space occupied by deleted records;
- SkipUnresolved – specifies whether to skip unresolved links or fix them;
- CreateForUnresolved – specifies how unresolved links are resolved. If 1, then an object of the appropriate type will be created for the unresolved link. If 0, then the link will be cleared.

Based on this, my files will contain the following:

to download from the central bank to the peripheral:


Output = log.txt
Output = 1


ReadFrom = CB

for unloading from the Central Bank to the peripheral:


Output = log.txt
Output = 1


WriteTo = CB

to download from the peripheral to the Central Bank:


Output = log.txt
Output = 1


ReadFrom = PB1

for unloading from the peripheral to the Central Bank:


Output = log.txt
Output = 1


WriteTo = PB1

Now it is enough to place the bat and prm files in one folder and run them one by one to perform downloading and uploading.

If you have any questions, feel free to comment!

Share with friends or save for yourself:

Loading...