{"id":963,"date":"2021-03-29T15:37:07","date_gmt":"2021-03-29T13:37:07","guid":{"rendered":"https:\/\/devpath.pro\/?p=963"},"modified":"2021-03-29T15:37:07","modified_gmt":"2021-03-29T13:37:07","slug":"save-yourself-from-a-disaster-2-secure-the-storage","status":"publish","type":"post","link":"https:\/\/fabiocicerchia.it\/web\/save-yourself-from-a-disaster-2-secure-the-storage","title":{"rendered":"Save yourself from a disaster #2: Secure the Storage"},"content":{"rendered":"
This is the second part of the series Save yourself from a disaster: Redundancy on a budget<\/a>.<\/p>\n How can we make sure our second most important asset is safely secured in case of a disaster?<\/p>\n We could mainly 2 things:<\/p>\n <\/p>\n Let’s back up them on an external (cloud) storage disk. Option #1: Remote VM<\/strong><\/p>\n Let’s use a simple cronjob every hour to sync the whole shared folder to a remote location:<\/p>\n Some provider can offer pluggable storage and it would be perfect to detach it and reattach it to another node (only if using the same provider). Alternatively, the VM could be exported and mounted as NFS (with some performance degradation).<\/p>\n By using some cheap storages you could leverage the cost of a cloud-native one. Some providers can offer 2TB for ~$10\/month, like TransIP<\/a> or AlphaVPS<\/a>. If you combine them together you’ll end up with a slightly higher cost (than using only one) but have definitively greater redundancy.<\/p>\n Option #2: Cloud-Native Storage<\/strong><\/p>\n Still, with a simple cronjob we could sync the whole shared folder to an S3 bucket (using cold storage access):<\/p>\n It is free to send data into AWS S3 but to take it out you need to pay roughly an extra $0.09 per GB, so in case you have lots of data, you might want to consider this very carefully: to restore 1TB of data it could costs you ~$23\/month + ~$90 to restore it. You need to consider the loss of permissions when saving to AWS S3, so when restoring you need to double-check it to verify they are correct.<\/p>\n Once everything is backed up, you need to think about how to restore the data properly, or at least switch the access on-the-fly. I’ll cover this in the Disaster Recovery Plan post.<\/p>\n The next post will be about Redundancy of Database, Stay Tuned.<\/p>\n Check out the whole version of this post in the ebook. This is the second part of the series Save yourself from a disaster: Redundancy on a budget. How can we make sure our second most important asset is safely secured in case of a disaster? We could mainly 2 things: Distributed Storage Backups<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"categories":[14],"tags":[122,123,124,125],"aioseo_notices":[],"author_meta":{"display_name":"fabio","author_link":"https:\/\/fabiocicerchia.it\/author\/fabio"},"featured_img":null,"coauthors":[],"tax_additional":{"categories":{"linked":["Web<\/a>"],"unlinked":["Web<\/span>"]},"tags":{"linked":["disaster recovery<\/a>","ovh<\/a>","redundancy<\/a>","sbg2<\/a>"],"unlinked":["disaster recovery<\/span>","ovh<\/span>","redundancy<\/span>","sbg2<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 3 years ago","modified":"Updated 3 years ago"},"absolute_dates":{"created":"Posted on March 29, 2021","modified":"Updated on March 29, 2021"},"absolute_dates_time":{"created":"Posted on March 29, 2021 3:37 pm","modified":"Updated on March 29, 2021 3:37 pm"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/963"}],"collection":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/comments?post=963"}],"version-history":[{"count":0,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/963\/revisions"}],"wp:attachment":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/media?parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/categories?post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/tags?post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\nThis guide won’t cover everything, it won’t be a comprehensive guide, and the steps that are shown need to be carefully reviewed and tested in your development\/pre-production environment. I don’t take any responsibility for any damage, interruption of service nor leak\/loss of data for the use of the instructions in the ebook (nor from any external website I’ve mentioned).<\/small><\/div>\nBackups<\/h2>\n
\nWhy not offline? Because the burden of re-uploading all file stored in a shared folder (which usually are not-so-few) will make the restore process very slow.<\/p>\nrsync -auv --progress \/path\/to\/shared\/folder <IP>:\/path\/to\/shared\/folder\n<\/pre>\n
aws s3 sync --storage-class GLACIER \/path\/to\/shared\/folder s3:\/\/<BUCKET>\/<\/pre>\n
\nA cheaper provider for Cloud-Native Storage is Scaleway<\/a> with ~0.002\u20ac\/GB\/month (1TB = ~\u20ac2.5).<\/p>\nRestore<\/h2>\n
\n
\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"