/
quick-start.ad
314 lines (223 loc) · 8.33 KB
/
quick-start.ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
== Quick Start
IMPORTANT: To see a demonstration of a preconfigured SymmetricDS environment see the <<Demo>> tutorial.
This guide will walk you through the minimum steps required to setup data synchronization through a single installation of SymmetricDS.
ifndef::pro[]
.Steps covered
. Install
. Connect Source Database
. Configure
. Connect Target Database
endif::pro[]
ifdef::pro[]
.Steps covered
. Install
. Run
. Connect Source Database
. Select Tables
. Connect Target Database
endif::pro[]
=== Install
ifndef::pro[]
Download and install SymmetricDS from the http://www.symmetricds.org/download[SymmetricDS.org] website.
TIP: For complete installation instructions click link:user-guide.html#_installation[here,window="_tutorials"]
endif::pro[]
ifdef::pro[]
Download and install SymmetricDS from the http://www.jumpmind.com/products/symmetricds/download[JumpMind] website.
TIP: For complete installation instructions click link:user-guide.html#_installation[here,window="_tutorials"]
endif::pro[]
ifdef::pro[]
=== Run
Open the control center to verify SymmetricDS server is running. If it is not start the server using the start server button. Then open the web console using the open web console button.
.SymmetricDS Control Center
image::images/tutorials/control-center.png[]
TIP: Depending on your operating system a program shortcut for the control center might have been setup. Otherwise you can find it directly in the /bin directory of your
SymmetricDS installation. The executable file is named *symcc*.
endif::pro[]
=== Connect Source Database
ifndef::pro[]
Create a property file named `xxxxx.properties` in the engines folder of your SymmetricDS installation. Replace the `xxxxx` with a name for your node (homeoffice, central, server, etc).
TIP: A sample database is needed for each corresponding node that is created.
.Properties
. engine.name={an arbitrary name for the node}
Example: engine.name=centralNode
. group.id={this must match the name of a group inserted in step 3}
Example: group.id=corp
. external.id={id for the node}
Example: external.id=000
. sync.url=http://{hostname}:{port}/sync/{engine.name}
Example: sync.url=http://localhost:31415/sync/centralNode
. registration.url={leave this blank for the source node}
. db.driver={JDBC driver class}
[cols="2*", options="header"]
|===
|Database
|Example Driver Classes
|h2
|org.h2.Driver
|mySQL
|com.mysql.jdbc.Driver
|Oracle
|oracle.jdbc.driver.OracleDriver
|PostgreSQL
|org.postgresql.Driver
|Apache
|org.apache.derby.jdbc.EmbeddedDriver
|HyperSQL
|org.hsqldb.jdbcDriver
|SourceForge
|net.sourceforge.jtds.jdbc.Driver
|IBM
|com.ibm.db2.jcc.DB2Driver
|SQLite
|org.sqlite.JDBC
|Firebird
|org.firebirdsql.jdbc.FBDriver
|Sybase
|com.sybase.jdbc4.jdbc.SybDriver
|===
[start=7]
. db.url={JDBC url for your source database}
[cols="2*", options="header"]
|===
|Database
|Example JDBC Urls
|h2
|jdbc:h2:file:target/h2/client
|mySQL
|jdbc:mysql://localhost/sampleroot?tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
|Oracle
|jdbc:oracle:thin:@127.0.0.1:1521:sampleroot
|PostgreSQL
|jdbc:postgresql://localhost/sampleroot
|Apache
|jdbc:derby:sampleroot;create=true
|HyperSQL
|jdbc:hsqldb:file:sampleroot;shutdown=true
|SourceForge
|jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;
useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880
|IBM
|jdbc:db2://localhost/samproot
|SQLite
|jdbc:sqlite:target/sqlite/client
|Firebird
|jdbc:firebirdsql://host[:port]/client
|Sybase
|jdbc:sybase:Tds:localhost:5000/client
|===
[start=8]
. db.user={JDBC username}
Example: db.user=root
. db.password={JDBC password}
Example: db.password=xxxxxx
TIP: For complete instructions creating the master node click link:user-guide.html#_master_node_setup[here,window="_tutorials"]
endif::pro[]
ifdef::pro[]
image::images/wizard-node-setup.png[]
. Select "Master Node" from the connect database wizard
. Provide JDBC connection information for your source database, hit next
. Select "Standard 2 Tier" profile, hit next
. Use the default sync url, hit next
. Provide a password for the web console, hit next
. Finish
TIP: For complete instructions creating the master node click link:user-guide.html#_master_node_setup[here,window="_tutorials"]
endif::pro[]
ifndef::pro[]
=== Configure
SymmetricDS configuration requires at a minimum each of the following entities.
. Group
. Group Links
. Router
. Trigger
. Trigger Router
Use the following SQL templates to help you generate these entities replacing anything in red with your values (with the exception of the group link data_event_action, 'P', 'W').
.Groups
[source, SQL]
----
insert into SYM_NODE_GROUP
(node_group_id, description)
values ('corp', 'A corporate node');
insert into SYM_NODE_GROUP
(node_group_id, description)
values ('store', 'A retail store node');
----
.Group Links
[source, SQL]
----
insert into SYM_NODE_GROUP_LINK
(source_node_group_id, target_node_group_id, data_event_action)
values ('store', 'corp', 'P');
insert into SYM_NODE_GROUP_LINK
(source_node_group_id, target_node_group_id, data_event_action)
values ('corp', 'store', 'W');
----
.Router
[source, SQL]
----
insert into SYM_ROUTER (router_id,
source_node_group_id, target_node_group_id, create_time,
last_update_time) values ('corp-2-store','corp', 'store',
current_timestamp, current_timestamp);
----
.Trigger
[source, SQL]
----
insert into SYM_TRIGGER (trigger_id, source_table_name,
channel_id, last_update_time, create_time)
values ('item', 'item', 'item', current_timestamp, current_timestamp);
----
.Trigger Router
[source, SQL]
----
insert into SYM_TRIGGER_ROUTER
(trigger_id, router_id, initial_load_order, create_time,
last_update_time) values ('item', 'corp-2-store', 1, current_timestamp,
current_timestamp);
----
endif::pro[]
ifdef::pro[]
=== Select Tables
The Add Table(s) Wizard will be displayed by default when configuration is missing. If it is closed or not visible it can be opened by hitting the "Add Table(s) Wizard" button on the Overview screen of the Configure tab.
[.float-group]
--
[.left]
image::images/wizard-config/wizard-config-start.png[]
[.left]
image::images/wizard-config/wizard-config-client-server.png[]
--
. Welcome, hit next
. Select tables you wish to sync from client to server, hit next
. Select tables you wish to sync from server to client, hit next
. Verify the summary, hit finish
TIP: For complete instructions for the add table(s) wizard click link:user-guide.html#_quick_config_wizard[here,window="_tutorials"]
endif::pro[]
=== Connect Target Database
ifndef::pro[]
Create a property file named `xxxxx.properties` in the engines folder of your SymmetricDS installation. Replace the `xxxxx` with a name for your target node (ex. store).
.Properties
. engine.name={an arbitrary name for the node}
. group.id={this must match the name of a group inserted in step 3, ex: store}
. external.id={id for the node, ex: 001 }
. sync.url=http://{hostname}:{port}/{webcontext}/sync/{engine.name}
. registration.url={this should match the sync.url in your source property file}
. db.driver={JDBC driver class}
. db.url={JDBC url for your target database}
. db.user={JDBC username}
. db.password={JDBC password}
TIP: For complete instructions creating the target node click link:user-guide.html#_node_properties_file[here,window="_tutorials"]
endif::pro[]
ifdef::pro[]
The Connect Database Wizard will be displayed by default when only one node has been configured. If it is closed or not visible it can be opened by hitting the "Add" button on the Nodes screen of the Manage tab.
image::images/wizard-connect/wizard-connect-menu.png[]
. Select Local, hit next
. Provide JDBC connection information for your target database, hit next
. Select default registration url, hit next
. Select client node group, hit next
. Provide an external id of 1, hit next
. Select default sync url, hit next
. Choose appropriate options here depending if your target tables already exist and if they should be initially loaded with data from the source. Hit next
. Hit finish
TIP: For complete instructions to setup the target database click link:user-guide.html#_add_node[here,window="_tutorials"]
endif::pro[]
[horizontal]
icon:graduation-cap[role="green" size="2x"]:: [big]#*Congratulations! You have completed the Quick Start.*#