You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/getting-started/quick_start.md
+32-47Lines changed: 32 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,7 @@ Successful creation will have a record under `synchdb_conninfo` table. More deta
47
47
48
48
## **Start a Connector**
49
49
50
-
Use `synchdb_start_engine_bgw()` function to start a connector worker. It takes one argument which is the connection name created above. This command will spawn a new background worker to connect to the heterogeneous database with the specified configurations.
51
-
52
-
For example, the following will spawn 2 background worker in PostgreSQL, one replicating from a MySQL database, the other from SQL Server
50
+
Use `synchdb_start_engine_bgw()` function to start a connector worker. It takes one argument which is the connection name created above. This command will start the connector in the default snapshot mode called `initial`, which will replicate the schema of all designated tables and their initial data in PostgreSQL.
Use `synchdb_state_view()` to examine all connectors' running states.
59
+
Use `synchdb_state_view()` to examine all connectors' running states.
62
60
63
-
See below for an example output:
61
+
If everything works fine, we should see outputs similar to below.
64
62
```SQL
65
63
postgres=# select * from synchdb_state_view;
66
64
name | connector_type | pid | stage | state | err | last_dbz_offset
@@ -72,54 +70,41 @@ postgres=# select * from synchdb_state_view;
72
70
73
71
```
74
72
75
-
Column Details:
76
-
77
-
| fields | description |
78
-
|-|-|
79
-
| name | the associated connector info name created by `synchdb_add_conninfo()`|
80
-
| connector_type | the type of connector (mysql, oracle, sqlserver...etc)|
81
-
| pid | the PID of the connector worker process|
82
-
| stage | the stage of the connector worker process|
83
-
| state | the state of the connector. Possible states are: <br><br><ul><li>stopped - connector is not running</li><li>initializing - connector is initializing</li><li>paused - connector is paused</li><li>syncing - connector is regularly polling change events</li><li>parsing (the connector is parsing a received change event) </li><li>converting - connector is converting a change event to PostgreSQL representation</li><li>executing - connector is applying the converted change event to PostgreSQL</li><li>updating offset - connector is writing a new offset value to Debezium offset management</li><li>restarting - connector is restarting </li><li>dumping memory - connector is dumping JVM memory summary in log file </li><li>unknown</li></ul> |
84
-
| err | the last error message encountered by the worker which would have caused it to exit. This error could originated from PostgreSQL while processing a change, or originated from Debezium running engine while accessing data from heterogeneous database. |
85
-
| last_dbz_offset | the last Debezium offset captured by synchdb. Note that this may not reflect the current and real-time offset value of the connector engine. Rather, this is shown as a checkpoint that we could restart from this offeet point if needed.|
73
+
If there is an error during connector start, perhaps due to connectivity, incorrect user credentials or source database settings, the error message shall be captured and displayed as `err` in the connector state output.
86
74
87
-
## **Check Connector Running Statistics**
75
+
More on running states [here](https://docs.synchdb.com/monitoring/state_view/), and also running statistics [here](https://docs.synchdb.com/monitoring/stats_view/).
88
76
89
-
Use `synchdb_stats_view()` view to examine the statistic information of all connectors. These statistics record cumulative measurements about different types of change events a connector has processed so far. Currently these statistic values are stored in shared memory and not persisted to disk. Persist statistics data is a feature to be added in near future. The statistic information is updated at every successful completion of a batch and it contains several timestamps of the first and last change event within that batch. By looking at these timestamps, we can roughly tell the time it takes to finish processing the batch and the delay between when the data is generated, and processed by both Debezium and PostgreQSL.
77
+
## Check the Tables and Data
78
+
By default, the source tables will be replicated to a new schema under the current postgreSQL database with the same name as the source database name. We can update the search path to view the new tables in different schema.
| name | the associated connector info name created by `synchdb_add_conninfo()`|
105
-
| ddls | number of DDLs operations completed |
106
-
| dmls | number of DMLs operations completed |
107
-
| reads | number of READ events completed during initial snapshot stage |
108
-
| creates | number of CREATES events completed during CDC stage |
109
-
| updates | number of UPDATES events completed during CDC stage |
110
-
| deletes | number of DELETES events completed during CDC stage |
111
-
| bad_events | number of bad events ignored (such as empty events, unsupported DDL events..etc) |
112
-
| total_events | total number of events processed (including bad_events) |
113
-
| batches_done | number of batches completed |
114
-
| avg_batch_size | average batch size (total_events / batches_done) |
115
-
| first_src_ts | the timestamp in nanoseconds when the last batch's first event is produced at the external database |
116
-
| first_dbz_ts | the timestamp in nanoseconds when the last batch's first event is processed by Debezium Engine |
117
-
| first_pg_ts | the timestamp in nanoseconds when the last batch's first event is applied to PostgreSQL |
118
-
| last_src_ts | the timestamp in nanoseconds when the last batch's last event is produced at the external database |
119
-
| last_dbz_ts | the timestamp in nanoseconds when the last batch's last event is processed by Debezium Engine |
120
-
| last_pg_ts | the timestamp in nanoseconds when the last batch's last event is applied to PostgreSQL |
121
-
122
-
123
108
## **Stop a Connector**
124
109
125
110
Use `synchdb_stop_engine_bgw()` SQL function to stop a running or paused connector worker. This function takes `conninfo_name` as its only parameter, which can be found from the output of `synchdb_get_state()` view.
sqlserverconn | sqlserver | 579820 | change data capture | polling | no error | {"commit_lsn":"0000006a:00006608:0003","snapshot":true,"snapshot_completed":false}
12
+
mysqlconn | mysql | 579845 | change data capture | polling | no error | {"ts_sec":1741301103,"file":"mysql-bin.000009","pos":574318212,"row":1,"server_id":223344,"event":2}
13
+
oracleconn | oracle | 580053 | change data capture | polling | no error | offset file not flushed yet
14
+
(3 rows)
15
+
16
+
```
17
+
18
+
Column Details:
19
+
20
+
| fields | description |
21
+
|-|-|
22
+
| name | the associated connector info name created by `synchdb_add_conninfo()`|
23
+
| connector_type | the type of connector (mysql, oracle, sqlserver...etc)|
24
+
| pid | the PID of the connector worker process|
25
+
| stage | the stage of the connector worker process|
26
+
| state | the state of the connector. Possible states are: <br><br><ul><li>stopped - connector is not running</li><li>initializing - connector is initializing</li><li>paused - connector is paused</li><li>syncing - connector is regularly polling change events</li><li>parsing (the connector is parsing a received change event) </li><li>converting - connector is converting a change event to PostgreSQL representation</li><li>executing - connector is applying the converted change event to PostgreSQL</li><li>updating offset - connector is writing a new offset value to Debezium offset management</li><li>restarting - connector is restarting </li><li>dumping memory - connector is dumping JVM memory summary in log file </li><li>unknown</li></ul> |
27
+
| err | the last error message encountered by the worker which would have caused it to exit. This error could originated from PostgreSQL while processing a change, or originated from Debezium running engine while accessing data from heterogeneous database. |
28
+
| last_dbz_offset | the last Debezium offset captured by synchdb. Note that this may not reflect the current and real-time offset value of the connector engine. Rather, this is shown as a checkpoint that we could restart from this offeet point if needed.|
Use `synchdb_stats_view()` view to examine the statistic information of all connectors. These statistics record cumulative measurements about different types of change events a connector has processed so far. Currently these statistic values are stored in shared memory and not persisted to disk. Persist statistics data is a feature to be added in near future. The statistic information is updated at every successful completion of a batch and it contains several timestamps of the first and last change event within that batch. By looking at these timestamps, we can roughly tell the time it takes to finish processing the batch and the delay between when the data is generated, and processed by both Debezium and PostgreQSL.
0 commit comments