🚀 Testen Sie Zilliz Cloud, die vollständig verwaltete Milvus, kostenlos – erleben Sie 10x schnellere Leistung! Jetzt testen>>

milvus-logo
LFAI
  • Home
  • Blog
  • Wie man das Milvus Backup Tool benutzt: Eine Schritt-für-Schritt-Anleitung

Wie man das Milvus Backup Tool benutzt: Eine Schritt-für-Schritt-Anleitung

  • Engineering
September 27, 2024
Michael Mo

Milvus ist eine quelloffene, leistungsstarke und hoch skalierbare Vektordatenbank, die unstrukturierte Daten in Milliardengröße durch hochdimensionale Vektoreinbettungen speichern, indizieren und durchsuchen kann. Sie eignet sich perfekt für den Aufbau moderner KI-Anwendungen wie Retrieval Augmented Generation(RAG), semantische Suche, multimodale Suche und Empfehlungssysteme. Milvus läuft effizient in verschiedenen Umgebungen, von Laptops bis hin zu großen verteilten Systemen. Es ist als Open-Source-Software und als Cloud-Service verfügbar.

Milvus Backup ist ein Tool zum Sichern und Wiederherstellen von Milvus-Daten. Es bietet sowohl CLI als auch API, um verschiedene Anwendungsszenarien zu unterstützen. Dieser Leitfaden führt Sie durch den Prozess der Verwendung von Milvus Backup und stellt sicher, dass Sie Ihre Backup-Anforderungen sicher bewältigen können.

Vorbereitung

Bevor Sie mit dem Sicherungs- oder Wiederherstellungsprozess beginnen, müssen Sie Ihre Umgebung einrichten:

1. Laden Sie die neueste Binärversion aus dem Milvus-Backup-Repositoryherunter. Wählen Sie die passende Version für Ihr Betriebssystem:

  • Für macOS: milvus-backup_Darwin_arm64.tar.gz oder milvus-backup_Darwin_x86_64.tar.gz

  • Für Linux: milvus-backup_Linux_arm64.tar.gz oder milvus-backup_Linux_x86_64.tar.gz

2. Laden Sie die Konfigurationsdatei von GitHubherunter.

3. Entpacken Sie die tar-Datei in das von Ihnen gewünschte Verzeichnis und legen Sie backup.yaml in das Verzeichnis configs/ innerhalb desselben extrahierten Ordners. Stellen Sie sicher, dass Ihre Verzeichnisstruktur wie folgt aussieht:

├── configs
│   └── backup.yaml
├── milvus-backup
└── README.md

Befehlsübersicht

Navigieren Sie zu Ihrem Terminal und machen Sie sich mit den Befehlen des Tools vertraut:

1. Allgemeine Hilfe: Geben Sie milvus-backup help ein, um die verfügbaren Befehle und Flags anzuzeigen.

milvus-backup is a backup&restore tool for milvus.

Usage:
 milvus-backup [flags]
 milvus-backup [command]

Available Commands:
 check       check if the connects is right.
 create      create subcommand create a backup.
 delete      delete subcommand delete backup by name.
 get         get subcommand get backup by name.
 help        Help about any command
 list        list subcommand shows all backup in the cluster.
 restore     restore subcommand restore a backup.
 server      server subcommand start milvus-backup RESTAPI server.

Flags:
     --config string   config YAML file of milvus (default "backup.yaml")
 -h, --help            help for milvus-backup

Use "milvus-backup [command] --help" for more information about a command.

2. Erstellen einer Sicherung: Geben Sie milvus-backup create --help ein, um spezifische Hilfe zum Erstellen einer Sicherung zu erhalten.

Usage:
 milvus-backup create [flags]

Flags:
 -n, --name string                   backup name, if unset will generate a name automatically
 -c, --colls string                  collectionNames to backup, use ',' to connect multiple collections
 -d, --databases string              databases to backup
 -a, --database_collections string   databases and collections to backup, json format: {"db1":["c1", "c2"],"db2":[]}
 -f, --force                         force backup, will skip flush, should make sure data has been stored into disk when using it
     --meta_only                     only backup collection meta instead of data
 -h, --help                          help for create

3. Wiederherstellen einer Sicherung: Um zu verstehen, wie man eine Sicherung wiederherstellt, verwenden Sie milvus-backup restore --help.

Usage:
 milvus-backup restore [flags]

Flags:
 -n, --name string                   backup name to restore
 -c, --collections string            collectionNames to restore
 -s, --suffix string                 add a suffix to collection name to restore
 -r, --rename string                 rename collections to new names, format: db1.collection1:db2.collection1_new,db1.collection2:db2.collection2_new
 -d, --databases string              databases to restore, if not set, restore all databases
 -a, --database_collections string   databases and collections to restore, json format: {"db1":["c1", "c2"],"db2":[]}
     --meta_only                     if true, restore meta only
     --restore_index                 if true, restore index
     --use_auto_index                if true, replace vector index with autoindex
     --drop_exist_collection         if true, drop existing target collection before create
     --drop_exist_index              if true, drop existing index of target collection before create
     --skip_create_collection        if true, will skip collection, use when collection exist, restore index or data
 -h, --help                          help for restore

Anwendungsfälle für Sicherung/Wiederherstellung

Es gibt mehrere Anwendungsfälle, in denen das milvus-Backup-Tool effektiv eingesetzt werden kann, abhängig von Ihren spezifischen Bedürfnissen und Konfigurationen:

  1. Innerhalb einer einzelnen Milvus-Instanz: Kopieren einer Sammlung in eine neue Sammlung innerhalb desselben Milvus-Dienstes.

  2. Zwischen Milvus-Instanzen in einem einzigen S3 mit einem Bucket: Übertragen Sie eine Sammlung zwischen Milvus-Instanzen mit unterschiedlichen Root-Pfaden, die jedoch denselben S3-Bucket verwenden.

  3. Zwischen Milvus-Instanzen über verschiedene S3-Buckets hinweg: Übertragen Sie eine Sammlung zwischen verschiedenen S3-Buckets innerhalb desselben S3-Dienstes.

  4. Über verschiedene S3-Dienste hinweg: Kopieren Sie eine Sammlung zwischen Milvus-Instanzen, die verschiedene S3-Dienste verwenden.

Lassen Sie uns jeden Anwendungsfall im Detail untersuchen.

Anwendungsfall 1: Sichern und Wiederherstellen innerhalb einer Milvus-Instanz

Sichern und Wiederherstellen einer Sammlung innerhalb der gleichen Milvus-Instanz. Angenommen, eine Sammlung mit dem Namen "coll" wird gesichert und als "coll_bak" wiederhergestellt, wobei derselbe S3-Bucket verwendet wird.

Konfiguration:

  • Milvus verwendet die bucket_A für die Speicherung.

  • MinIO-Konfiguration:

minio:
 address: localhost # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_A # Bucket name in MinIO/S3
 rootPath: files # The root path where the message is stored in MinIO/S3

Sicherungs-Workflow

1. Konfigurieren Sie backup.yaml, um Milvus und MinIO auf die richtigen Speicherorte zu verweisen.

# Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: localhost # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_A" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
  backupBucketName: "bucket_A" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

2. Erstellen Sie ein Backup mit dem Befehl.

./milvus-backup create -c coll -n my_backup

Dieser Befehl legt die Sicherung in bucket_A/backup/my_backup ab.

3. Stellen Sie die Sicherung in einer neuen Sammlung wieder her.

./milvus-backup restore -c coll -n my_backup -s _bak

Dadurch wird "coll" als "coll_bak" innerhalb der gleichen Milvus-Instanz wiederhergestellt.

Figure: The Backup and Restore Workflow Within One Milvus Instance Abbildung: Der Sicherungs- und Wiederherstellungsworkflow innerhalb einer Milvus-Instanz

Abbildung: Der Sicherungs- und Wiederherstellungsworkflow innerhalb einer Milvus-Instanz

Anwendungsfall 2: Sichern und Wiederherstellen zwischen zwei Milvus-Instanzen, die sich ein S3-Bucket teilen

Sichern Sie eine Sammlung von einer Milvus-Instanz und stellen Sie sie in einer anderen wieder her, indem Sie denselben S3-Bucket, aber mit unterschiedlichen Root-Pfaden verwenden. Angenommen, es gibt eine Sammlung mit dem Namen "coll" in milvus_A, wir sichern sie und stellen sie in einer neuen Sammlung mit dem Namen "coll_bak" in milvus_B wieder her. Die beiden Milvus-Instanzen nutzen denselben Bucket "bucket_A" als Speicherort, haben aber unterschiedliche Root-Pfade.

Konfiguration

  • Milvus A verwendet files_A als Wurzelpfad.

  • Milvus B verwendet files_B als Root-Pfad.

  • MinIO-Konfiguration für Milvus A:

minio:
 address: localhost # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_A # Bucket name in MinIO/S3
 rootPath: files_A # The root path where the message is stored in MinIO/S3
  • MinIO-Konfiguration für Milvus B:
minio:
 address: localhost # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_A # Bucket name in MinIO/S3
 rootPath: files_B # The root path where the message is stored in MinIO/S3

Sicherungs-Workflow

1. Sicherungskonfiguration für Milvus A

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_A
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: milvus_A # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_A" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files_A" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "bucket_A" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

2. Führen Sie den Backup-Befehl aus:

./milvus-backup create -c coll -n my_backup

3. Wiederherstellen der Konfiguration für Milvus B

Ändern Sie backup.yaml so, dass es auf Milvus B zeigt und passen Sie den MinIO-Root-Pfad an:

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_B
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
  address: milvus_B # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_A" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files_B" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "bucket_A" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

4. Führen Sie den Wiederherstellungsbefehl aus:

./milvus-backup restore -c coll -n my_backup -s _bak

Figure: The Backup and Restore Workflow Between Two Milvus Instances Sharing One S3 Bucket Abbildung: Der Sicherungs- und Wiederherstellungsworkflow zwischen zwei Milvus-Instanzen, die sich ein S3-Bucket teilen

Anwendungsfall 3: Sichern und Wiederherstellen zwischen zwei Milvus-Instanzen in einem S3, unterschiedliche Buckets

Sichern Sie eine Sammlung von einer Milvus-Instanz (Milvus_A) und stellen Sie sie in einer anderen Milvus-Instanz (Milvus_B) innerhalb desselben S3-Dienstes, aber mit unterschiedlichen Buckets, wieder her.

Konfiguration:

  • Milvus verwendet die bucket_A für die Speicherung.

  • MinIO-Konfiguration für Milvus A:

minio:
 address: localhost # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_A # Bucket name in MinIO/S3
 rootPath: files # The root path where the message is stored in MinIO/S3
  • MinIO-Konfiguration für Milvus B:
minio:
 address: localhost # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_B # Bucket name in MinIO/S3
 rootPath: files # The root path where the message is stored in MinIO/S3

Workflow für Sicherung und Wiederherstellung

1. Sicherungskonfiguration für Milvus A

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_A
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: localhost # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_A" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "bucket_B" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

2. Führen Sie den Backup-Befehl aus:

./milvus-backup create -c coll -n my_backup

3. Wiederherstellen der Konfiguration für Milvus B

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_B
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
  address: localhost # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_B" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
  backupBucketName: "bucket_B" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

4. Führen Sie den Restore-Befehl aus:

./milvus-backup restore -c coll -n my_backup -s _bak

Figure: The Backup and Restore Workflow Between Two Milvus Instances in One S3, Different Buckets Abbildung: Der Sicherungs- und Wiederherstellungsworkflow zwischen zwei Milvus-Instanzen in einem S3, unterschiedliche Buckets

Abbildung: Der Sicherungs- und Wiederherstellungsworkflow zwischen zwei Milvus-Instanzen in einem S3, verschiedene Buckets

Anwendungsfall 4: Sicherung und Wiederherstellung zwischen zwei Milvus-Instanzen über verschiedene S3-Dienste hinweg

Erleichterung der Sicherung einer Sammlung mit dem Namen "coll" von Milvus_A unter Verwendung eines S3-Dienstes (MinIO_A) und deren Wiederherstellung in Milvus_B unter Verwendung eines anderen S3-Dienstes (MinIO_B), wobei jede Instanz unterschiedliche Speicher-Buckets verwendet.

Konfiguration

  • MinIO-Konfiguration für Milvus A:
minio:
 address: minio_A # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_A # Bucket name in MinIO/S3
 rootPath: files # The root path where the message is stored in MinIO/S3
  • MinIO-Konfiguration für Milvus B
 minio:
 address: minio_B # Address of MinIO/S3
 port: 9000 # Port of MinIO/S3
 accessKeyID: minioadmin # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 ssl:
   tlsCACert: /path/to/public.crt # path to your CACert file, ignore when it is empty
 bucketName: bucket_B # Bucket name in MinIO/S3
 rootPath: files # The root path where the message is stored in MinIO/S3

Arbeitsablauf für Sicherung und Wiederherstellung

1. Sicherungskonfiguration für Milvus A

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_A
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: minio_A # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_A" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "bucket_A" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

2. Führen Sie den Backup-Befehl aus:

./milvus-backup create -c coll -n my_backup

3. Übertragen des Backups

Kopieren Sie das Backup manuell von minio_A:bucket_A/backup/my_backup nach minio_B:bucket_B/backup/my_backup mit einem S3-kompatiblen Tool oder SDK.

4. Konfiguration für Milvus B wiederherstellen

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: milvus_B
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"
 # Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: minio_B # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "bucket_B" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "bucket_B" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

5. Führen Sie den Wiederherstellungsbefehl aus:

./milvus-backup restore -c coll -n my_backup -s _bak

Figure: The Backup and Restore Workflow Between Two Milvus Instances Across Different S3 Services Abbildung: Der Sicherungs- und Wiederherstellungsworkflow zwischen zwei Milvus-Instanzen über verschiedene S3-Dienste hinweg

Abbildung: Der Sicherungs- und Wiederherstellungsworkflow zwischen zwei Milvus-Instanzen über verschiedene S3-Dienste hinweg

Erläuterung der Konfigurationsdatei

Bearbeiten Sie die Datei configs/backup.yaml, um die Sicherungseinstellungen an Ihre Umgebung anzupassen. Im Folgenden finden Sie eine Aufschlüsselung der Konfigurationsoptionen:

Protokollierung: Konfigurieren Sie die Protokollierungsstufen und Ausgabepräferenzen.

# Configures the system log output.
log:
 level: info # Only supports debug, info, warn, error, panic, or fatal. Default 'info'.
 console: true # whether print log to console
 file:
   rootPath: "logs/backup.log"

Milvus-Verbindung: Legen Sie die Verbindungsdetails für Ihre Milvus-Instanz fest.

# milvus proxy address, compatible to milvus.yaml
milvus:
 address: localhost
 port: 19530
 authorizationEnabled: false
 # tls mode values [0, 1, 2]
 # 0 is close, 1 is one-way authentication, 2 is two-way authentication.
 tlsMode: 0
 user: "root"
 password: "Milvus"

MinIO-Konfiguration: Definieren Sie, wie Backups mit MinIO oder einem anderen S3-kompatiblen Speicher interagieren.

# Related configuration of minio, which is responsible for data persistence for Milvus.
minio:
 # cloudProvider: "minio" # deprecated use storageType instead
 storageType: "minio" # support storage type: local, minio, s3, aws, gcp, ali(aliyun), azure, tc(tencent)
 address: localhost # Address of MinIO/S3
 port: 9000   # Port of MinIO/S3
 accessKeyID: minioadmin  # accessKeyID of MinIO/S3
 secretAccessKey: minioadmin # MinIO/S3 encryption string
 useSSL: false # Access to MinIO/S3 with SSL
 useIAM: false
 iamEndpoint: ""
 bucketName: "a-bucket" # Milvus Bucket name in MinIO/S3, make it the same as your milvus instance
 rootPath: "files" # Milvus storage root path in MinIO/S3, make it the same as your milvus instance

 # only for azure
 backupAccessKeyID: minioadmin  # accessKeyID of MinIO/S3
 backupSecretAccessKey: minioadmin # MinIO/S3 encryption string
 backupBucketName: "a-bucket" # Bucket name to store backup data. Backup data will store to backupBucketName/backupRootPath
 backupRootPath: "backup" # Rootpath to store backup data. Backup data will store to backupBucketName/backupRootPath

Fazit

Das Milvus-Backup-Tool bietet eine robuste Lösung für das Sichern und Wiederherstellen von Sammlungen innerhalb und zwischen Milvus-Instanzen. Egal, ob Sie Backups innerhalb einer einzelnen Instanz, zwischen Instanzen desselben S3-Dienstes oder über verschiedene S3-Dienste hinweg verwalten, milvus-backup bewältigt alles mit Flexibilität und Präzision.

Wichtigste Erkenntnisse

  1. Vielseitigkeit: Milvus-backup unterstützt mehrere Szenarien, von einfachen Backups innerhalb einer Instanz bis hin zu komplexen serviceübergreifenden Wiederherstellungen.

  2. Flexibilität bei der Konfiguration: Durch eine entsprechende Konfiguration der Datei backup.yaml können die Benutzer die Sicherungs- und Wiederherstellungsprozesse an ihre spezifischen Bedürfnisse anpassen und unterschiedliche Speicher- und Netzwerkkonfigurationen berücksichtigen.

  3. Sicherheit und Kontrolle: Die direkte Manipulation von S3-Buckets und -Pfaden ermöglicht die Kontrolle über die Datenspeicherung und -sicherheit und stellt sicher, dass Backups sowohl sicher als auch nur für autorisierte Benutzer zugänglich sind.

Ein effektives Datenmanagement ist entscheidend, um das volle Potenzial von Milvus in Ihren Anwendungen auszuschöpfen. Wenn Sie das Milvus-Backup-Tool beherrschen, können Sie die Dauerhaftigkeit und Verfügbarkeit von Daten sicherstellen, selbst in komplexen verteilten Umgebungen. Dieser Leitfaden unterstützt die Benutzer bei der Implementierung robuster Backup-Strategien, indem er Best Practices und effiziente Datenhandhabungstechniken fördert.

Ganz gleich, ob Sie ein Entwickler, ein Dateningenieur oder ein IT-Fachmann sind, das Verständnis und die Nutzung des Milvus-Backup-Tools kann durch die Bereitstellung zuverlässiger und effizienter Datenverwaltungslösungen erheblich zum Erfolg Ihres Projekts beitragen.

Like the article? Spread the word

Weiterlesen