Problem scenario
You try to start Apache Presto. But you get an error like this:
2020-09-29T19:28:25.866Z WARN main io.airlift.jmx.JmxAgent Cannot determine if JMX agent is already running (not an Oracle JVM?). Will try to start it manually.
2020-09-29T19:28:25.916Z INFO main io.airlift.jmx.JmxAgent JMX agent started and listening on ip-172-31-103-99.us-east-2.compute.internal:44377
2020-09-29T19:28:26.030Z ERROR Discovery-0 io.airlift.discovery.client.CachingServiceSelector Cannot connect to discovery server for refresh (collector/general): Lookup of collector failed for http://localhost:8080/v1/service/collector/general
2020-09-29T19:28:26.066Z ERROR Discovery-2 io.airlift.discovery.client.CachingServiceSelector Cannot connect to discovery server for refresh (presto/general): Lookup of presto failed for http://localhost:8080/v1/service/presto/general
2020-09-29T19:28:27.161Z WARN http-client-shared-29 com.facebook.presto.metadata.RemoteNodeState Error fetching node state from http://172.31.103.99:8080/v1/info/state: Server refused connection: http://172.31.103.99:8080/v1/info/state
2020-09-29T19:28:28.227Z ERROR main com.facebook.presto.server.PrestoServer Unable to create injector, see the following errors:1) Error injecting constructor, java.lang.IllegalArgumentException: query.max-memory-per-node set to 1GB, but only 80530637B of useable heap available
at com.facebook.presto.memory.LocalMemoryManager.(LocalMemoryManager.java:42)
at com.facebook.presto.server.ServerMainModule.setup(ServerMainModule.java:245)
while locating com.facebook.presto.memory.LocalMemoryManager
for parameter 5 at com.facebook.presto.execution.SqlTaskManager.(SqlTaskManager.java:106)
while locating com.facebook.presto.execution.SqlTaskManager
at com.facebook.presto.server.ServerMainModule.setup(ServerMainModule.java:236)
while locating com.facebook.presto.execution.TaskManager
for parameter 0 at com.facebook.presto.server.TaskResource.(TaskResource.java:97)
at com.facebook.presto.server.ServerMainModule.setup(ServerMainModule.java:234)
while locating com.facebook.presto.server.TaskResource
at io.airlift.jaxrs.JaxrsBinder.bind(JaxrsBinder.java:33)
while locating java.lang.Object annotated with @com.google.inject.multibindings.Element(setName=@io.airlift.jaxrs.JaxrsResource,uniqueId=460, type=MULTIBINDER, keyType=)
What should you do?
Possible Solution #1
Look at the jvm.config file for Presto.
Can you modify this setting to have more memory? Here would be one setting:
-Xmx1G
1G is often enough. If you set the value too low, you'll get the error above.
Possible Solution #2
Add more memory via swap space. See this posting for more information.
Possible Solution #3
Add more memory to the server (e.g., resize the VM or buy memory for the physical server). See this posting for more information.