2022-02-11 19:51:25 -05:00
# Federation Quickstart Guide [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) *Federation feature is deprecated and should be avoided for future deployments*
2021-02-04 20:18:37 -05:00
2019-04-09 14:39:42 -04:00
This document explains how to configure MinIO with `Bucket lookup from DNS` style federation.
2018-02-02 21:18:52 -05:00
2018-06-09 04:30:11 -04:00
## Get started
### 1. Prerequisites
2022-02-11 19:51:25 -05:00
2019-04-09 14:39:42 -04:00
Install MinIO - [MinIO Quickstart Guide ](https://docs.min.io/docs/minio-quickstart-guide ).
2018-06-09 04:30:11 -04:00
2019-04-09 14:39:42 -04:00
### 2. Run MinIO in federated mode
2022-02-11 19:51:25 -05:00
2018-05-15 21:20:22 -04:00
Bucket lookup from DNS federation requires two dependencies
2018-02-02 21:18:52 -05:00
2019-06-14 03:29:22 -04:00
- etcd (for bucket DNS service records)
- CoreDNS (for DNS management based on populated bucket DNS service records, optional)
2018-02-02 21:18:52 -05:00
## Architecture
2018-06-20 22:59:12 -04:00
![bucket-lookup ](https://github.com/minio/minio/blob/master/docs/federation/lookup/bucket-lookup.png?raw=true )
2018-02-02 21:18:52 -05:00
2018-05-15 21:20:22 -04:00
### Environment variables
#### MINIO_ETCD_ENDPOINTS
2019-04-09 14:39:42 -04:00
This is comma separated list of etcd servers that you want to use as the MinIO federation back-end. This should
be same across the federated deployment, i.e. all the MinIO instances within a federated deployment should use same
2018-05-15 21:20:22 -04:00
etcd back-end.
#### MINIO_DOMAIN
This is the top level domain name used for the federated setup. This domain name should ideally resolve to a load-balancer
2019-04-09 14:39:42 -04:00
running in front of all the federated MinIO instances. The domain name is used to create sub domain entries to etcd. For
2018-05-15 21:20:22 -04:00
example, if the domain is set to `domain.com` , the buckets `bucket1` , `bucket2` will be accessible as `bucket1.domain.com`
and `bucket2.domain.com` .
#### MINIO_PUBLIC_IPS
2019-04-09 14:39:42 -04:00
This is comma separated list of IP addresses to which buckets created on this MinIO instance will resolve to. For example,
a bucket `bucket1` created on current MinIO instance will be accessible as `bucket1.domain.com` , and the DNS entry for
2018-05-15 21:20:22 -04:00
`bucket1.domain.com` will point to IP address set in `MINIO_PUBLIC_IPS` .
2019-04-09 14:39:42 -04:00
- This field is mandatory for standalone and erasure code MinIO server deployments, to enable federated mode.
2018-05-15 21:20:22 -04:00
- This field is optional for distributed deployments. If you don't set this field in a federated setup, we use the IP addresses of
2019-04-09 14:39:42 -04:00
hosts passed to the MinIO server startup and use them for DNS entries.
2018-05-15 21:20:22 -04:00
2018-02-02 21:18:52 -05:00
### Run Multiple Clusters
2018-05-15 21:20:22 -04:00
2018-02-02 21:18:52 -05:00
> cluster1
2018-05-15 21:20:22 -04:00
```sh
2018-02-02 21:18:52 -05:00
export MINIO_ETCD_ENDPOINTS="http://remote-etcd1:2379,http://remote-etcd2:4001"
export MINIO_DOMAIN=domain.com
2018-05-11 15:02:30 -04:00
export MINIO_PUBLIC_IPS=44.35.2.1,44.35.2.2,44.35.2.3,44.35.2.4
2018-02-02 21:18:52 -05:00
minio server http://rack{1...4}.host{1...4}.domain.com/mnt/export{1...32}
```
2018-05-15 21:20:22 -04:00
2018-02-02 21:18:52 -05:00
> cluster2
2018-05-15 21:20:22 -04:00
```sh
2018-02-02 21:18:52 -05:00
export MINIO_ETCD_ENDPOINTS="http://remote-etcd1:2379,http://remote-etcd2:4001"
export MINIO_DOMAIN=domain.com
2018-05-11 15:02:30 -04:00
export MINIO_PUBLIC_IPS=44.35.1.1,44.35.1.2,44.35.1.3,44.35.1.4
2018-02-02 21:18:52 -05:00
minio server http://rack{5...8}.host{5...8}.domain.com/mnt/export{1...32}
```
2019-04-09 14:39:42 -04:00
In this configuration you can see `MINIO_ETCD_ENDPOINTS` points to the etcd backend which manages MinIO's
2018-04-23 14:05:56 -04:00
`config.json` and bucket DNS SRV records. `MINIO_DOMAIN` indicates the domain suffix for the bucket which
will be used to resolve bucket through DNS. For example if you have a bucket such as `mybucket` , the
2018-05-11 15:02:30 -04:00
client can use now `mybucket.domain.com` to directly resolve itself to the right cluster. `MINIO_PUBLIC_IPS`
2018-04-23 14:05:56 -04:00
points to the public IP address where each cluster might be accessible, this is unique for each cluster.
2018-02-02 21:18:52 -05:00
2018-04-23 14:05:56 -04:00
NOTE: `mybucket` only exists on one cluster either `cluster1` or `cluster2` this is random and
2018-02-02 21:18:52 -05:00
is decided by how `domain.com` gets resolved, if there is a round-robin DNS on `domain.com` then
2018-04-23 14:05:56 -04:00
it is randomized which cluster might provision the bucket.
2018-06-09 04:30:11 -04:00
2022-02-10 12:52:29 -05:00
### 3. Test your setup
2018-07-12 17:12:40 -04:00
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 endpoints.
2018-06-09 04:30:11 -04:00
2022-02-14 11:50:42 -05:00
## Explore Further
2018-07-12 17:12:40 -04: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 )