Skip to content

Commit 74c63e9

Browse files
committed
Copy minutely replication diffs to S3
1 parent f1a403d commit 74c63e9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cookbooks/planet/files/default/replication-bin/replicate-minute

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ osmdbt-catchup --quiet
88
osmdbt-get-log --quiet
99
osmdbt-catchup --quiet
1010
osmdbt-create-diff --quiet --with-comment --max-changes=50000
11+
12+
cd /store/planet/replication/minute
13+
14+
. state.txt
15+
16+
sequencePart1=$(($sequenceNumber / 1000000 % 1000))
17+
sequencePart2=$(($sequenceNumber / 1000 % 1000))
18+
sequencePart3=$(($sequenceNumber % 1000))
19+
diffPath=$(printf "%03d/%03d/%03d" $sequencePart1 $sequencePart2 $sequencePart3)
20+
21+
/opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING "${diffPath}.osc.gz" "s3://osm-planet-eu-central-1/planet/replication/minute/${diffPath}.osc.gz"
22+
/opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING "${diffPath}.state.txt" "s3://osm-planet-eu-central-1/planet/replication/minute/${diffPath}.state.txt"
23+
/opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING "state.txt" "s3://osm-planet-eu-central-1/planet/replication/minute/state.txt"

cookbooks/planet/recipes/replication.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@
269269
working_directory "/etc/replication"
270270
exec_start "/usr/local/bin/replicate-minute"
271271
sandbox :enable_network => true
272+
protect_home "tmpfs"
273+
bind_paths "/home/planet"
272274
read_write_paths [
273275
"/run/replication",
274276
"/store",

0 commit comments

Comments
 (0)