Skip to content

Commit 1f5e011

Browse files
Kiefer Coverkcover
Kiefer Cover
authored andcommitted
Upgrade ReadMe
1 parent 3b5d1a2 commit 1f5e011

File tree

1 file changed

+73
-5
lines changed

1 file changed

+73
-5
lines changed

README.md

+73-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ Derived resources, from products such as NITFs, will not be replicated.
2121
## Docker Compose Deployment
2222

2323
#### 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.
2527

2628
###### 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
2830

2931
|Config Name | Description|
3032
|------------|------------|
@@ -34,21 +36,30 @@ The configuration that replication uses that need to be populated in docker conf
3436
Example replication-spring-config
3537
```yaml
3638
logging:
37-
level:
39+
level:
40+
#You can adjust the log levels of a package or class in this section
3841
root: INFO
3942
org.apache.cxf.interceptor.LoggingOutInterceptor: WARN
4043
org.apache.cxf.interceptor.LoggingInInterceptor: WARN
4144
javax.xml.soap: ERROR
4245
spring:
4346
data:
4447
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
4651
profiles.active: Classic
4752
replication:
53+
#This is the number of seconds between each replication, lower it if you're going to be testing.
4854
period: 300
55+
#Timeouts for calls to sites
4956
connectionTimeout: 30
5057
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.
5161
localSite: some-unique-id-1234
62+
#The remote sites to handle replication for, remove this to handle replication for all sites.
5263
sites:
5364
- site1
5465
- site2
@@ -70,6 +81,12 @@ management:
7081
enabled: true
7182
```
7283
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+
7390
###### Profiles
7491

7592
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
103120
```
104121
Only the properties that differ from the defaults above need to be specified in replication-ssl
105122

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+
106129
#### Running
107130
Running the stack will start up a solr service and the replication service.
108131

@@ -117,7 +140,28 @@ curl -H "Content-Type: application/json" \
117140
-d @/path/to/json/config/file.json \
118141
http://localhost:8983/solr/<target-core>/update?commitWithin=1000
119142
```
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+
120162
###### 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.
121165
Example sites.json
122166
```json
123167
[
@@ -151,12 +195,14 @@ curl -H "Content-Type: application/json" \
151195
http://localhost:8983/solr/replication_site/update?commitWithin=1000
152196
```
153197
###### 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.
154200
Example filters.json
155201
```json
156202
[
157203
{
158204
"name":"pdf-harvest",
159-
"site_id":"remote-node-id",
205+
"site_id":"remote-site-id",
160206
"filter":"\"media.type\" like 'application/pdf'",
161207
"suspended":false,
162208
"priority": 0,
@@ -179,3 +225,25 @@ curl -X POST \
179225
-H 'Content-Type: application/xml' \
180226
-d '<delete><query>name_txt:Test</query></delete>'
181227
```
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

Comments
 (0)