Move postgresql database to separate machine
In current setup , we're running multiple web services like Matrix,diaspora,poddery on a single machine. Due to limited resources of the machine , we had a frequent downtime of services . To solve this problem, its better have the separate machine for postgresql database on the Same openstack instance. Let me know what others think .
👍 And we should do it quickly too.
@isaagar make a plan, list out the steps, then schedule a down time. We should announce it to our users. We can review the steps.
@praveenarimbrathod @noteness Yes, amar already provided one machine with 40 GB disk space.
Should we start replicating the database on that VM then? ( according to https://gitlab.com/piratemovin/diasp.in/wikis/setting_up_backup )
Then, decide a time, stop all services and promote the slave to master and make the services use the new database?
Yes, i thought of that and interesting to see how slave becomes master :)
New machine has public IP which I'll share and add the others ssh keys
Following are the steps for setup.
1. Find the configuration of all web services dependent on the postgresql where we need to change it according to our new setup. (Adding it in the wiki will be helpful before starting the setup)
2. Encrypt the 40 GB disk of the new machine.
3. Setup the postgrsql on new machine (replica ? new version 9.6?).
4. Shutdown all services and Sync the database to the new machine. (~12G and will be faster locally)
5. Make changes in the configuration of services and start the services.
Shutdown all services and Sync the database to the new machine. (~12G and will be faster locally)
Do we need to shutdown all the services while replicating? Can't we just use pg_basebackup?
Not needed while replicating but we haven't decided with the approach. Whether it is replica setup or just manual moving of database to the new machine.And, to keep the new instance in sync with existing we have stop services from committing in the database before syncing to the new machine.
@praveenarimbrathod @noteness @devraj Lets finalize the steps.
How much time will we need to complete the migration? We can announce the downtime (if any )accordingly.
IMO , at the max 1 Hour . Lets do the steps 1 to 3 today.
what should we tell in the public announcement?
Server side maintenance work.
I think we can try to save some resources by shutting down services that are not used much like xmpp bridge, and possibly prosody and chat.diasp.in
Can we shutdown xmpp bridge?
opt-in by Pirate Praveen Closed Thu 28 Dec 2017 1:34PM
we are hitting the limits and I think this could be easily
Results
| Results | Option | Voters | |||
|---|---|---|---|---|---|
| Yes | 3 | ||||
| No | 0 | ||||
| Not voted | 31 |
yes, it is run for just one channel (#piratesin:diasp.in)
Why? more details please.
I trust praveen's decision on this
go ahead. We should give a blog post or something like that on closing of the service. Also asking people to migrate to other services like disroot.org or riseup.net etc.
Is #piratesin:diasp.in active? Everyone is on the matrix side, right?
yes, I don't see anyone joining via xmpp side. I think Arjun used to join, but he quit.
looks good to me. Just make sure we have proper working backups before starting the migration.