Skip to content

Commit 06d64f8

Browse files
authored
Aggregate backup in neo4j-admin helm chart (#1719) (#1721)
Cherry-picked from #1719
1 parent 680f71d commit 06d64f8

File tree

1 file changed

+174
-3
lines changed

1 file changed

+174
-3
lines changed

modules/ROOT/pages/kubernetes/operations/backup-restore.adoc

Lines changed: 174 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[role=enterprise-edition]
22
[[kubernetes-neo4j-backup-restore]]
3-
= Back up and restore (online)
3+
= Back up, aggregate, and restore (online)
44

55
[NOTE]
66
====
@@ -323,6 +323,7 @@ consistencyCheck:
323323
enabled: true
324324
----
325325

326+
[role=label--new-5.16]
326327
[[kubernetes-neo4j-backup-on-prem]]
327328
== Prepare to back up a database(s) to on-premises storage
328329

@@ -390,7 +391,7 @@ disableLookups: false
390391
391392
neo4j:
392393
image: "neo4j/helm-charts-backup"
393-
imageTag: "5.16.0"
394+
imageTag: "5.21.0"
394395
podLabels: {}
395396
# app: "demo"
396397
# acac: "dcdddc"
@@ -445,7 +446,7 @@ backup:
445446
database: ""
446447
# cloudProvider can be either gcp, aws, or azure
447448
# if cloudProvider is empty then the backup will be done to the /backups mount.
448-
# the /backups mount can point to a persitentVolume based on the definition set in tempVolume
449+
# the /backups mount can point to a persistentVolume based on the definition set in tempVolume
449450
cloudProvider: ""
450451
451452
@@ -490,6 +491,20 @@ backup:
490491
verbose: true
491492
heapSize: ""
492493
494+
# https://neo4j.com/docs/operations-manual/current/backup-restore/aggregate/
495+
# Performs aggregate backup. If enabled, NORMAL BACKUP WILL NOT BE DONE only aggregate backup
496+
# fromPath supports only s3 or local mount. For s3 , please set cloudProvider to aws and use either serviceAccount or creds
497+
aggregate:
498+
enabled: false
499+
verbose: true
500+
keepOldBackup: false
501+
parallelRecovery: false
502+
# Only AWS S3 or local mount paths are supported
503+
# For S3 provide the complete path , Ex: s3://bucket1/bucket2
504+
fromPath: ""
505+
# database name to aggregate. Can contain * and ? for globbing.
506+
database: ""
507+
493508
#Below are all neo4j-admin database check flags / options
494509
#To know more about the flags read here : https://neo4j.com/docs/operations-manual/current/tools/neo4j-admin/consistency-checker/
495510
consistencyCheck:
@@ -597,6 +612,162 @@ This pod performs a backup of one or multiple databases, a consistency check of
597612
. Monitor the backup pod logs using `kubectl logs pod/<neo4j-backup-pod-name>` to check the progress of the backup.
598613
. Check that the backup files and the consistency check reports have been uploaded to the cloud provider bucket or on-premises storage.
599614

615+
[role=label--new-5.21]
616+
[[kubernetes-neo4j-backup-aggregate]]
617+
== Aggregate a database backup chain
618+
619+
The aggregate backup command turns a backup chain into a single backup file.
620+
This is useful when you have a backup chain that you want to restore to a different cluster, or when you want to archive a backup chain.
621+
For more information on the benefits of the aggregate backup chain operation, its syntax and available options, see xref:backup-restore/aggregate.adoc[Aggregate a database backup chain].
622+
623+
[NOTE]
624+
====
625+
The neo4j-admin Helm chart supports aggregating a backup chain stored in an AWS S3 bucket or a local mount.
626+
If enabled, normal backup will not be done, only aggregate backup.
627+
====
628+
629+
. To aggregate a backup chain stored in an AWS S3 bucket or a local mount, you need to provide the following information in your _backup-values.yaml_ file:
630+
+
631+
[.tabbed-example]
632+
=====
633+
[.include-with-aws]
634+
======
635+
636+
If your backup chain is stored on AWS S3, you need to set cloudProvider to `aws` and use either `creds` or `serviceAccount` to connect to your AWS S3 bucket.
637+
For example:
638+
639+
.Connect to your AWS S3 bucket using the `awscreds` secret
640+
[source, yaml, role='noheader']
641+
----
642+
neo4j:
643+
image: "neo4j/helm-charts-backup"
644+
imageTag: "5.21.0"
645+
jobSchedule: "* * * * *"
646+
successfulJobsHistoryLimit: 3
647+
failedJobsHistoryLimit: 1
648+
backoffLimit: 3
649+
650+
backup:
651+
652+
cloudProvider: "aws"
653+
secretName: "awscreds"
654+
secretKeyName: "credentials"
655+
656+
aggregate:
657+
enabled: true
658+
verbose: false
659+
keepOldBackup: false
660+
parallelRecovery: false
661+
fromPath: "s3://bucket1/bucket2"
662+
# Database name to aggregate. Can contain * and ? for globbing.
663+
database: "neo4j"
664+
665+
resources:
666+
requests:
667+
ephemeralStorage: "4Gi"
668+
limits:
669+
ephemeralStorage: "5Gi"
670+
----
671+
672+
.Connect to your AWS S3 bucket using `serviceAccount`
673+
[source, yaml, role='noheader']
674+
----
675+
neo4j:
676+
image: "neo4j/helm-charts-backup"
677+
imageTag: "5.21.0"
678+
jobSchedule: "* * * * *"
679+
successfulJobsHistoryLimit: 3
680+
failedJobsHistoryLimit: 1
681+
backoffLimit: 3
682+
683+
backup:
684+
685+
cloudProvider: "aws"
686+
687+
aggregate:
688+
enabled: true
689+
verbose: false
690+
keepOldBackup: false
691+
parallelRecovery: false
692+
fromPath: "s3://bucket1/bucket2"
693+
# Database name to aggregate. Can contain * and ? for globbing.
694+
database: "neo4j"
695+
696+
#The service account must already exist in your cloud provider account and have the necessary permissions to manage your S3 bucket, as well as to download and upload files. See the example policy below.
697+
#{
698+
# "Version": "2012-10-17",
699+
# "Id": "Neo4jBackupAggregatePolicy",
700+
# "Statement": [
701+
# {
702+
# "Sid": "Neo4jBackupAggregateStatement",
703+
# "Effect": "Allow",
704+
# "Action": [
705+
# "s3:ListBucket",
706+
# "s3:GetObject",
707+
# "s3:PutObject",
708+
# "s3:DeleteObject"
709+
# ],
710+
# "Resource": [
711+
# "arn:aws:s3:::mybucket/*",
712+
# "arn:aws:s3:::mybucket"
713+
# ]
714+
# }
715+
# ]
716+
#}
717+
serviceAccountName: "my-service-account"
718+
719+
resources:
720+
requests:
721+
ephemeralStorage: "4Gi"
722+
limits:
723+
ephemeralStorage: "5Gi"
724+
725+
----
726+
======
727+
[.include-with-local-mount]
728+
======
729+
[source, yaml, role='noheader']
730+
----
731+
neo4j:
732+
image: "neo4j/helm-charts-backup"
733+
imageTag: "5.21.0"
734+
successfulJobsHistoryLimit: 1
735+
failedJobsHistoryLimit: 1
736+
backoffLimit: 1
737+
738+
backup:
739+
740+
aggregate:
741+
enabled: true
742+
verbose: false
743+
keepOldBackup: false
744+
parallelRecovery: false
745+
fromPath: "/backups"
746+
# Database name to aggregate. Can contain * and ? for globbing.
747+
database: "neo4j"
748+
749+
tempVolume:
750+
persistentVolumeClaim:
751+
claimName: aggregate-pv-pvc
752+
753+
resources:
754+
requests:
755+
ephemeralStorage: "4Gi"
756+
limits:
757+
ephemeralStorage: "5Gi"
758+
----
759+
======
760+
=====
761+
. Install the _neo4j-admin_ Helm chart using the configured _backup-values.yaml_ file:
762+
+
763+
[source, shell, role='noheader']
764+
----
765+
helm install backup-name neo4j-admin -f /path/to/your/backup-values.yaml
766+
----
767+
. Monitor the pod logs using `kubectl logs pod/<neo4j-aggregate-backup-pod-name>` to check the progress of the aggregate backup operation.
768+
. Verify that the aggregated backup file has replaced your backup chain in the cloud provider bucket or on-premises storage.
769+
770+
600771
[[kubernetes-neo4j-restore]]
601772
== Restore a single database
602773

0 commit comments

Comments
 (0)