Object Storage Migration – Ceph Rados GW to Minio S3 Bucket Migration – Rclone

Uzun zaman sonra, yeniden merhaba 🙂

Son yazımın üzerinden yaklaşık 2 yıl geçmiş. Tabii bu sürede kendi hayatımı ve mesleki hayatımı etkileyen bir çok şey oldu. Makale yazmaya değil fırsat, su içecek vakti zor bulduk. Bu kısmı çok uzatmayıp, fasülyenin faydalarına geçmek istiyorum.

Çalıştığım şirket, daha önceki mimarisinde, ihtiyacı olan object storage ihtiyacını, ortamda Ceph bulunması nedeniyle, Rados GW konfigüre ederek gidermiş. Gel gelelim, Ceph storage kısmını iptal etmek isteyince, biz bu Object Storage konusunu nasıl çözeriz diye ufak bir araştırma yaptım ve S3 uyumlu olan Minio’yu keşfettim. Neredeyse Object Storage ihtiyacı olup da Minio kullanmayan kalmamış, kullanmayanı dövmüşler 🙂

Burada esas konu, Minio’nun nasıl kurulacağı değil, Ceph üzerindeki Bucket’ları Minio’ya nasıl taşıyacağımız / migrate edeceğimiz. Tam bu noktada ise, imdadımıza Rclone yetişiyor.

Ben Minio kurulumunun nasıl yapılacağı konusunda değinmeyeceğim, resmi web sitesinden bu konuda faydalanabilirsiniz, onun linkini buraya bırakıyorum;

https://docs.min.io/minio/baremetal/

Nasıl bucket oluşturulacağı ya da Minio’nun nasıl yönetileceği ile ilgili kısımlarda, yukarıdaki vermiş olduğum docs linkinde mevcut. Faydalı güzel bir döküman sistemi hazırlamışlar, tebrik etmek lazım.

Minio’yu kurduk, bucket oluşturduk, transfer edecek kıvama geldik. Asıl iş bundan sonra başlıyor. Rclone ile ne yapacağız?

Rados GW Url adresinize (örneğin s3.korhankoseoglu.com) ve yeni kurduğunuz Minio adresinize (örneğin minios3.korhankoseoglu.com) erişebilen bir Ubuntu sunucuya Rclone kurmanız gerekiyor. Linkini aşağıya bırakıyorum;

https://rclone.org/downloads/

Rclone kurulumunu tamamladık, sırada migration işlemini başlatmak var. Sırası ile şöyle yapacağız;

1- Rclone config ile bucket ayarlarını yapacağımız menüye ulaşacağız.

2- Ceph üzerinde bulunan, transfer edeceğimiz bucket ile ilgili bilgileri gireceğiz.

3- Minio üzerinde bulunan, Ceph üzerinden transfer edilecek bucket bilgilerini gireceğiz.

4- Rclone config ile bucket transferini sağlayacağız ve işlemi tamamlamış olacağız.

Başlayalım;

1- Rclone config menüsüne girelim;

$> rclone config
2- n tuşuna basıp yeni bir remote config yapmak için hazır hale gelelim;

No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config

n/s/q> n
3- Ceph bucket için bir isim verelim;

name> korhan-test-ceph
4- Gelen listeden 5 numaralı seçeneği seçelim. (Ceph seçeneğimiz burada çünkü);

Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value

5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, Digital Ocean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
   \ (s3)
5- Ceph seçeneği ile devam edelim;

Choose your S3 provider.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value

3 / Ceph Object Storage
  \ "Ceph"
6- Bucket credential bilgilerini el ile gireceğimiz için 1 numara ile devam edelim;

Option env_auth.
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
 1 / Enter AWS credentials in the next step.
   \ (false)
 2 / Get AWS credentials from the environment (env vars or IAM).
   \ (true)
env_auth> 1
7- Access key id bilgimizi girelim;

Option access_key_id.
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
access_key_id> ceph-bucket-access-key-yazilacak
8- Secret access key bilgimizi de girelim;

Option secret_access_key.
AWS Secret Access Key (password).
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
secret_access_key> ceph-bucket-private-key-yazilacak
9- Boş region ile devam edelim. 1 numaralı seçenek bize yardımcı olacaktır;

Option region.
Region to connect to.
Leave blank if you are using an S3 clone and you don't have a region.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
   / Use this if unsure.
 1 | Will use v4 signatures and an empty region.
   \ ()
   / Use this only if v4 signatures don't work.
 2 | E.g. pre Jewel/v10 CEPH.
   \ (other-v2-signature)
region> 1
10- Rados gw url adresimizi verelim;

