Uploaded image for project: 'NetarchiveSuite'
  1. NetarchiveSuite
  2. NAS-1813

Localhost name resolution should be canonical

    XMLWordPrintable

Details

    Description

      When deploying in production version 3.15.1 we ran in a strange bug. The HarvestController would start Heritrix but then be completely unable to initiate any communication through JMX.

      It turned out that the following code (located in AbstractJMXHeritrixController constructor) :

      hostName = InetAddress.getLocalHost().getHostName();

      first tries to use the local system configuration of the loopback network interface to find the machine host name.

      The way our network is configured requires to use fully qualified host names (e.g. 'myhost.bnf.fr') whereas the loopback interface configuration defined the simple host name (e.g. 'myhost'). This configuration is correct and works fine. Also we deploy on a rather complex architecture (VMWare virtual machines running CentOS) and we'd rather avoid tweaking the virtual machine profiles too much.

      However the InetAddress API offers the getCanonicalHostName() method that will always will return the fully qualified host name. This method should be used.

      Also if such code is used elsewhere in the application, it should be put in an utility class and factorized.

      Attachments

        Activity

          People

            ngiraud Nicolas Giraud (Inactive)
            ngiraud Nicolas Giraud (Inactive)
            Mikis Seth Sørensen Mikis Seth Sørensen (Inactive)
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 7h
                7h
                Remaining:
                Remaining Estimate - 7h
                7h
                Logged:
                Time Spent - Not Specified
                Not Specified