我想启动一个zipkin docker映像以与外部mysql数据库一起运行。所以我修改了贡献的docker-compose文件,如下所示:
zipkin:
image: openzipkin/zipkin
container_name: zipkin
# Environment settings are defined here https://github.com/openzipkin/zipkin/tree/1.19.0/zipkin-server#environment-variables
environment:
- STORAGE_TYPE=mysql
# Point the zipkin at the storage backend
- MYSQL_HOST=myhost.mycompany.de
- MYSQL_DB=my_zipkin
- MYSQL_USER=my_zipkin
- MYSQL_PASS=xxxx
# Uncomment to enable scribe
# - SCRIBE_ENABLED=true
# Uncomment to enable self-tracing
# - SELF_TRACING_ENABLED=true
# Uncomment to enable debug logging
# - JAVA_OPTS=-Dlogging.level.zipkin=DEBUG -Dlogging.level.zipkin2=DEBUG
ports:
# Port used for the Zipkin UI and HTTP Api
- 9411:9411
# Uncomment if you set SCRIBE_ENABLED=true
# - 9410:9410
在启动过程中,我从zipkin服务器获得了此输出
Attaching to zipkin
zipkin | MySQL host: myhost.mycompany.de
,但我希望它能在mysql db中创建表。但是没有创建表,并且ui给了我这个错误(当然):
ERROR: cannot load service names: Request processing failed; nested exception is org.jooq.exception.DataAccessException: SQL [select distinct
zipkin_annotations .
endpoint_service_name from
zipkin_annotations where (
zipkin_annotations .
endpoint_service_name is not null and
zipkin_annotations .
endpoint_service_name <> ?)]; (conn=4132460) Table 'ecp_zipkin.zipkin_annotations' doesn't exist
我如何告诉zipkin服务器首先创建数据库,还是有另一种方法?