远程日志存储(Remote Logging)

Apache DolphinScheduler支持将任务日志传输到远端存储上。当配置开启远程日志存储后,DolphinScheduler将在任务结束后,将对应的任务日志异步地发送到指定的远端存储上。此外,用户在查看或下载任务日志时,若本地没有该日志文件,DolphinScheduler将从远端存储上下载对应的日志文件到本地文件系统。

开启远程日志存储

如果您以 集群 模式或者 伪集群 模式部署DolphinScheduler,您需要对以下路径的文件进行配置:api-server/conf/common.propertiesmaster-server/conf/common.propertiesworker-server/conf/common.properties; 若您以 单机 模式部署DolphinScheduler,您只需要配置 standalone-server/conf/common.properties,具体配置如下:

  1. # 是否开启远程日志存储
  2. remote.logging.enable=true
  3. # 任务日志写入的远端存储,目前支持OSS, S3, GCS, ABS
  4. remote.logging.target=OSS
  5. # 任务日志在远端存储上的目录
  6. remote.logging.base.dir=logs
  7. # 设置向远端存储异步发送日志的线程池大小
  8. remote.logging.thread.pool.size=10

将任务日志写入阿里云对象存储(OSS)

配置common.propertis如下:

  1. # oss access key id, required if you set remote.logging.target=OSS
  2. remote.logging.oss.access.key.id=<access.key.id>
  3. # oss access key secret, required if you set remote.logging.target=OSS
  4. remote.logging.oss.access.key.secret=<access.key.secret>
  5. # oss bucket name, required if you set remote.logging.target=OSS
  6. remote.logging.oss.bucket.name=<bucket.name>
  7. # oss endpoint, required if you set remote.logging.target=OSS
  8. remote.logging.oss.endpoint=<endpoint>

将任务日志写入Amazon S3

配置common.propertis如下:

  1. # s3 access key id, required if you set remote.logging.target=S3
  2. remote.logging.s3.access.key.id=<access.key.id>
  3. # s3 access key secret, required if you set remote.logging.target=S3
  4. remote.logging.s3.access.key.secret=<access.key.secret>
  5. # s3 bucket name, required if you set remote.logging.target=S3
  6. remote.logging.s3.bucket.name=<bucket.name>
  7. # s3 endpoint, required if you set remote.logging.target=S3
  8. remote.logging.s3.endpoint=<endpoint>
  9. # s3 region, required if you set remote.logging.target=S3
  10. remote.logging.s3.region=<region>

将任务日志写入Google Cloud Storage (GCS)

配置common.propertis如下:

  1. # the location of the google cloud credential, required if you set remote.logging.target=GCS
  2. remote.logging.google.cloud.storage.credential=/path/to/credential
  3. # gcs bucket name, required if you set remote.logging.target=GCS
  4. remote.logging.google.cloud.storage.bucket.name=<your-bucket>

将任务日志写入Azure Blob Storage (ABS)

配置common.propertis如下:

  1. # abs account name, required if you set resource.storage.type=ABS
  2. remote.logging.abs.account.name=<your-account-name>
  3. # abs account key, required if you set resource.storage.type=ABS
  4. remote.logging.abs.account.key=<your-account-key>
  5. # abs container name, required if you set resource.storage.type=ABS
  6. remote.logging.abs.container.name=<your-container-name>

注意事项

由于Azure Blob Storage不支持空目录单独存在,因此资源目录下会有空文件<no name>。但是并不影响Dolphinscheduler资源中心上的文件展示。