【问题标题】:Nexus fails starting: Unable to set localhostNexus 无法启动:无法设置 localhost
【发布时间】:2016-12-09 19:10:34
【问题描述】:

我正在尝试通过 homebrew 在 MacOS 上安装和运行 Nexus。到目前为止,安装进展顺利。已安装 2.13 版。

我通过nexus console启动时出现以下错误:

ERROR [jetty-main-1] *SYSTEM net.sf.ehcache.Cache - Unable to set localhost. 
This prevents creation of a GUID. Cause was: 
87.128.123.10.dyn.in-addr.arpa: 87.128.123.10.dyn.in-addr.arpa

java.net.UnknownHostException: 87.128.123.10.dyn.in-addr.arpa: 87.128.123.10.dyn.in-addr.arpa
    at java.net.InetAddress.getLocalHost(InetAddress.java:1475) ~[na:1.7.0_79]
    at net.sf.ehcache.Cache.<clinit>(Cache.java:217) ~[ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:303) [ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:219) [ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.CacheManager.configure(CacheManager.java:648) [ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.CacheManager.doInit(CacheManager.java:407) [ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.CacheManager.init(CacheManager.java:357) [ehcache-core-2.5.1.jar:na]
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:242) [ehcache-core-2.5.1.jar:na]
    at org.sonatype.sisu.ehcache.CacheManagerComponentImpl.createCacheManager(CacheManagerComponentImpl.java:112) [nexus-ehcache-2.13.0-01.jar:2.13.0-01]
    at org.sonatype.sisu.ehcache.CacheManagerComponentImpl.<init>(CacheManagerComponentImpl.java:57) [nexus-ehcache-2.13.0-01.jar:2.13.0-01]
    at org.sonatype.sisu.ehcache.CacheManagerComponentImpl.<init>(CacheManagerComponentImpl.java:52) [nexus-ehcache-2.13.0-01.jar:2.13.0-01]
    at org.sonatype.sisu.ehcache.CacheManagerComponentImpl$$FastClassByGuice$$6e60c0a8.newInstance(<generated>) [sisu-guice-3.1.10.jar:2.13.0-01]
    ...

当我打开 http://localhost:8081 时,这个 404 错误页面显示给我:

hostname 命令输出:

87.128.123.10.dyn.in-addr.arpa

ifconfig en0 命令输出:

en0: flags=8863 UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST mtu 1500
选项=10b
...
inet 10.123.128.87 网络掩码 0xfffffc00 广播 10.123.131.255
nd6 选项=1
媒体:自动选择(100baseTX)
状态:活跃

【问题讨论】:

  • 您是否根据您的主机名检查主机文件条目?
  • 我应该寻找什么?我调查了/etc/hosts。它包含127.0.0.1 localhost 的条目。我添加了0.0.0.0 localhost。不过没有区别。
  • 请尝试在主机中添加本地IP映射。你能分享一下 ifconfig 输出和主机名输出中列出的 ip 吗?
  • 不要添加0.0.0.0 localhost!那是 a non-routable meta address 不能在你的 /etc/hosts 文件中使用这种方式
  • 看起来 ehcache 正在尝试对您的 IP 执行反向 DNS 查找(in-arpa.addr 部分告诉我们这一点),而 DNS 没有任何内容,这会导致 java 在您的情况下抛出 UnknownHostException。 (这真的很奇怪)

标签: macos dns localhost ehcache nexus


【解决方案1】:

Nexus 默认在 /nexus 上下文中运行,所以请尝试http://localhost:8081/nexus

Jetty 返回 404 页面,因此应用服务器运行良好,一切正常。

如果 localhost 不起作用,请尝试使用您的 IP 号码或 127.0.0.1

【讨论】:

  • 我将在星期一再次坐在这台 Mac 上尝试这个。到目前为止,感谢您的澄清。
猜你喜欢
  • 2016-08-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-27
  • 2023-03-25
  • 1970-01-01
  • 2017-04-30
  • 2014-07-14
相关资源
最近更新 更多