New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some imporvements on barman documentation #559
Comments
The idea behind running We'll update the documentation to make this clearer. |
@mikewallace1979 Thank you so much for clarifying things for me, and now I saw the commit and that's perfect. But I am still little bit confused, am sorry to reply to the closed issue. On this line,
You can create a specific superuser in PostgreSQL, named barman, as follows: postgres@pg$ createuser -s -P barman Based on the above statement, I am creating a user 'barman' on pg, and am running that checking command as 'barman' on the ' backup' host, that's what am not getting. Do I have to create a user with the same name on both pg and backup hosts? My second question is, by default when I install PostgreSQL it will create a 'Postgres' user to access a database. So does the doc refer to the default Postgres user by PostgreSQL or is it just a Linux user? Thank you. |
You don't need to create a user with the same name on both hosts - what is happening is the PostgreSQL user named "barman" is being used to connect to PostgreSQL from the Stepping through the whole process, we start after PostgreSQL is installed on the
When you run This PostgreSQL user named "barman" is used by Barman to connect to PostgreSQL - because Barman runs under the "barman" Linux user we must therefore make sure the "barman" Linux user on the If you follow the docs you'll add the password entered during the Whatever authentication method you use, a PostgreSQL client running under the "barman" Linux account should be able to authenticate to the PostgreSQL server on the Does this help clear things up? |
Again, thank you so much for taking a time to explain everything. Now things are clearer than before, but can I please still add some questions and suggestions to the doc?
|
Hello @mikewallace1979, I also find some issues with running this command as barman docs states to check if a streaming connection is working,
and I check out this (Streaming Replication Protocol) link and try to fix it with a command I saw on this documentation, |
@mikewallace1979 I am trying my best to follow the doc and finish all barman setup.
now after I restarted PostgreSQL process, I switched to postgres user and typed |
@elhananjair The PostgreSQL server name in the If the test command is successful you should see:
We'll add this to the docs when the rest of the issues documented here are addressed. |
@mikewallace1979 Thank you so so much. I could find the problem thanks to you, I thought [pg] is predefined section, but now it's clear. Thanks again. |
@mikewallace1979 am really sorry it's me again 😢, as you mentioned above I could finally see
I jumped over the topic "WAL archiving via rsync/SSH" since I already chose to use WAL archiving via barman-wal-archive. The next step is Verification of WAL archiving configuration, and I executed this command,
After that, I tried to run barman check nextcloud-server to check if the WAL archiving has been correctly configured as the documentation states. and here is the output Can I add one generic question too, do I need to set cron job for both stream backup and wal archiving? I saw cron mentioned on wall streaming section but it doesn't say much about it on that particular topic. |
There are a few reasons why you might see Alternatively, try running As far as cron goes, |
@mikewallace1979 thanks again, I checked PostgreSQL log file and I found this:
I just followed the documentation all along, I have configured ssh correctly and I have tested it from both machines as the documentation specifies and it was working. In addition to that, as you mentioned I tried to run psql -d 'CONNINFO', and it works fine:
I am not sure what am missing here. |
Ok - so that eliminates the PostgreSQL connection itself as a possible cause. It's possible the
The errors in the PostgreSQL log tell us that archive_command failing - this will also be a problem since the |
@mikewallace1979 Thank you.
but I have followed the documentation on creating a barman user... this is why somehow the documentation is confusing @mikewallace1979.
and
does '000000010000000D00000046' implies some unique thing or you used it as an example? In my case I just used an output from select pg_walfile_name(pg_switch_wal()); and here is an output from barman-wal-archive nextcloud-backup nextcloud-server pg_wal/000000010000000000000001 and from the screenshot, I have uploaded here it shows that directories: FAIED (/var/lib/barman: permission denied), is this where WAL will be archived? and there is none in barman doc that mentions creating barman directory inside /var/lib/barman, I have created it myself and set ownership to a barman user, correct me if am doing it wrong. |
Could you also run
I didn't notice the permission denied error on |
Thanks again for taking a time and helping me @mikewallace1979
here is the output from the above command, and I think it worked now, I checked inside, /var/lib/barman/nextcloud-server/incoming/ and found the WAL log file that I tried from nextcloud-server using barman-wal-archive
I did create /var/lib/barman and the error with FAILED (/var/lib/barman: permission denied) has gone now and the barman directory is now with some files... and inside the pg_wal folder am seeing a bunch of WAL files, since it's changing rapidly I tested the above command with the resent wall log file. |
@elhananjair Great - so WAL archiving looks like it's working ( We've established that the connection string in |
Unfortunately, it is still being shown as FAILED
I set log level to debug, and here is the log.
I just tried barman cron to execute start WAL archiving operations as the doc states: the output from CLI is this
but I have checked out barman log and every minute there is an error showing up, and btw I tried to stop this process using: I am still having a hard time fully understanding barman from the documentation 😢 |
It looks like barman is unable to find the password it needs to make the connection successfully - you need to create a
where |
and another unusual thing I saw:
I think I am commenting too much on this issue, so I should write more comments I guess @mikewallace1979, can you please just suggest to me in what way I should go forward having this issue... and thank you so much for helping me out. |
Firstly, can you check whether the
and if you see output like this:
then enable and start crond:
Secondly, it looks like the streaming_barman connection is broken - do you have an entry in your Thirdly, the message Hopefully these three things should fix WAL streaming and you should see files being written to One thing I do not understand is that |
|
-hello @mikewallace1979, I was updating the last comment and it didn't get updated. Here is new update thanks to you, I added the streaming_barman user to
Now everything is perfect and no error is showing up. both Finally, do I have to do something about these errors from barman.log or leave it like that...
I cant thank you enough @mikewallace1979 you helped me a lot. Thank you so much! |
@elhananjair You're welcome - glad you got it working in the end :) I think those You can probably just remove the |
I had configured inside two different files, 1. the one I created as nextcloud-server.conf and I also used template config file streaming-server.conf-template to do the same thing, now I removed streaming-server.conf and the error has gone. Thanks. Final question does Thanks @mikewallace1979 now this issue can be closed I guess, this whole started as an improvement to the documentation, I hope some updates will be done very soon to the doc. |
I'll keep the issue open until we've updated the relevant points in the docs :) |
Adds a note about the psql binary in the `PostgreSQL client/server binaries` section of the manual. Relates to #559.
Adds an example response for the psql command used to verify that the that the streaming connection is working. Relates to #559.
Adds example responses for the `barman-wal-archive --test` and `barman-wal-restore --test` commands. Relates to #559.
Adds a note which clarifies that the `barman cron` cron entry handles background maintenance tasks and does not perform regularly scheduled backups. Relates to #559.
Adds a note about the psql binary in the `PostgreSQL client/server binaries` section of the manual. Relates to EnterpriseDB#559.
Adds an example response for the psql command used to verify that the that the streaming connection is working. Relates to EnterpriseDB#559.
Adds example responses for the `barman-wal-archive --test` and `barman-wal-restore --test` commands. Relates to EnterpriseDB#559.
Adds a note which clarifies that the `barman cron` cron entry handles background maintenance tasks and does not perform regularly scheduled backups. Relates to EnterpriseDB#559.
Hello there, I am trying to set up barman for the first time and its a little bit confusing, the documentation. I have created a user called barman on hostname called 'pg' as the doc says, and then at this point:
I got lost, barman@backup, I thought I should test that on pg instance not on the backup as the documentation says, in addition to that the user must be postgres to run the above command. Actually, I tested this as postgres@pg and it seems working like that. Here is an output in my case.
I just wanna suggest a correction if my correction is right, and a little bit of improvement on the documentation, to grasp the concepts easily.
Thank you.
The text was updated successfully, but these errors were encountered: