πŸš€ Coba Zilliz Cloud, Milvus yang sepenuhnya terkelola, secara gratisβ€”rasakan performa 10x lebih cepat! Coba Sekarang>>

milvus-logo
LFAI
  • Home
  • Blog
  • Cara Menggunakan Alat Pencadangan Milvus: Panduan Langkah-demi-Langkah

Cara Menggunakan Alat Pencadangan Milvus: Panduan Langkah-demi-Langkah

  • Engineering
September 27, 2024
Michael Mo

Milvus adalah basis data vektor sumber terbuka, berkinerja tinggi, dan sangat skalabel yang dapat menyimpan, mengindeks, dan mencari data tak terstruktur berskala miliaran melalui penyematan vektor berdimensi tinggi. Sangat cocok untuk membangun aplikasi AI modern seperti retrieval augmented generation(RAG), pencarian semantik, pencarian multimodal, dan sistem rekomendasi. Milvus berjalan secara efisien di berbagai lingkungan, mulai dari laptop hingga sistem terdistribusi berskala besar. Ini tersedia sebagai perangkat lunak sumber terbuka dan layanan cloud.

Milvus Backup adalah alat untuk mencadangkan dan memulihkan data Milvus. Alat ini menyediakan CLI dan API untuk mengakomodasi berbagai skenario aplikasi. Panduan ini akan memandu Anda melalui proses penggunaan Milvus Backup, memastikan bahwa Anda dapat dengan percaya diri menangani kebutuhan pencadangan Anda.

Persiapan

Sebelum memulai proses pencadangan atau pemulihan, Anda perlu mengatur lingkungan Anda:

1. Unduh biner terbaru dari rilis repositori Milvus-backup. Pilih versi yang sesuai untuk sistem operasi Anda:

  • Untuk macOS: milvus-backup_Darwin_arm64.tar.gz atau milvus-backup_Darwin_x86_64.tar.gz

  • Untuk Linux: milvus-backup_Linux_arm64.tar.gz atau milvus-backup_Linux_x86_64.tar.gz

2. Unduh file konfigurasi dari GitHub.

3. Ekstrak berkas tar ke direktori pilihan Anda dan letakkan backup.yaml di direktori configs/ di dalam folder yang sama yang telah diekstrak. Pastikan struktur direktori Anda terlihat seperti berikut:

β”œβ”€β”€ configs
β”‚   └── backup.yaml
β”œβ”€β”€ milvus-backup
└── README.md

Ikhtisar Perintah

Navigasikan ke terminal Anda dan biasakan diri Anda dengan perintah-perintah alat ini:

1. Bantuan Umum: Ketik milvus-backup help untuk melihat perintah dan flag yang tersedia.

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. Membuat Cadangan: Dapatkan bantuan khusus untuk membuat cadangan dengan mengetik milvus-backup create --help.

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. Memulihkan Cadangan: Untuk memahami cara memulihkan cadangan, gunakan 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

Kasus Penggunaan Pencadangan/Pemulihan Cadangan

Ada beberapa kasus penggunaan di mana alat pencadangan milvus dapat diterapkan secara efektif, tergantung pada kebutuhan dan konfigurasi spesifik Anda:

  1. Dalam Satu Instance Milvus: Menyalin koleksi ke koleksi baru dalam layanan Milvus yang sama.

  2. Antar Instance Milvus dalam S3 Tunggal dengan Satu Bucket: Mentransfer koleksi antar instance Milvus dengan jalur root yang berbeda namun menggunakan bucket S3 yang sama.

  3. Antara Instance Milvus di Seluruh Bucket S3 yang Berbeda: Mentransfer koleksi antar bucket S3 yang berbeda dalam layanan S3 yang sama.

  4. Lintas Layanan S3 yang Berbeda: Menyalin koleksi antar instance Milvus yang menggunakan layanan S3 yang berbeda.

Mari kita jelajahi setiap kasus penggunaan secara detail.

