-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Networking
-
None
-
Fully Compatible
-
ALL
-
v4.0
-
-
Security 2018-11-19
-
(copied to CRM)
Specifying --bind_ip localhost with or without an additional ip address results in the server error below and the mongod fails to start:
2018-11-06T10:23:07.682-0600 I STORAGE [initandlisten] exception in initAndListen std::exception: listen: Address already in use, terminating
2018-11-06T10:23:07.682-0600 I NETWORK [initandlisten] shutdown: going to close listening sockets...
This is due to the `localhost` alias being used for both IPv4 and IPv6 loopback addresses in /etc/hosts.
The following workarounds are available:
- Use localhost4 or some other unique alias in /etc/hosts for 127.0.0.1
- Use the loopback address directly 127.0.0.1 instead of an alias shared by both 127.0.0.1 and ::1
- Comment out or remove matching IPv6 aliases in /etc/hosts if IPv6 is not currently in use
This was tested on the following release:
- mongod --version
db version v4.0.3
git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: enterprise
build environment:
distmod: rhel62
distarch: x86_64
target_arch: x86_64
- is related to
-
SERVER-32631 specifying --bind_ip localhost results in error "address already in use"
- Closed
- related to
-
SERVER-44184 De-duplicate resolved addresses on v3.6
- Closed