2020-03-24 17:51:06 -04:00
# Shared Backend MinIO Quickstart Guide [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Docker Pulls](https://img.shields.io/docker/pulls/minio/minio.svg?maxAge=604800)](https://hub.docker.com/r/minio/minio/)
2017-01-16 20:05:00 -05:00
2022-02-11 19:51:25 -05:00
MinIO shared mode lets you use single [NAS ](https://en.wikipedia.org/wiki/Network-attached_storage ) (like NFS, GlusterFS, and other
distributed filesystems) as the storage backend for multiple MinIO servers. Synchronization among MinIO servers is taken care by design.
2019-04-09 14:39:42 -04:00
Read more about the MinIO shared mode design [here ](https://github.com/minio/minio/blob/master/docs/shared-backend/DESIGN.md ).
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
MinIO shared mode is developed to solve several real world use cases, without any special configuration changes. Some of these are
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
- You have already invested in NAS and would like to use MinIO to add S3 compatibility to your storage tier.
2017-03-12 19:17:03 -04:00
- You need to use NAS with an S3 interface due to your application architecture requirements.
2022-02-11 19:51:25 -05:00
- You expect huge traffic and need a load balanced S3 compatible server, serving files from a single NAS backend.
2017-01-16 20:05:00 -05:00
2022-02-11 19:51:25 -05:00
With a proxy running in front of multiple, shared mode MinIO servers, it is very easy to create a Highly Available, load balanced, AWS S3 compatible storage system.
2017-01-16 20:05:00 -05:00
# Get started
2022-02-11 19:51:25 -05:00
If you're aware of stand-alone MinIO set up, the installation and running remains the same.
2017-01-16 20:05:00 -05:00
## 1. Prerequisites
2019-04-09 14:39:42 -04:00
Install MinIO - [MinIO Quickstart Guide ](https://docs.min.io/docs/minio-quickstart-guide ).
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
## 2. Run MinIO on Shared Backend
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
To run MinIO shared backend instances, you need to start multiple MinIO servers pointing to the same backend storage. We'll see examples on how to do this in the following sections.
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
- All the nodes running shared MinIO need to have same access key and secret key. To achieve this, we export access key and secret key as environment variables on all the nodes before executing MinIO server command.
2017-03-12 19:17:03 -04:00
- The drive paths below are for demonstration purposes only, you need to replace these with the actual drive paths/folders.
2017-01-16 20:05:00 -05:00
2022-02-11 19:51:25 -05:00
### MinIO shared mode on Ubuntu 16.04 LTS
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
You'll need the path to the shared volume, e.g. `/path/to/nfs-volume` . Then run the following commands on all the nodes you'd like to launch MinIO.
2017-01-16 20:05:00 -05:00
```sh
2021-01-05 13:22:57 -05:00
export MINIO_ROOT_USER=< ACCESS_KEY >
export MINIO_ROOT_PASSWORD=< SECRET_KEY >
2018-02-21 22:45:19 -05:00
minio gateway nas /path/to/nfs-volume
2017-01-16 20:05:00 -05:00
```
2022-02-11 19:51:25 -05:00
### MinIO shared mode on Windows 2012 Server
2017-01-16 20:05:00 -05:00
2019-04-09 14:39:42 -04:00
You'll need the path to the shared volume, e.g. `\\remote-server\smb` . Then run the following commands on all the nodes you'd like to launch MinIO.
2017-01-16 20:05:00 -05:00
```cmd
2021-01-05 13:22:57 -05:00
set MINIO_ROOT_USER=my-username
set MINIO_ROOT_PASSWORD=my-password
2018-02-21 22:45:19 -05:00
minio.exe gateway nas \\remote-server\smb\export
2017-01-16 20:05:00 -05:00
```
2022-02-11 19:51:25 -05:00
### Windows Tip
2017-01-16 20:05:00 -05:00
2022-02-11 19:51:25 -05:00
If a remote volume, e.g. `\\remote-server\smb` is mounted as a drive, e.g. `M:\` . You can use [`net use` ](https://technet.microsoft.com/en-us/library/bb490717.aspx ) command to map the drive to a folder.
2017-01-16 20:05:00 -05:00
```cmd
2021-01-05 13:22:57 -05:00
set MINIO_ROOT_USER=my-username
set MINIO_ROOT_PASSWORD=my-password
2017-01-16 20:05:00 -05:00
net use m: \\remote-server\smb\export /P:Yes
2018-02-21 22:45:19 -05:00
minio.exe gateway nas M:\export
2017-01-16 20:05:00 -05:00
```
## 3. Test your setup
2019-04-09 14:39:42 -04:00
To test this setup, access the MinIO server via browser or [`mc` ](https://docs.min.io/docs/minio-client-quickstart-guide ). You’ ll see the uploaded files are accessible from the all the MinIO shared backend endpoints.
2017-01-16 20:05:00 -05:00
## Explore Further
2022-02-11 19:51:25 -05:00
2019-04-09 14:39:42 -04:00
- [Use `mc` with MinIO Server ](https://docs.min.io/docs/minio-client-quickstart-guide )
- [Use `aws-cli` with MinIO Server ](https://docs.min.io/docs/aws-cli-with-minio )
- [Use `s3cmd` with MinIO Server ](https://docs.min.io/docs/s3cmd-with-minio )
- [Use `minio-go` SDK with MinIO Server ](https://docs.min.io/docs/golang-client-quickstart-guide )
- [The MinIO documentation website ](https://docs.min.io )