pg_easy_replicate 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +5 -0
- data/Dockerfile +2 -2
- data/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/bin/release.sh +5 -15
- data/docker-compose.yml +12 -10
- data/lib/pg_easy_replicate/helper.rb +1 -1
- data/lib/pg_easy_replicate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e58d75f6e22242f3b833838eba69bfd72cb930ad5931ef77a5c0c4f49aded8
|
4
|
+
data.tar.gz: 8ff3c66b8ee6b37bcadb801f57fa668019fc7c36c5cabf5639c65d3b80813eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d337088ee7ccf6855c45328502c587172cd96fb4b57bb386a6774665277d5753533f7876fadc28d6088ab0ecfb4cc9e201245d8a05f83ca178f9dd6376df4a00
|
7
|
+
data.tar.gz: 8d44166f5ad25773462e952109b315195229e1127639296e3f4f56341823af60fd7feba3bef1ffcbd32cbb864cab28117bbedda3ceb9949aa96451296bc63a78
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.4
|
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -216,3 +216,11 @@ Next, you can set up a program that watches the `stats` and waits until `switcho
|
|
216
216
|
In this strategy, you have a weighted based DNS system (example [AWS Route53 weighted records](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-weighted.html)) where 100% of traffic goes to a primary origin and 0% to a secondary origin. The primary origin here is the DNS host for your source database and secondary origin is the DNS host for your target database. You can set up your application ahead of time to interact with the database using DNS from the weighted group.
|
217
217
|
|
218
218
|
Next, you can set up a program that watches the `stats` and waits until `switchover_completed_at` is reporting as `true`. Once that happens it updates the weight in the DNS weighted group where 100% of the requests now go to the new/target database. Note: Keeping a low `ttl` is recommended.
|
219
|
+
|
220
|
+
## Contributing
|
221
|
+
|
222
|
+
PRs most welcome. You can get started locally by
|
223
|
+
|
224
|
+
- `docker compose down -v && docker compose up --remove-orphans --build`
|
225
|
+
- Install ruby `3.1.4` using RVM ([instruction](https://rvm.io/rvm/install#any-other-system))
|
226
|
+
- `bundle exec rspec` for specs
|
data/bin/release.sh
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
export VERSION=$1
|
2
2
|
echo "VERSION: ${VERSION}"
|
3
3
|
|
4
|
-
echo "=== Pushing tags to github ===="
|
5
|
-
git tag v"$VERSION"
|
6
|
-
git push origin --tags
|
7
|
-
|
8
4
|
echo "=== Building Gem ===="
|
9
5
|
gem build pg_easy_replicate.gemspec
|
10
6
|
|
@@ -14,15 +10,9 @@ gem push pg_easy_replicate-"$VERSION".gem
|
|
14
10
|
echo "=== Sleeping for 5s ===="
|
15
11
|
sleep 5
|
16
12
|
|
17
|
-
echo "===
|
18
|
-
|
19
|
-
|
20
|
-
echo "=== Tagging Image ===="
|
21
|
-
docker image tag shayonj/pg_easy_replicate:"$VERSION" shayonj/pg_easy_replicate:latest
|
22
|
-
|
23
|
-
echo "=== Pushing Image ===="
|
24
|
-
docker push shayonj/pg_easy_replicate:"$VERSION"
|
25
|
-
docker push shayonj/pg_easy_replicate:latest
|
13
|
+
# echo "=== Pushing tags to github ===="
|
14
|
+
# git tag v"$VERSION"
|
15
|
+
# git push origin --tags
|
26
16
|
|
27
|
-
echo "=== Cleaning up ===="
|
28
|
-
rm pg_easy_replicate-"$VERSION".gem
|
17
|
+
# echo "=== Cleaning up ===="
|
18
|
+
# rm pg_easy_replicate-"$VERSION".gem
|
data/docker-compose.yml
CHANGED
@@ -1,32 +1,34 @@
|
|
1
1
|
version: "3.7"
|
2
2
|
services:
|
3
3
|
source_db:
|
4
|
-
image: postgres:12
|
4
|
+
image: postgres:12
|
5
5
|
ports:
|
6
6
|
- "5432:5432"
|
7
7
|
environment:
|
8
8
|
POSTGRES_USER: jamesbond
|
9
9
|
POSTGRES_PASSWORD: jamesbond
|
10
10
|
POSTGRES_DB: postgres
|
11
|
-
command:
|
12
|
-
-
|
13
|
-
-
|
14
|
-
-
|
11
|
+
command: >
|
12
|
+
-c wal_level=logical
|
13
|
+
-c ssl=on
|
14
|
+
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
15
|
+
-c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
15
16
|
networks:
|
16
17
|
localnet:
|
17
18
|
|
18
19
|
target_db:
|
19
|
-
image: postgres:12
|
20
|
+
image: postgres:12
|
20
21
|
ports:
|
21
22
|
- "5433:5432"
|
22
23
|
environment:
|
23
24
|
POSTGRES_USER: jamesbond
|
24
25
|
POSTGRES_PASSWORD: jamesbond
|
25
26
|
POSTGRES_DB: postgres
|
26
|
-
command:
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
27
|
+
command: >
|
28
|
+
-c wal_level=logical
|
29
|
+
-c ssl=on
|
30
|
+
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
31
|
+
-c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
30
32
|
networks:
|
31
33
|
localnet:
|
32
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_easy_replicate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shayon Mukherjee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lockbox
|