Skip to content

Commit 5a50448

Browse files
authored
Merge pull request #93 from wireapp/WPB-21366-re-align-brig-index-help
[WPB-21366] Re-align help for brig-index with postgres args.
2 parents 9195b56 + c655460 commit 5a50448

1 file changed

Lines changed: 42 additions & 8 deletions

File tree

src/developer/reference/elastic-search.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,29 @@ BRIG_CASSANDRA_KEYSPACE=<YOUR_C*_KEYSPACE>
3333
WIRE_VERSION=<VERSION_YOU_ARE_DEPLOYING>
3434
GALLEY_HOST=<HOSTNAME OF RUNNING GALLEY INSTANCE>
3535
GALLEY_PORT=<PORT NUMBER OF RUNNING GALLEY INSTANCE>
36+
PG_SETTINGS=<eg., '{"host":"127.0.0.1","port":"5432","user":"wire-server","dbname":"backendA"}'>
37+
PG_PASSWORD_FILE=<eg., ./libs/wire-subsystems/test/resources/postgres-credentials.yaml>
3638

3739
docker run "quay.io/wire/brig-index:$WIRE_VERSION" migrate-data \
3840
--elasticsearch-server "http://$ES_HOST:$ES_PORT" \
3941
--elasticsearch-index "$ES_INDEX" \
4042
--cassandra-host "$BRIG_CASSANDRA_HOST" \
4143
--cassandra-port "$BRIG_CASSANDRA_PORT" \
42-
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE"
43-
--galley-host "$GALLEY_HOST"
44-
--galley-port "$GALLEY_PORT"
44+
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \
45+
--galley-host "$GALLEY_HOST" \
46+
--galley-port "$GALLEY_PORT" \
47+
--pg-pool-size 10 \
48+
--pg-pool-acquisition-timeout 10s \
49+
--pg-pool-aging-timeout 1d \
50+
--pg-pool-idleness-timeout 1h \
51+
--pg-settings "$PG_SETTINGS" \
52+
--pg-password-file "$PG_PASSWORD_FILE"
4553
```
4654

55+
NB: brig-index supports --help both for global params and
56+
sub-commands. If anything goes wrong or if in doubt, take a look at
57+
that for alwasy up to date information.
58+
4759
(Or, as above, you can also do the same thing without docker.)
4860

4961
## Refill ES documents from Cassandra
@@ -61,15 +73,23 @@ BRIG_CASSANDRA_KEYSPACE=<YOUR_C*_KEYSPACE>
6173
WIRE_VERSION=<VERSION_YOU_ARE_DEPLOYING>
6274
GALLEY_HOST=<HOSTNAME OF RUNNING GALLEY INSTANCE>
6375
GALLEY_PORT=<PORT NUMBER OF RUNNING GALLEY INSTANCE>
76+
PG_SETTINGS=<eg., '{"host":"127.0.0.1","port":"5432","user":"wire-server","dbname":"backendA"}'>
77+
PG_PASSWORD_FILE=<eg., ./libs/wire-subsystems/test/resources/postgres-credentials.yaml>
6478

6579
docker run "quay.io/wire/brig-index:$WIRE_VERSION" reindex \
6680
--elasticsearch-server "http://$ES_HOST:$ES_PORT" \
6781
--elasticsearch-index "$ES_INDEX" \
6882
--cassandra-host "$BRIG_CASSANDRA_HOST" \
6983
--cassandra-port "$BRIG_CASSANDRA_PORT" \
70-
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE"
71-
--galley-host "$GALLEY_HOST"
72-
--galley-port "$GALLEY_PORT"
84+
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \
85+
--galley-host "$GALLEY_HOST" \
86+
--galley-port "$GALLEY_PORT" \
87+
--pg-pool-size 10 \
88+
--pg-pool-acquisition-timeout 10s \
89+
--pg-pool-aging-timeout 1d \
90+
--pg-pool-idleness-timeout 1h \
91+
--pg-settings "$PG_SETTINGS" \
92+
--pg-password-file "$PG_PASSWORD_FILE"
7393
```
7494

7595
Subcommand `reindex-if-same-or-newer` can be used instead of `reindex`, if you want to recreate the documents in elasticsearch regardless of their version.
@@ -147,6 +167,8 @@ ES_NEW_INDEX=<NEW_INDEX_NAME>
147167
WIRE_VERSION=<VERSION_YOU_ARE_DEPLOYING>
148168
GALLEY_HOST=<HOSTNAME OF RUNNING GALLEY INSTANCE>
149169
GALLEY_PORT=<PORT NUMBER OF RUNNING GALLEY INSTANCE>
170+
PG_SETTINGS=<eg., '{"host":"127.0.0.1","port":"5432","user":"wire-server","dbname":"backendA"}'>
171+
PG_PASSWORD_FILE=<eg., ./libs/wire-subsystems/test/resources/postgres-credentials.yaml>
150172

151173
# Use curl http://$ES_OLD_HOST:$ES_OLD_PORT/$ES_OLD_INDEX/_settings
152174
# to know previous values of SHARDS, REPLICAS and REFRESH_INTERVAL
@@ -162,6 +184,12 @@ BRIG_CASSANDRA_KEYSPACE=<YOUR_C*_KEYSPACE>
162184
1. Create the new index
163185
```bash
164186
docker run "quay.io/wire/brig-index:$WIRE_VERSION" create \
187+
--pg-pool-size 10 \
188+
--pg-pool-acquisition-timeout 10s \
189+
--pg-pool-aging-timeout 1d \
190+
--pg-pool-idleness-timeout 1h \
191+
--pg-settings "$PG_SETTINGS" \
192+
--pg-password-file "$PG_PASSWORD_FILE" \
165193
--elasticsearch-server "http://$ES_NEW_HOST:$ES_NEW_PORT" \
166194
--elasticsearch-index "$ES_NEW_INDEX" \
167195
--elasticsearch-shards "$SHARDS" \
@@ -175,12 +203,18 @@ BRIG_CASSANDRA_KEYSPACE=<YOUR_C*_KEYSPACE>
175203
4. Reindex data to the new index
176204
```bash
177205
docker run "quay.io/wire/brig-index:$WIRE_VERSION" migrate-data \
206+
--pg-pool-size 10 \
207+
--pg-pool-acquisition-timeout 10s \
208+
--pg-pool-aging-timeout 1d \
209+
--pg-pool-idleness-timeout 1h \
210+
--pg-settings "$PG_SETTINGS" \
211+
--pg-password-file "$PG_PASSWORD_FILE" \
178212
--elasticsearch-server "http://$ES_NEW_HOST:$ES_NEW_PORT" \
179213
--elasticsearch-index "$ES_NEW_INDEX" \
180214
--cassandra-host "$BRIG_CASSANDRA_HOST" \
181215
--cassandra-port "$BRIG_CASSANDRA_PORT" \
182-
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE"
183-
--galley-host "$GALLEY_HOST"
216+
--cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \
217+
--galley-host "$GALLEY_HOST" \
184218
--galley-port "$GALLEY_PORT"
185219
```
186220
5. Remove `elasticsearch.additionalWriteIndex` and

0 commit comments

Comments
 (0)