From c655460dcdf2ef41367d1d4626ffbfeb06bdb023 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 21 Jan 2026 14:20:08 +0100 Subject: [PATCH] Re-align help for brig-index with postgres args. --- src/developer/reference/elastic-search.md | 50 +++++++++++++++++++---- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/developer/reference/elastic-search.md b/src/developer/reference/elastic-search.md index 04c3725..1855617 100644 --- a/src/developer/reference/elastic-search.md +++ b/src/developer/reference/elastic-search.md @@ -33,17 +33,29 @@ BRIG_CASSANDRA_KEYSPACE= WIRE_VERSION= GALLEY_HOST= GALLEY_PORT= +PG_SETTINGS= +PG_PASSWORD_FILE= docker run "quay.io/wire/brig-index:$WIRE_VERSION" migrate-data \ --elasticsearch-server "http://$ES_HOST:$ES_PORT" \ --elasticsearch-index "$ES_INDEX" \ --cassandra-host "$BRIG_CASSANDRA_HOST" \ --cassandra-port "$BRIG_CASSANDRA_PORT" \ - --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" - --galley-host "$GALLEY_HOST" - --galley-port "$GALLEY_PORT" + --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \ + --galley-host "$GALLEY_HOST" \ + --galley-port "$GALLEY_PORT" \ + --pg-pool-size 10 \ + --pg-pool-acquisition-timeout 10s \ + --pg-pool-aging-timeout 1d \ + --pg-pool-idleness-timeout 1h \ + --pg-settings "$PG_SETTINGS" \ + --pg-password-file "$PG_PASSWORD_FILE" ``` +NB: brig-index supports --help both for global params and +sub-commands. If anything goes wrong or if in doubt, take a look at +that for alwasy up to date information. + (Or, as above, you can also do the same thing without docker.) ## Refill ES documents from Cassandra @@ -61,15 +73,23 @@ BRIG_CASSANDRA_KEYSPACE= WIRE_VERSION= GALLEY_HOST= GALLEY_PORT= +PG_SETTINGS= +PG_PASSWORD_FILE= docker run "quay.io/wire/brig-index:$WIRE_VERSION" reindex \ --elasticsearch-server "http://$ES_HOST:$ES_PORT" \ --elasticsearch-index "$ES_INDEX" \ --cassandra-host "$BRIG_CASSANDRA_HOST" \ --cassandra-port "$BRIG_CASSANDRA_PORT" \ - --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" - --galley-host "$GALLEY_HOST" - --galley-port "$GALLEY_PORT" + --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \ + --galley-host "$GALLEY_HOST" \ + --galley-port "$GALLEY_PORT" \ + --pg-pool-size 10 \ + --pg-pool-acquisition-timeout 10s \ + --pg-pool-aging-timeout 1d \ + --pg-pool-idleness-timeout 1h \ + --pg-settings "$PG_SETTINGS" \ + --pg-password-file "$PG_PASSWORD_FILE" ``` 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= WIRE_VERSION= GALLEY_HOST= GALLEY_PORT= +PG_SETTINGS= +PG_PASSWORD_FILE= # Use curl http://$ES_OLD_HOST:$ES_OLD_PORT/$ES_OLD_INDEX/_settings # to know previous values of SHARDS, REPLICAS and REFRESH_INTERVAL @@ -162,6 +184,12 @@ BRIG_CASSANDRA_KEYSPACE= 1. Create the new index ```bash docker run "quay.io/wire/brig-index:$WIRE_VERSION" create \ + --pg-pool-size 10 \ + --pg-pool-acquisition-timeout 10s \ + --pg-pool-aging-timeout 1d \ + --pg-pool-idleness-timeout 1h \ + --pg-settings "$PG_SETTINGS" \ + --pg-password-file "$PG_PASSWORD_FILE" \ --elasticsearch-server "http://$ES_NEW_HOST:$ES_NEW_PORT" \ --elasticsearch-index "$ES_NEW_INDEX" \ --elasticsearch-shards "$SHARDS" \ @@ -175,12 +203,18 @@ BRIG_CASSANDRA_KEYSPACE= 4. Reindex data to the new index ```bash docker run "quay.io/wire/brig-index:$WIRE_VERSION" migrate-data \ + --pg-pool-size 10 \ + --pg-pool-acquisition-timeout 10s \ + --pg-pool-aging-timeout 1d \ + --pg-pool-idleness-timeout 1h \ + --pg-settings "$PG_SETTINGS" \ + --pg-password-file "$PG_PASSWORD_FILE" \ --elasticsearch-server "http://$ES_NEW_HOST:$ES_NEW_PORT" \ --elasticsearch-index "$ES_NEW_INDEX" \ --cassandra-host "$BRIG_CASSANDRA_HOST" \ --cassandra-port "$BRIG_CASSANDRA_PORT" \ - --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" - --galley-host "$GALLEY_HOST" + --cassandra-keyspace "$BRIG_CASSANDRA_KEYSPACE" \ + --galley-host "$GALLEY_HOST" \ --galley-port "$GALLEY_PORT" ``` 5. Remove `elasticsearch.additionalWriteIndex` and