2018-02-02 21:18:52 -05:00
|
|
|
# Federation
|
|
|
|
There are primarily two types of federation
|
|
|
|
|
|
|
|
- Bucket lookup from DNS
|
|
|
|
- Bucket is shared across many clusters
|
|
|
|
|
2018-04-23 14:05:56 -04:00
|
|
|
This document will explain about how to configure Minio to support `Bucket lookup from DNS` style federation.
|
2018-02-02 21:18:52 -05:00
|
|
|
|
|
|
|
## Federation (Bucket Lookup)
|
|
|
|
Bucket lookup federation requires two dependencies
|
|
|
|
|
|
|
|
- etcd (for config, bucket SRV records)
|
|
|
|
- coredns (for DNS management based on populated bucket SRV records)
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
![bucket-lookup](./bucket-lookup.png)
|
|
|
|
|
|
|
|
### Run Multiple Clusters
|
|
|
|
> cluster1
|
|
|
|
```
|
|
|
|
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}
|
|
|
|
```
|
|
|
|
> cluster2
|
|
|
|
```
|
|
|
|
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}
|
|
|
|
```
|
|
|
|
|
|
|
|
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-05-01 13:36:37 -04:00
|
|
|
TODO: For now the control to create the bucket from a client to the right cluster using `region` parameter
|
2018-04-23 14:05:56 -04:00
|
|
|
is not implemented yet.
|
2018-02-02 21:18:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|