Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Wiki Replica
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
TPA
Wiki Replica
Commits
272a74e8
Verified
Commit
272a74e8
authored
5 years ago
by
anarcat
Browse files
Options
Downloads
Patches
Plain Diff
more director restore docs
parent
801ac52a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tsa/howto/backup.mdwn
+47
-0
47 additions, 0 deletions
tsa/howto/backup.mdwn
tsa/howto/postgresql.mdwn
+9
-3
9 additions, 3 deletions
tsa/howto/postgresql.mdwn
with
56 additions
and
3 deletions
tsa/howto/backup.mdwn
+
47
−
0
View file @
272a74e8
...
...
@@ -509,6 +509,15 @@ director.
killall sleep
16. switch the nagios checks over the new director: grep for the old
director name in the nagios configuration and fix up some of the
checks
git -C tor-nagios grep dictyotum
17. you will also need to restore the password file for the nagios
check in `/etc/nagios/bacula-database`
The new scheduler and director should now have completely taken over
the new one, and backups should resume. The old server can now be
[[decommissioned|retire-a-host]], if it's still around, when you feel
...
...
@@ -516,6 +525,44 @@ comfortable the new setup is working.
TODO: `15:19:55 <weasel> and once that's up and running, it'd probably be smart to upgrade it to 11. pg_upgradecluster -m upgrade --link`
TODO: some psql users still refer to host-specific usernames like
`bacula-dictyotum-reader`, maybe they should refer to role-specif
names instead?
### Troubleshooting
If you get this error:
psycopg2.OperationalError: definition of service "bacula" not found
It's probably the scheduler failing to connect to the database server,
because the `/etc/dsa/bacula-reader-database` refers to a non-existent
"service", as defined in
`/etc/postgresql-common/pg_service.conf`. Either add something like:
[bacula]
dbname=bacula
port=5433
to that file, or specify the `dbname` and `port` manually in the
config file.
If the scheduler is sending you an email every three minutes with this
error:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/dsa/bacula-reader-database'
It's because you forgot to create that file, in step 8. Similar errors
may occur if you forgot to change that password.
If the director takes a long time to start and ultimately fails with:
oct 10 18:19:41 bacula-director-01 bacula-dir[31276]: bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
oct 10 18:19:41 bacula-director-01 bacula-dir[31276]: bacula-dir JobId 0: Fatal error: postgresql.c:332 Unable to connect to PostgreSQL server. Database=bacula User=bac
oct 10 18:19:41 bacula-director-01 bacula-dir[31276]: Possible causes: SQL server not running; password incorrect; max_connections exceeded.
It's because you forgot to reset the director password, in step 9.
Get files without a director
----------------------------
...
...
This diff is collapsed.
Click to expand it.
tsa/howto/postgresql.mdwn
+
9
−
3
View file @
272a74e8
...
...
@@ -180,11 +180,12 @@ server to the database server and restores from those.
service postgresql start
tail -f /var/log/postgresql/*
11. re-enable Puppet, which should clean up the extra SSH key:
11. re-enable Puppet, which should clean up the extra SSH key and
firewall rules:
puppet agent -t
make sure it's okay in `/etc/ssh/userkeys/root`
make sure it's okay in `/etc/ssh/userkeys/root`
and `iptables -L`.
When the restore succeeds, the `recovery.conf` file will be renamed to
`recovery.done` and you will see something like:
...
...
@@ -284,11 +285,16 @@ information on how to pick a restore procedure.
beginning, but it should eventually get started and complete. The
"hang" is because `retrieve-file` sends a header which includes a
`sha512sum` and it takes a while to compute. The `sed` command in
that pipeline is there to skip that header.
that pipeline is there to skip that header. Example of a
successful restore operated in [#31786][]:
ssh torbackup@bungei.torproject.org bacula-director-01 retrieve-file pg dictyotum bacula.BASE.bungei.torproject.org-20191010-184205-dictyotum.torproject.org-bacula-9.6-backup.tar.gz | pv -s 33G | sed '0,/^$/d' | tar -C /var/lib/postgresql/9.6/main -x -z -f -
If the above doesn't work, use the indirect procedure to restore
the `BASE` file.
[#31786]: https://bugs.torproject.org/31786
6. Make sure the `pg_xlog` directory doesn't contain any files.
rm -rf -- /var/lib/postgresql/9.6/main/pg_xlog/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment