我找到了错误详细信息。它在德鲁伊协调员日志中。根据以下链接,MySql JDBC jar 文件未随 Druid docker 映像一起提供。
https://druid.apache.org/docs/latest/development/extensions-core/mysql.html
所以我不得不将它复制到使用元数据存储的 Druid 容器中。在那之后,这一切都像一个魅力。
以下是我正在使用的 docker-compose 文件和环境文件中的详细信息:
码头工人-compose.yml
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
version: "2.2"
volumes:
metadata_data: {}
middle_var: {}
historical_var: {}
broker_var: {}
coordinator_var: {}
router_var: {}
mysql-data: {}
services:
mysql:
image: mysql
restart: always
environment:
- MYSQL_RANDOM_ROOT_PASSWORD='yes'
- MYSQL_USER=druid
- MYSQL_PASSWORD=diurd
- MYSQL_DATABASE=druid
command:
- --character-set-server=utf8
- --collation-server=utf8_unicode_ci
volumes:
- 'mysql-data:/var/lib/mysql:rw'
networks:
cc_subnet:
ipv4_address: 172.16.1.10
# Need 3.5 or later for container nodes
druid_zookeeper:
container_name: zookeeper
hostname: druid_zookeeper
image: zookeeper:3.5
environment:
- ZOO_MY_ID=1
networks:
cc_subnet:
ipv4_address: 172.16.1.11
coordinator:
image: apache/druid:0.20.0
container_name: coordinator
volumes:
- ./storage:/opt/data
- coordinator_var:/opt/druid/var
- ./extensions/mysql-connector-java-5.1.48.jar:/opt/druid/extensions/mysql-metadata-storage/mysql-connector-java-5.1.48.jar
depends_on:
- druid_zookeeper
- mysql
ports:
- "8081:8081"
command:
- coordinator
env_file:
- environment
networks:
cc_subnet:
ipv4_address: 172.16.1.12
broker:
image: apache/druid:0.20.0
container_name: broker
volumes:
- broker_var:/opt/druid/var
- ./extensions/mysql-connector-java-5.1.48.jar:/opt/druid/extensions/mysql-metadata-storage/mysql-connector-java-5.1.48.jar
depends_on:
- druid_zookeeper
- mysql
- coordinator
ports:
- "8082:8082"
command:
- broker
env_file:
- environment
networks:
cc_subnet:
ipv4_address: 172.16.1.13
historical:
image: apache/druid:0.20.0
container_name: historical
volumes:
- ./storage:/opt/data
- historical_var:/opt/druid/var
- ./extensions/mysql-connector-java-5.1.48.jar:/opt/druid/extensions/mysql-metadata-storage/mysql-connector-java-5.1.48.jar
depends_on:
- druid_zookeeper
- mysql
- coordinator
ports:
- "8083:8083"
command:
- historical
env_file:
- environment
networks:
cc_subnet:
ipv4_address: 172.16.1.14
middlemanager:
image: apache/druid:0.20.0
container_name: middlemanager
volumes:
- ./storage:/opt/data
- middle_var:/opt/druid/var
- ./extensions/mysql-connector-java-5.1.48.jar:/opt/druid/extensions/mysql-metadata-storage/mysql-connector-java-5.1.48.jar
depends_on:
- druid_zookeeper
- mysql
- coordinator
ports:
- "8091:8091"
command:
- middleManager
env_file:
- environment
networks:
cc_subnet:
ipv4_address: 172.16.1.15
router:
image: apache/druid:0.20.0
container_name: router
volumes:
- router_var:/opt/druid/var
- ./extensions/mysql-connector-java-5.1.48.jar:/opt/druid/extensions/mysql-metadata-storage/mysql-connector-java-5.1.48.jar
depends_on:
- druid_zookeeper
- mysql
- coordinator
ports:
- "8888:8888"
command:
- router
env_file:
- environment
networks:
cc_subnet:
ipv4_address: 172.16.1.16
networks:
cc_subnet:
external: true
环境
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Java tuning
DRUID_XMX=1g
DRUID_XMS=1g
DRUID_MAXNEWSIZE=250m
DRUID_NEWSIZE=250m
DRUID_MAXDIRECTMEMORYSIZE=6172m
druid_emitter_logging_logLevel=debug
druid_extensions_loadList=["druid-histogram", "druid-datasketches", "druid-lookups-cached-global", "mysql-metadata-storage"]
druid_zk_service_host=druid_zookeeper
druid_metadata_storage_host=
druid_metadata_storage_type=mysql
druid_metadata_storage_connector_connectURI=jdbc:mysql://mysql:3306/druid?allowPublicKeyRetrieval=true&useSSL=false
druid_metadata_storage_connector_user=druid
druid_metadata_storage_connector_password=diurd
druid_coordinator_balancer_strategy=cachingCost
druid_indexer_runner_javaOptsArray=["-server", "-Xmx1g", "-Xms1g", "-XX:MaxDirectMemorySize=3g", "-Duser.timezone=UTC", "-Dfile.encoding=UTF-8", "-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"]
druid_indexer_fork_property_druid_processing_buffer_sizeBytes=268435456
druid_storage_type=local
druid_storage_storageDirectory=/opt/data/segments
druid_indexer_logs_type=file
druid_indexer_logs_directory=/opt/data/indexing-logs
druid_processing_numThreads=2
druid_processing_numMergeBuffers=2
DRUID_LOG4J=<?xml version="1.0" encoding="UTF-8" ?><Configuration status="WARN"><Appenders><Console name="Console" target="SYSTEM_OUT"><PatternLayout pattern="%d{ISO8601} %p [%t] %c - %m%n"/></Console></Appenders><Loggers><Root level="info"><AppenderRef ref="Console"/></Root><Logger name="org.apache.druid.jetty.RequestLog" additivity="false" level="DEBUG"><AppenderRef ref="Console"/></Logger></Loggers></Configuration>