Option endpoint.
Endpoint for S3 API.
Required when using an S3 clone.
Enter a value. Press Enter to leave empty.
endpoint> s3.korhankoseoglu.com
11- Boş geçebiliriz. Ortamım özelinde böyle bir giriş bulunmuyor;

Option location_constraint.
Location constraint - must be set to match the Region.
Leave blank if not sure. Used when creating buckets only.
Enter a value. Press Enter to leave empty.
location_constraint> 
12- 6 numaralı seçenek ile devam edelim;

Option acl.
Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
   / Owner gets FULL_CONTROL.
 1 | No one else has access rights (default).
   \ (private)
   / Owner gets FULL_CONTROL.
 2 | The AllUsers group gets READ access.
   \ (public-read)
   / Owner gets FULL_CONTROL.
 3 | The AllUsers group gets READ and WRITE access.
   | Granting this on a bucket is generally not recommended.
   \ (public-read-write)
   / Owner gets FULL_CONTROL.
 4 | The AuthenticatedUsers group gets READ access.
   \ (authenticated-read)
   / Object owner gets FULL_CONTROL.
 5 | Bucket owner gets READ access.
   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
   \ (bucket-owner-read)
   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
   \ (bucket-owner-full-control)
acl> 6
13- Herhangi bir şifreleme ile işimiz yok. Ortamınızda var ise ilgili seçeneği seçebilirsiniz;

Option server_side_encryption.
The server-side encryption algorithm used when storing this object in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / None
   \ ()
 2 / AES256
   \ (AES256)
 3 / aws:kms
   \ (aws:kms)
server_side_encryption> 1
13- Herhangi bir şifreleme ile işimiz yok. Ortamınızda var ise ilgili seçeneği seçebilirsiniz;

Option sse_kms_key_id.
If using KMS ID you must provide the ARN of Key.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / None
   \ ()
 2 / arn:aws:kms:*
   \ (arn:aws:kms:us-east-1:*)
sse_kms_key_id> 1
14- Herhangi bir gelişmiş config ihtiyacım yok. Hayır seçeneği ile devam ediyorum;

Edit advanced config?
y) Yes
n) No (default)
y/n> n
15- Yaptığımız ayarların bir özetini veriyor. y ile tamamlıyorum;

Configuration complete.
Options:
- type: s3
- provider: Ceph
- access_key_id: ceph-access-key-yazilacak
- secret_access_key: ceph-bucket-private-key-yazilacak
- endpoint: s3.korhankoseoglu.com
- acl: bucket-owner-full-control
Keep this "korhan-test-ceph" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Yukarıdaki aşamaların aynısını, Minio tarafı için de gerçekleştireceğiz. Burada 3 – 5 – 7 – 8 ve 10. adımları Minio tarafındaki ayarlara göre uygulamanız gerekiyor.

Sonrasında ise Rclone ile kopyalama işlemine geçebiliriz. Şu komut işimiz görecektir;

rclone copy --progress korhan-test-ceph:korhan-test korhan-test-minio:korhan-test

Komutu ayrıştıracak olursak;

1 - rclone copy --progress : Rclone kopyalama işlemini ifade eden komuttur.
2 - korhan-test-ceph - Rclone'da Ceph bucket'a verdiğimiz isim / korhan-test Ceph üzerindeki bucket adımız.
3 - korhan-test-minio - Rclone'da Minio Bucket'a verdiğimiz isim / korhan-test Minio üzerindeki bucket adımız.

Komut çalıştıktan sonra ise şöyle bir ekran ile karşılaşacaksınız;

Transferred:   q          0 B / 0 B, -, 0 B/s, ETA -
Checks:                 1 / 1, 100%-progress korhan-test-ceph:korhan-test korhan-test-minio:korhan-test
Elapsed time:         0.3s

Gördüğünüz üzere, 1 adet objemiz Minio üzerine taşındı. Minio arayüzüne girerek bu durumu teyit edebilirsiniz.

Ekstra bilgi olarak, 3 milyon objeli bir bucket taşımak isterseniz, Minio ve Rados GW makinalarına en az 4 core Cpu ve 8 Gb Ram vermenizi tavsiye ederim. Beni açıkçası bu konu biraz uğraştırmıştı. 🙂

Umarım anlaşılır bir makale olmuştur, sorularınız için benimle Linkedin üzerinden iletişime geçebilirsiniz.

Keyifli çalışmalar dilerim.

Hakkında Korhan KÖSEOĞLU

Ayrıca Kontrol Et

Windows 8 Ürün Anahtarı (CD-KEY) Değiştirmek

Windows 8’i etkinleştirmeden ürün anahtarını değiştirmek için aşağıdaki yöntemlerden birini kullanın: Yöntem 1 Ekranın sağ kenarından …

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir