This topic discusses how Endeca Server performs hostname resolution.
The Endeca Server Java application running in WebLogic relies on the hostname resolution by checking the network configuration on your machine. In the majority of network configurations, your machine is already set up properly and the Endeca Server can resolve its hostname correctly through DNS lookup, at startup. If this is the case, you can ignore this topic.
In some instances, however, additional troubleshooting might be required. This topic discusses the details.
The Endeca Server uses a Java System call to obtain the mapping between an externally-resolvable IP address and the machine's hostname. The Java System call is specific to the operating system and to the network setup on your machine. For example, if DNS is configured in an enterprise-wide domain by the IT department, the hostname resolution works fine (even if the /etc/hosts file on your machine is empty). However, if your /etc/hosts file includes any entries, Endeca Server uses this file (overriding what it finds from the DNS lookup), and this may prevent the Endeca Server to properly resolve its hostname. In such cases, you receive the "Could not connect to Endeca Server" error.
The summary is that Endeca Server relies on the hostname resolution by ultimately checking the network configuration on your machine which is done through /etc/hosts. That is, in the end, Endeca Server does not use any other OS-specific methods for determining the host name, but relies on /etc/hosts. In the /etc/hosts file, Endeca Server looks for the hostname that is mapped to the site-local IP address. It is important to know that Endeca Server cannot use a mapping to localhost. Therefore, to ensure host name resolution in the Endeca Server, check that your /etc/hosts file includes as its first entry the mapping from the machine-specific IP address to the full name of your machine. (This file can also include a mapping to localhost, as long as this entry is not the first, that is, it is listed after the mapping to the full name of your machine).
The following statements describe the Endeca Server’s hostname resolution logic in detail.
192.168.0.1 myname.example.comEndeca Server will use myname as the hostname, at startup. Similarly, if the mapping is:
192.168.0.1 mynameEndeca Server will use myname as the hostname, at startup.
192.168.0.1 localhostSimilarly, this mapping is also not resolvable by the Endeca Server:
127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain localhostThese mappings are resolvable (myhostname is listed first, before localhost, and it is first mapped to the site-local externally-resolvable IP address):
192.168.0.45 myhostname localhost.localdomain localhost
127.0.0.1 myhostname localhost.localdomain localhost ::1 myhostname localhost6.localdomain localhost
To conclude, if you observe connection problems with the Endeca Sever, reconfigure networking configuration on the Endeca Server machines, so that /etc/hosts includes a mapping from the site-local IP address to FQDN, or the first portion of the correct, Fully Qualified Domain Name. If /etc/hosts includes a mapping to localhost, it should not be the only entry, and should not be the first entry in this file. Do not use any other OS-specific methods for determining the hostname — only use the configuration in /etc/hosts, because ultimately, this is the configuration that Endeca Server relies on.