Kasus Penggunaan 1: Pencadangan dan Pemulihan Dalam Satu Instance Milvus

Mencadangkan dan memulihkan koleksi di dalam instance Milvus yang sama. Asumsikan koleksi bernama "coll" dicadangkan dan dipulihkan sebagai "coll_bak" menggunakan bucket S3 yang sama.

Konfigurasi:

  • Milvus menggunakan bucket_A untuk penyimpanan.

  • Konfigurasi MinIO:

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

Alur Kerja Pencadangan

1. Konfigurasikan backup.yaml untuk mengarahkan Milvus dan MinIO ke lokasi yang benar.

# 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. Buat cadangan menggunakan perintah.

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

Perintah ini menempatkan cadangan di bucket_A/backup/my_backup.

3. Kembalikan cadangan ke koleksi baru.

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

Ini akan mengembalikan "coll" sebagai "coll_bak" di dalam instans Milvus yang sama.

Figure: The Backup and Restore Workflow Within One Milvus Instance Gambar: Alur Kerja Pencadangan dan Pemulihan Dalam Satu Instance Milvus

Gambar: Alur Kerja Pencadangan dan Pemulihan Dalam Satu Instance Milvus

Kasus Penggunaan 2: Pencadangan dan Pemulihan Antara Dua Instance Milvus yang Berbagi Satu Bucket S3

Mencadangkan koleksi dari satu instance Milvus dan mengembalikannya ke instance lainnya menggunakan bucket S3 yang sama tetapi dengan jalur root yang berbeda. Dengan asumsi ada koleksi bernama "coll" di milvus_A, kita mencadangkan dan mengembalikannya ke koleksi baru bernama "coll_bak" ke milvus_B. Kedua instans Milvus berbagi bucket "bucket_A" yang sama sebagai penyimpanan, tetapi memiliki jalur root yang berbeda.

Konfigurasi

  • Milvus A menggunakan files_A sebagai jalur root.

  • Milvus B menggunakan files_B sebagai root path.

  • Konfigurasi MinIO untuk 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
  • Konfigurasi MinIO untuk 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

Alur Kerja Pencadangan

1. Konfigurasi Cadangan untuk 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. Jalankan perintah pencadangan:

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

3. Kembalikan Konfigurasi untuk Milvus B

Ubah backup.yaml untuk mengarahkan ke Milvus B dan sesuaikan jalur root MinIO:

# 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. Jalankan perintah pemulihan:

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

Figure: The Backup and Restore Workflow Between Two Milvus Instances Sharing One S3 Bucket Gambar: Alur Kerja Pencadangan dan Pemulihan Antara Dua Instance Milvus yang Berbagi Satu Bucket S3

Kasus Penggunaan 3: Pencadangan dan Pemulihan Antara Dua Instansi Milvus dalam Satu S3, Bucket Berbeda

Mencadangkan koleksi dari instance Milvus (Milvus_A) dan mengembalikannya ke instance Milvus lain (Milvus_B) dalam layanan S3 yang sama tetapi menggunakan bucket yang berbeda.

Konfigurasi:

  • Milvus menggunakan bucket_A untuk penyimpanan.

  • Konfigurasi MinIO untuk 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
  • Konfigurasi MinIO untuk 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

Alur Kerja Pencadangan dan Pemulihan

1. Konfigurasi Cadangan untuk 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. Jalankan perintah pencadangan:

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

3. Konfigurasi Pemulihan untuk 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. Jalankan perintah pemulihan:

./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 Gambar: Alur Kerja Pencadangan dan Pemulihan Antara Dua Instance Milvus dalam Satu S3, Bucket yang Berbeda

Gambar: Alur Kerja Pencadangan dan Pemulihan Antara Dua Instance Milvus dalam Satu S3, Bucket Berbeda

Kasus Penggunaan 4: Backup dan Restore Antara Dua Instance Milvus di Layanan S3 yang Berbeda

