无法将 Mysql 数据库连接到 presto - 没有连接器 mysql 的工厂

Not able to connect Mysql database to presto - No factory for connector mysql

尝试在 Intellij 中启动 Presto 服务器时,我总是遇到此错误。
2015-06-05T19:30:32.293+0530 ERROR main com.facebook.presto.server.PrestoServer No factory for connector mysql

java.lang.IllegalArgumentException: No factory for connector mysql
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at com.facebook.presto.connector.ConnectorManager.createConnection(ConnectorManager.java:131)
at com.facebook.presto.metadata.CatalogManager.loadCatalog(CatalogManager.java:88)
at com.facebook.presto.metadata.CatalogManager.loadCatalogs(CatalogManager.java:70)
at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:107)
at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

2015-06-05T19:30:32.294+0530 INFO Thread-88 io.airlift.bootstrap.LifeCycleManager Life cycle stopping...

Process finished with exit code 1

我使用 brew 安装了 mysql。

当每个 Presto 服务器启动时,它会记录加载了哪些目录。我的猜测是文件不在正确的位置,或者您没有重新启动 Presto 服务器。请注意,该文件必须在每个 Presto 服务器上。

'mysql.properties' 文件应该存在于 presto-main/etc/catalog 文件夹

此外, 'presto-main/etc/config.properties' 应该被编辑。 '../presto-mysql/pom.xml' 需要附加在 plugin.bundles 中,如下所示

$ cat presto-main/etc/config.properties

# sample nodeId to provide consistency across test runs
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.environment=test
http-server.http.port=8080

discovery-server.enabled=true
discovery.uri=http://localhost:8080

exchange.http-client.max-connections=1000
exchange.http-client.max-connections-per-server=1000
exchange.http-client.connect-timeout=1m
exchange.http-client.read-timeout=1m

scheduler.http-client.max-connections=1000
scheduler.http-client.max-connections-per-server=1000
scheduler.http-client.connect-timeout=1m
scheduler.http-client.read-timeout=1m

query.client.timeout=5m
query.max-age=30m

plugin.bundles=\
  ../presto-raptor/pom.xml,\
  ../presto-hive-cdh4/pom.xml,\
  ../presto-example-http/pom.xml,\
  ../presto-kafka/pom.xml,\
  ../presto-tpch/pom.xml,\
  ../presto-mysql/pom.xml

presto.version=testversion
experimental-syntax-enabled=true
distributed-joins-enabled=true