Start all listeners when a given host resolves to multiple IPs. (#3145)

Default golang net.Listen only listens on the first IP when
host resolves to multiple IPs.

This change addresses a problem for example your ``/etc/hosts``
has entries as following

```
127.0.1.1  minio1

192.168.1.10 minio1
```

Trying to start minio as

```
minio server --address "minio1:9001" ~/Photos
```

Causes the minio server to be bound only to "127.0.1.1" which
is an incorrect behavior since we are generally interested in
`192.168.1.10` as well.

This patch addresses this issue if the hostname is resolvable
and gives back list of addresses associated with that hostname
we just bind on all of them as it is the expected behavior.
This commit is contained in:
Harshavardhana
2016-11-01 15:38:28 -07:00
committed by GitHub
parent 8bffa78f7f
commit 9bb799462e
3 changed files with 175 additions and 54 deletions

View File

@@ -96,12 +96,6 @@ EXAMPLES:
$ minio {{.Name}} http://192.168.1.11/mnt/export/ http://192.168.1.12/mnt/export/ \
http://192.168.1.13/mnt/export/ http://192.168.1.14/mnt/export/
7. Start minio server on a 4 node distributed setup. Type the following command on all the 4 nodes exactly.
$ minio {{.Name}} http://minio:miniostorage@192.168.1.11/mnt/export/ \
http://minio:miniostorage@192.168.1.12/mnt/export/ \
http://minio:miniostorage@192.168.1.13/mnt/export/ \
http://minio:miniostorage@192.168.1.14/mnt/export/
`,
}