Jump to content

Navigation menu

Note: Currently new registrations are closed, if you want an account Contact us

Difference between revisions of "Poddery - Diaspora, Matrix and XMPP"

Details about compression of matrix-synapse, some re ordering and typo fixes
(Details about compression of matrix-synapse, some re ordering and typo fixes)
Line 329: Line 329:


Currently postgres database for matrix-synapse is backed up.
Currently postgres database for matrix-synapse is backed up.
===Before Replication (specific to poddery.com)===


Setup tinc vpn in the backup server
Setup tinc vpn in the backup server
Line 338: Line 340:
Copy poddery host config to backup server and podderybackup host config to poddery.com server.
Copy poddery host config to backup server and podderybackup host config to poddery.com server.


Relaod tinc vpn servie at both poddery.com and backup servers
Relaod tinc vpn service at both poddery.com and backup servers


  # systemctl reload tinc@fsci.service
  # systemctl reload tinc@fsci.service
Line 346: Line 348:
  # systemctl enable tinc@fsci.service
  # systemctl enable tinc@fsci.service


===Postgresql (for synapse) Primary configuration===
The synapse database was also pruned to reduce the size before replication by following this guide - https://levans.fr/shrink-synapse-database.html
If you want to follow this guide, make sure matrix synapse server is updated to version 1.13 atleast since it introduces the Rooms API mentioned the guide.
Changes done to steps in the guide.
 
  # jq '.rooms[] | select(.joined_local_members == 0) | .room_id' < roomlist.json | sed -e 's/"//g' > to_purge.txt
 
The room list obtained this way can, be looped to pass the room names as variables to the purge api.
 
# set +H // if you are using bash to avoid '!' in the roomname triggering the history substitution.
# for room_id in $(cat to_purge.txt); do curl --header "Authorization: Bearer <your access token>" \
    -X POST -H "Content-Type: application/json" -d "{ \"room_id\": \"$room_id\" }" \
    'https://127.0.0.1:8008/_synapse/admin/v1/purge_room'; done;
 
We also did not remove old history of large rooms.
 
===Step 1: Postgresql (for synapse) Primary configuration===


Create postgresql user for replication.
Create postgresql user for replication.
Line 381: Line 398:
  # systemctl restart postgresql
  # systemctl restart postgresql


===Postgresql (for synapse) Standby configuration: Step 2===
===Step 2: Postgresql (for synapse) Standby configuration ===


Install postgresql  
Install postgresql  
Line 403: Line 420:
  # su - postgres
  # su - postgres
  $ cd /etc/postgresql/11/
  $ cd /etc/postgresql/11/
Copy data from master and create recovery.conf
$ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch  -R


Open the postgres configuration file
Open the postgres configuration file
Line 410: Line 431:
Set the following configuration options in the postgresql.conf file
Set the following configuration options in the postgresql.conf file


  max_connections = 500
  max_connections = 500 // This option and the one below are set to be same as in postgresql.conf at primary or the service won't start.
  max_worker_processes = 16
  max_worker_processes = 16
 
  host_standby = on // The above pg_basebackup command should set it. If it's not manually turn it to on.
Copy data from master and create recovery.conf
 
  $ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch  -R


Start the stopped postgresql service
Start the stopped postgresql service