|
@@ -0,0 +1,51 @@
|
|
|
+# minio backup using mc on Ubuntu Server 22.04
|
|
|
+
|
|
|
+*reference: https://ahabug.com/?p=147
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+1. install mc (minio client):
|
|
|
+
|
|
|
+ ```shell
|
|
|
+ sudo wget https://dl.min.io/client/mc/release/linux-amd64/mc -P /usr/local/bin/
|
|
|
+ sudo chmod +x /usr/local/bin/mc
|
|
|
+ ```
|
|
|
+
|
|
|
+2. add host:
|
|
|
+
|
|
|
+ ```shell
|
|
|
+ sudo mc config host add minio_master http://ip:port username password
|
|
|
+ sudo mc config host add minio_slave http://ip:port username password
|
|
|
+ ```
|
|
|
+
|
|
|
+3. make mirror from master to slave:
|
|
|
+
|
|
|
+ ```shell
|
|
|
+ sudo mc mirror --remove --overwrite --watch minio_master minio_slave
|
|
|
+ ```
|
|
|
+
|
|
|
+4. create a service named minio_mirror.service to run mirror action on system restart . service file (under /usr/lib/systemd/system):
|
|
|
+
|
|
|
+ ```
|
|
|
+ [Unit]
|
|
|
+ Description=Startup minio client to mirror slave from master
|
|
|
+ After=network.target
|
|
|
+
|
|
|
+ [Service]
|
|
|
+ Type=simple
|
|
|
+ ExecStart=/usr/local/bin/mc mirror --remove --overwrite --watch minio_master minio_slave
|
|
|
+ Restart=on-failure
|
|
|
+
|
|
|
+ [Install]
|
|
|
+ WantedBy=multi-user.target
|
|
|
+ ```
|
|
|
+
|
|
|
+5. enable service:
|
|
|
+
|
|
|
+ ```shell
|
|
|
+ sudo systemctl enable minio_mirror.service
|
|
|
+ sudo systemctl start minio_mirror.service
|
|
|
+ sudo systemctl status minio_mirror.service
|
|
|
+ ```
|
|
|
+
|
|
|
+6. upload some file on master and check whether the file is synced to slave.
|