Untuk memfasilitasi backup sebuah koleksi bernama "coll" dari Milvus_A menggunakan satu layanan S3 (MinIO_A) dan mengembalikannya ke dalam Milvus_B menggunakan layanan S3 yang berbeda (MinIO_B), dengan masing-masing instance menggunakan bucket penyimpanan yang berbeda.

Konfigurasi

  • Konfigurasi MinIO untuk 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
  • Konfigurasi MinIO untuk 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

Alur Kerja Pencadangan dan Pemulihan

1. Konfigurasi Cadangan untuk 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. Jalankan perintah pencadangan:

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

3. Mentransfer Cadangan

Salin cadangan secara manual dari minio_A:bucket_A/backup/my_backup ke minio_B:bucket_B/backup/my_backup menggunakan alat yang kompatibel dengan S3 atau SDK.

4. Kembalikan Konfigurasi untuk 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: 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. Jalankan perintah pemulihan:

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

Figure: The Backup and Restore Workflow Between Two Milvus Instances Across Different S3 Services Gambar: Alur Kerja Pencadangan dan Pemulihan Antara Dua Instance Milvus di Layanan S3 yang Berbeda

Gambar: Alur Kerja Pencadangan dan Pemulihan Antara Dua Instance Milvus di Layanan S3 yang Berbeda

Penjelasan File Konfigurasi

Edit file configs/backup.yaml untuk menyesuaikan pengaturan pencadangan dengan lingkungan Anda. Berikut ini adalah rincian opsi konfigurasi:

Pencatatan: Mengonfigurasi tingkat pencatatan dan preferensi keluaran.

# 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"

Koneksi Milvus: Mengatur detail koneksi untuk instance Milvus Anda.

# 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"

Konfigurasi MinIO: Tentukan bagaimana cadangan berinteraksi dengan MinIO atau penyimpanan yang kompatibel dengan S3.

# 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

Kesimpulan

Alat Pencadangan Milvus menyediakan solusi yang tangguh untuk mencadangkan dan memulihkan koleksi di dalam dan di seluruh instance Milvus. Baik Anda mengelola cadangan dalam satu instance, antar instance dalam layanan S3 yang sama, atau di seluruh layanan S3 yang berbeda, milvus-backup menangani semuanya dengan fleksibilitas dan presisi.

Hal-hal penting yang bisa diambil dari milvus-backup

  1. Fleksibilitas: Milvus-backup mendukung berbagai skenario, mulai dari pencadangan intra-instance yang sederhana hingga pemulihan lintas-layanan yang kompleks.

  2. Fleksibilitas Konfigurasi: Dengan mengonfigurasi file backup.yaml secara tepat, pengguna dapat menyesuaikan proses pencadangan dan pemulihan agar sesuai dengan kebutuhan spesifik, mengakomodasi pengaturan penyimpanan dan konfigurasi jaringan yang berbeda.

  3. Keamanan dan Kontrol: Manipulasi langsung dari bucket dan jalur S3 memungkinkan kontrol atas penyimpanan dan keamanan data, memastikan cadangan aman dan hanya dapat diakses oleh pengguna yang berwenang.

Manajemen data yang efektif sangat penting untuk meningkatkan potensi penuh Milvus dalam aplikasi Anda. Dengan menguasai alat pencadangan Milvus, Anda dapat memastikan daya tahan dan ketersediaan data, bahkan dalam lingkungan terdistribusi yang kompleks. Panduan ini memberdayakan pengguna untuk menerapkan strategi pencadangan yang kuat, mempromosikan praktik terbaik dan teknik penanganan data yang efisien.

Apakah Anda seorang pengembang, insinyur data, atau profesional TI, memahami dan memanfaatkan alat pencadangan Milvus dapat berkontribusi secara signifikan terhadap kesuksesan proyek Anda dengan menyediakan solusi manajemen data yang andal dan efisien.

Like the article? Spread the word

Terus Baca