【问题标题】:Presto unable to create injector with localfile connectorPresto 无法使用 localfile 连接器创建注入器
【发布时间】:2016-07-05 10:22:46
【问题描述】:

我在 macOS 10.11 上使用 presto-server-0.149。仅出于测试目的,我运行一个节点,一切正常。当我添加etc/catalog/localfile.properties 时:

connector.name=localfile
presto-logs.http-request-log-location=/var/log/apache2/access_log

我收到以下错误:

2016-07-04T12:02:45.435-0700    INFO    main    io.airlift.bootstrap.LifeCycleManager   Life cycle starting...
2016-07-04T12:02:45.435-0700    INFO    main    io.airlift.bootstrap.LifeCycleManager   Life cycle startup complete. System ready.
2016-07-04T12:02:45.436-0700    INFO    main    com.facebook.presto.metadata.CatalogManager -- Added catalog jmx using connector jmx --
2016-07-04T12:02:45.436-0700    INFO    main    com.facebook.presto.metadata.CatalogManager -- Loading catalog etc/catalog/localfile.properties --
2016-07-04T12:02:45.797-0700    INFO    main    Bootstrap   PROPERTY                               DEFAULT                   RUNTIME                   DESCRIPTION
2016-07-04T12:02:45.797-0700    INFO    main    Bootstrap   presto-logs.http-request-log.pattern   null                      null                      If log location is a directory this glob is used to match the file names in the directory
2016-07-04T12:02:45.797-0700    INFO    main    Bootstrap   presto-logs.http-request-log.location  var/log/http-request.log  var/log/http-request.log  Directory or file where http request logs are written
2016-07-04T12:02:45.797-0700    INFO    main    Bootstrap   
2016-07-04T12:02:45.797-0700    WARN    main    Bootstrap   UNUSED PROPERTIES
2016-07-04T12:02:45.797-0700    WARN    main    Bootstrap   presto-logs.http-request-log-location=/var/log/apache2/access_log
2016-07-04T12:02:45.797-0700    WARN    main    Bootstrap   
2016-07-04T12:02:45.989-0700    ERROR   main    com.facebook.presto.server.PrestoServer Unable to create injector, see the following errors:

1) Configuration property 'presto-logs.http-request-log-location=/var/log/apache2/access_log' was not used
  at io.airlift.bootstrap.Bootstrap.lambda$initialize$2(Bootstrap.java:235)

1 error
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Configuration property 'presto-logs.http-request-log-location=/var/log/apache2/access_log' was not used
  at io.airlift.bootstrap.Bootstrap.lambda$initialize$2(Bootstrap.java:235)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
    at com.google.inject.Guice.createInjector(Guice.java:96)
    at io.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:242)
    at com.facebook.presto.localfile.LocalFileConnectorFactory.create(LocalFileConnectorFactory.java:64)
    at com.facebook.presto.connector.ConnectorManager.createConnector(ConnectorManager.java:315)
    at com.facebook.presto.connector.ConnectorManager.addCatalogConnector(ConnectorManager.java:169)
    at com.facebook.presto.connector.ConnectorManager.createConnection(ConnectorManager.java:162)
    at com.facebook.presto.connector.ConnectorManager.createConnection(ConnectorManager.java:148)
    at com.facebook.presto.metadata.CatalogManager.loadCatalog(CatalogManager.java:99)
    at com.facebook.presto.metadata.CatalogManager.loadCatalogs(CatalogManager.java:77)
    at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:115)
    at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:63)

更新

根据下面 Dain Sundstrom 的回答,我能够解决我的问题。事实证明,Local File Connector 的 fb 文档不正确。由于我需要获取一些东西来提供 Presto 来测试 localfile 连接器,因此我将配置文件路径更改为 Presto 自己的请求日志:

presto-logs.http-request-log.location=/var/presto/data/var/log/http-request.log

【问题讨论】:

    标签: presto


    【解决方案1】:

    您在配置属性中有错字。应该是:

    presto-logs.http-request-log.location=/var/log/apache2/access_log
    

    此外,此连接器只能处理 Presto 自身创建的 http 日志格式,因此您需要重新配置 Apache2 服务器以输出相同的格式。

    【讨论】:

    • 谢谢戴恩。所以这意味着文档也有错字,因为我在prestodb.io/docs/current/connector/localfile.html 处直接剪切并粘贴了这些内容。也许你可以让他们知道?我在哪里可以找到 PrestoDB 使用的格式。我找不到描述此要求的任何地方。
    • Also, this connector can only process the http log format created by Presto itself。也许只有我一个人,但是“本地文件连接器”这个名字是不是有点误导?也许“日志文件连接器”会更清楚地表明它不是“通用”连接器。
    猜你喜欢
    • 1970-01-01
    • 2014-10-04
    • 1970-01-01
    • 1970-01-01
    • 2021-08-25
    • 2020-01-26
    • 2019-06-21
    • 2019-04-22
    • 2018-08-01
    相关资源
    最近更新 更多