final revision

This commit is contained in:
dodger 2023-10-28 10:40:40 +02:00
parent 0838e6eb6e
commit f55e66fec7
Signed by: dodger
GPG Key ID: F6701F6CB4D1C826

View File

@ -54,17 +54,17 @@ I try all the options I can imagine:
* Add a new shared drive on the _primary_, for example I shared `\\10.6.0.3\postgresql` using `R:\postgresql\` * Add a new shared drive on the _primary_, for example I shared `\\10.6.0.3\postgresql` using `R:\postgresql\`
* Grant permissions to `network service` windows "user" * Grant permissions to `network service` windows "user"
* Grant permissions to `Everyone` windows group. * Grant permissions to `Everyone` windows group.
* Combinations of the above options * Combinations of the above options (yes, I performed +10 combinations)
Until I run out of options. Until I run out of options.
Of course when I copied the file via powershell with the Admin user, it worked. All the time. Of course, when I copied any file via powershell with the Admin user, it worked. All the time.
So I'm sure the problem comes from the user which runs PostgreSQL service, I had faced similar problems in the past. So I'm sure the problem comes from the user which runs PostgreSQL service, I had faced similar problems in the past.
The problem is that I'm not a windows admin, my knowledge is limited here, I tried everything I could think, but maybe a windows sysadmin will know how to solve that permission problem. The problem is that I'm not a windows admin, my knowledge is limited here, I tried everything I could think, but maybe a windows sysadmin will know how to solve that permission problem.
## Current config ## Current config
It was late for me so I decide to do a temporary solution. I decide to do a temporary solution to bypass the current problem of `archive_command` failing.
What I did was creaete a local folder on both servers: What I did was creaete a local folder on both servers:
``` ```
R:\postgresql\local\archivelog R:\postgresql\local\archivelog
@ -92,15 +92,15 @@ In my opinion, the best option will be the one I already mention, map one networ
archive_command = 'copy "%p" "Z:\\archivelog\\%f"' archive_command = 'copy "%p" "Z:\\archivelog\\%f"'
``` ```
We should investigate permissions for this solution. We must solve the permission problem to use this solution.
### Option #2 for archiving ### Option #2 for archiving
In the case we can't achieve the #1 solution, I suggest to keep the current configuration and perform the synchronization via _scheduled_ tasks. In the case we can't achieve the solution #1, I suggest to keep the current configuration and perform the synchronization via _scheduled_ tasks.
So, for example, we will launch `rsync R:\postgresql\local\archivelog 10.6.x.3\R:\postgresql\archivelog` (the syntax will be wrong, I had never used `rsync` on windows...). So, for example, we will launch `rsync R:\postgresql\local\archivelog 10.6.x.3\R:\postgresql\archivelog` (_warning_ syntax will be wrong, it's a linux command).
To copy archivelogs from one server to the opposite. To copy archivelogs from one server to the opposite.
Alternatives to `rsync`: Alternatives for `rsync` on windows:
* [cwRsync](https://www.itefix.net/cwrsync) * [cwRsync](https://www.itefix.net/cwrsync)
* [robocopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy?redirectedfrom=MSDN) * [robocopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy?redirectedfrom=MSDN)