这是druid.io批量导入数据时出现的问题,当启动overlord节点时,运行的命令如下:
java -Xmx2g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -classpath config/_common:config/overlord:lib/*: io.druid.cli.Main server overlord
出现的错误的信息:
1) Unknown provider[mysql] of Key[type=io.druid.metadata.MetadataStorageConnector, annotation=[none]], known options[[derby]]
at io.druid.guice.PolyBind.createChoiceWithDefault(PolyBind.java:86)
while locating io.druid.metadata.MetadataStorageConnector
at io.druid.guice.JacksonConfigManagerModule.getConfigManager(JacksonConfigManagerModule.java:50)
at io.druid.guice.JacksonConfigManagerModule.getConfigManager(JacksonConfigManagerModule.java:50)
while locating io.druid.common.config.ConfigManager
for parameter 0 at io.druid.common.config.JacksonConfigManager.(JacksonConfigManager.java:46)
at io.druid.guice.JacksonConfigManagerModule.configure(JacksonConfigManagerModule.java:39)
while locating io.druid.common.config.JacksonConfigManager
for parameter 0 at io.druid.guice.JacksonConfigProvider.configure(JacksonConfigProvider.java:78)
at io.druid.guice.JacksonConfigProvider.bind(JacksonConfigProvider.java:36)
2) Unknown provider[mysql] of Key[type=io.druid.metadata.SQLMetadataConnector, annotation=[none]], known options[[derby]]
at io.druid.guice.PolyBind.createChoiceWithDefault(PolyBind.java:86)
while locating io.druid.metadata.SQLMetadataConnector
该问题是运行示例时出现的问题,原因在目标存储的metadata信息为指明mysql,而配置中又要存储在mysql中导致出现了该问题,需要修改 config/_common/common.runtime.properties 文件。在该文件中增加配置
druid.extensions.coordinates=["io.druid.extensions:druid-examples","io.druid.extensions:druid-kafka-eight","io.druid.extensions:mysql-metadata-storage"]
druid.extensions.localRepository=extensions-repo
# Zookeeper
druid.zk.service.host=localhost
# Metadata Storage (use something like mysql in production by uncommenting properties below)
# by default druid will use derby
druid.metadata.storage.type=mysql
druid.metadata.storage.connector.connectURI=jdbc:mysql://localhost:3306/druid
druid.metadata.storage.connector.user=druid
druid.metadata.storage.connector.password=diurd1234
这里主要声明两个配置:
druid.extensions.coordinates 中增加 "io.druid.extensions:mysql-metadata-storage",很多时候忘记了这一条导致出现上述问题。
druid.metadata.storage的配置。