@@ -21,10 +21,12 @@ Derived resources, from products such as NITFs, will not be replicated.
21
21
## Docker Compose Deployment
22
22
23
23
#### Prerequisites
24
- The replication docker stack requires the following to be configured on the swarm before deploying:
24
+ Replication is deployed as a docker stack in a docker swarm. So, before deploying replication,
25
+ you need a running docker instance with an initialized swarm. Once you have a swarm running you can
26
+ configure it for replication with the following steps.
25
27
26
28
###### Configuration
27
- The configuration that replication uses that need to be populated in docker config
29
+ The configuration that replication uses needs to be populated in docker config
28
30
29
31
| Config Name | Description|
30
32
| ------------| ------------|
@@ -34,21 +36,30 @@ The configuration that replication uses that need to be populated in docker conf
34
36
Example replication-spring-config
35
37
``` yaml
36
38
logging :
37
- level :
39
+ level :
40
+ # You can adjust the log levels of a package or class in this section
38
41
root : INFO
39
42
org.apache.cxf.interceptor.LoggingOutInterceptor : WARN
40
43
org.apache.cxf.interceptor.LoggingInInterceptor : WARN
41
44
javax.xml.soap : ERROR
42
45
spring :
43
46
data :
44
47
solr :
45
- host : http://replication-solr:8983/solr
48
+ # This is the URL the replication service will use to communicate with solr.
49
+ # As long as you use the docker compose file you won't need to change this.
50
+ host : http://replication-solr:8983/solr
46
51
profiles.active : Classic
47
52
replication :
53
+ # This is the number of seconds between each replication, lower it if you're going to be testing.
48
54
period : 300
55
+ # Timeouts for calls to sites
49
56
connectionTimeout : 30
50
57
receiveTimeout : 60
58
+ # The ID of the local site. All replications will go to/from this site. Direction will be determined
59
+ # by the type and kind of site being replicated with. This field needs to be set, and a site with
60
+ # this ID needs to be saved before any replication will take place.
51
61
localSite : some-unique-id-1234
62
+ # The remote sites to handle replication for, remove this to handle replication for all sites.
52
63
sites :
53
64
- site1
54
65
- site2
@@ -70,6 +81,12 @@ management:
70
81
enabled : true
71
82
` ` `
72
83
84
+ To create a docker config use the ` config create` command, which uses this syntax:
85
+ ` docker config create <CONFIG_NAME> <FILE_DIRECTORY>`
86
+
87
+ Example :
88
+ ` docker config create replication-spring-config replication/configs/application.yml`
89
+
73
90
# ##### Profiles
74
91
75
92
Replication can be run with one of two profiles. You can specify which profile to use in the 'spring.profiles.active'
@@ -103,6 +120,12 @@ javax.net.ssl.certAlias=localhost
103
120
` ` `
104
121
Only the properties that differ from the defaults above need to be specified in replication-ssl
105
122
123
+ To add a docker secret use the `secret create` command, which uses this syntax :
124
+ ` docker secret create <SECRET_NAME> <FILE_DIRECTORY>`
125
+
126
+ Example :
127
+ ` docker secret create replication-truststore replication/secrets/truststore.jks`
128
+
106
129
# ### Running
107
130
Running the stack will start up a solr service and the replication service.
108
131
@@ -117,7 +140,28 @@ curl -H "Content-Type: application/json" \
117
140
-d @/path/to/json/config/file.json \
118
141
http://localhost:8983/solr/ <target-core >/update?commitWithin=1000
119
142
```
143
+
144
+ #### Types and Kinds of sites
145
+ Sites can be of different types and kinds. The type and kind of the remote site (the one that's not
146
+ the local site) will determine whether the replication is a push, pull, harvest, or both push and pull.
147
+
148
+ |Site Type | Site Kind | Replication Direction |
149
+ |------------|------------|------------|
150
+ |DDF | TACTICAL | BIDIRECTIONAL |
151
+ |DDF | REGIONAL | HARVEST |
152
+ |ION | TACTICAL | BIDIRECTIONAL |
153
+ |ION | REGIONAL | PUSH |
154
+
155
+ ###### Directions
156
+ Here's how the various replication directions are defined:
157
+ PUSH - Send information to the remote site to be stored.
158
+ PULL - Retrieve information from the remote site and store it locally.
159
+ BIDIRECTIONAL - Perform both a push and a pull.
160
+ HARVEST - Similar to a pull but harvesting will ignore updates and deletes on replicated information.
161
+
120
162
###### Adding Site Example
163
+ Create a json file with site descriptions like the example below and you can use the following curl
164
+ command to save those sites for replication to use.
121
165
Example sites.json
122
166
```json
123
167
[
@@ -151,12 +195,14 @@ curl -H "Content-Type: application/json" \
151
195
http://localhost:8983/solr/replication_site/update?commitWithin=1000
152
196
```
153
197
###### Adding Replication Filters Example
198
+ Create a json file with filter descriptions like the example below and you can use the following curl
199
+ command to save those filters for replication to use.
154
200
Example filters.json
155
201
``` json
156
202
[
157
203
{
158
204
"name" :" pdf-harvest" ,
159
- "site_id" :" remote-node -id" ,
205
+ "site_id" :" remote-site -id" ,
160
206
"filter" :" \" media.type\" like 'application/pdf'" ,
161
207
"suspended" :false ,
162
208
"priority" : 0 ,
@@ -179,3 +225,25 @@ curl -X POST \
179
225
-H 'Content-Type: application/xml' \
180
226
-d '<delete><query>name_txt:Test</query></delete>'
181
227
```
228
+ Example removing all sites
229
+ ```
230
+ curl -X POST \
231
+ 'http://localhost:8983/solr/replication_site/update?commit=true' \
232
+ -H 'Content-Type: application/xml' \
233
+ -d '<delete><query>*:*</query></delete>'
234
+ ```
235
+
236
+ #### Try it out
237
+ You can try replication for yourself using the steps below as a high level overview. Details on how
238
+ to complete steps related to setting up replication can be found above, starting with
239
+ "Docker Compose Deployment".
240
+ 1 . Make sure docker is up and running. Start up a docker swarm if you haven't already.
241
+ 3 . Create docker config
242
+ 4 . Create docker secrets
243
+ 5 . Deploy stack
244
+ 6 . Create two sites, Both as REGIONAL DDFs, with URLs pointing to running DDF instances.
245
+ 7 . The remote site (The site that isn't the local site) will be your source of data. Upload test data to the source site if it has none.
246
+ 8 . Create filter. The "site_id" should match the ID of remote site. The filter can be changed to something like "\" title\" like 'test'" or
247
+ "\"title\" like '*'" to replicate everything.
248
+ 9 . execute ` docker service logs -f repsync_ion-replication ` to view the logs and wait for replication to occur. Once you start seeing logs check the
249
+ local site to see the data start coming in.
0 commit comments