prestoの起動時にエラー

かなり嵌って半日くらい使ってしまったのでメモ

## 以下の様なエラーが出た
```
2015-03-28T16:34:42.900+0900   INFO main  Bootstrap
2015-03-28T16:34:43.560+0900   INFO main  org.eclipse.jetty.util.log  Logging initialized @1675ms
2015-03-28T16:34:43.809+0900   WARN main  io.airlift.jmx.JmxAgent Cannot determine if JMX agent is already running (not an Oracle JVM?). Will try to start it manually.
2015-03-28T16:34:43.815+0900   INFO main  stderr  エラー: エージェントが例外をスローしました
2015-03-28T16:34:43.816+0900   INFO main  stderr  : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: presto01: presto01: unknown error
2015-03-28T16:34:43.832+0900   WARN main  io.airlift.jmx.JmxAgent Cannot determine if JMX agent is already running (not an Oracle JVM?). Will try to start it manually.
2015-03-28T16:34:43.834+0900   INFO main  stderr  エラー: エージェントが例外をスローしました
2015-03-28T16:34:43.834+0900   INFO main  stderr  : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: presto01: presto01: unknown error
2015-03-28T16:34:43.847+0900  ERROR main  com.facebook.presto.server.PrestoServer Unable to create injector, see the following errors:

1) Error injecting constructor, java.lang.RuntimeException: エージェントが例外をスローしました
  at io.airlift.jmx.JmxAgent.<init>(JmxAgent.java:48)
  at io.airlift.jmx.JmxModule.configure(JmxModule.java:43)
  while locating io.airlift.jmx.JmxAgent
    for parameter 0 at io.airlift.jmx.JmxModule$JmxAnnouncementProvider.setJmxAgent(JmxModule.java:60)
  while locating io.airlift.jmx.JmxModule$JmxAnnouncementProvider
  while locating io.airlift.discovery.client.ServiceAnnouncement annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=195, type=MULTIBINDER, keyType=)
  at io.airlift.discovery.client.DiscoveryModule.configure(DiscoveryModule.java:67) (via modules: io.airlift.discovery.client.DiscoveryModule -> com.google.inject.multibindings.Multibinder$RealMultibinder)
  while locating java.util.Set<io.airlift.discovery.client.ServiceAnnouncement>
    for parameter 1 at io.airlift.discovery.client.Announcer.<init>(Announcer.java:65)
  at io.airlift.discovery.client.DiscoveryModule.configure(DiscoveryModule.java:63)
  while locating io.airlift.discovery.client.Announcer
  at io.airlift.discovery.client.DiscoveryModule.createMergingServiceSelectorFactory(DiscoveryModule.java:119)
  at io.airlift.discovery.client.DiscoveryModule.createMergingServiceSelectorFactory(DiscoveryModule.java:119)
  while locating io.airlift.discovery.client.MergingServiceSelectorFactory
  at io.airlift.discovery.client.DiscoveryModule.configure(DiscoveryModule.java:71)
  while locating io.airlift.discovery.client.ServiceSelectorFactory
    for parameter 0 at io.airlift.discovery.client.ServiceSelectorProvider.setServiceSelectorFactory(ServiceSelectorProvider.java:49)
  at io.airlift.discovery.client.DiscoveryBinder.bindSelector(DiscoveryBinder.java:64)
Caused by: java.lang.RuntimeException: エージェントが例外をスローしました
  at sun.management.Agent.error(Agent.java:510)
  at sun.management.Agent.error(Agent.java:502)
  at sun.management.Agent.startAgent(Agent.java:264)
  at sun.management.Agent.startAgent(Agent.java:447)
  at io.airlift.jmx.JmxAgent.<init>(JmxAgent.java:78)
  at io.airlift.jmx.JmxAgent$$FastClassByGuice$$553f0c8a.newInstance(<generated>)
  at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
  at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
  at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
  at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
  at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
  at com.google.inject.Scopes$1$1.get(Scopes.java:65)
  at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
  at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
  at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
  at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:84)
  at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
  at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
  at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
  at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
  at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
  at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
  at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:349)
  at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:242)
  at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
  at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
  at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:66)
  at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
  at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
  at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
  at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:107)
  at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
  at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
  at com.google.inject.Scopes$1$1.get(Scopes.java:65)
  at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
  at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
  at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:94)
  at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:143)
  at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
  at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
  at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:66)
  at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
  at com.google.inject.Scopes$1$1.get(Scopes.java:65)
  at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
  at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
  at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
  at com.google.inject.Scopes$1$1.get(Scopes.java:65)
  at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
  at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
  at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
  at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:84)
  at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
  at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
  at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
  at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
  at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
  at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:174)
  at com.google.inject.internal.Initializer.injectAll(Initializer.java:108)
  at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174)
  at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
  at com.google.inject.Guice.createInjector(Guice.java:96)
  at io.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:286)
  at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:103)
  at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:59)
```

## 結論
* prestoは自分自身が起動する際に`hostname`でIPの名前解決をしている。
* 名前解決が出来ないと`java.net.MalformedURLException`を吐いてエラーになる。

## 対応法
* 自分自身のhotsnameを名前解決出来るようにしてあげる。