HDFS Resource Configuration

When it is necessary to use the Resource Center to create or upload relevant files, all files and resources will be stored on HDFS. Therefore the following configuration is required.

Local File Resource Configuration

For a single machine, you can choose to use local file directory as the upload directory (no need to deploy Hadoop) by making the following configuration.

Configuring the common.properties

Configure the file in the following paths: api-server/conf/common.properties and worker-server/conf/common.properties.

  • Change data.basedir.path to the local directory path. Please make sure the user who deploy dolphinscheduler have read and write permissions, such as: data.basedir.path=/tmp/dolphinscheduler. And the directory you configured will be auto-created if it does not exists.
  • Modify the following two parameters, resource.storage.type=HDFS and resource.hdfs.fs.defaultFS=file:///.

Configuring the common.properties

After version 3.0.0, if you want to upload resources using HDFS or S3 from the Resource Center, you will need to configure the following paths The following paths need to be configured: api-server/conf/common.properties and worker-server/conf/common.properties. This can be found as follows.

  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. # user data local directory path, please make sure the directory exists and have read write permissions
  18. data.basedir.path=/tmp/dolphinscheduler
  19. # resource view suffixs
  20. #resource.view.suffixs=txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js
  21. # resource storage type: HDFS, S3, NONE
  22. resource.storage.type=NONE
  23. # resource store on HDFS/S3 path, resource file will store to this base path, self configuration, please make sure the directory exists on hdfs and have read write permissions. "/dolphinscheduler" is recommended
  24. resource.storage.upload.base.path=/dolphinscheduler
  25. # The AWS access key. if resource.storage.type=S3 or use EMR-Task, This configuration is required
  26. resource.aws.access.key.id=minioadmin
  27. # The AWS secret access key. if resource.storage.type=S3 or use EMR-Task, This configuration is required
  28. resource.aws.secret.access.key=minioadmin
  29. # The AWS Region to use. if resource.storage.type=S3 or use EMR-Task, This configuration is required
  30. resource.aws.region=cn-north-1
  31. # The name of the bucket. You need to create them by yourself. Otherwise, the system cannot start. All buckets in Amazon S3 share a single namespace; ensure the bucket is given a unique name.
  32. resource.aws.s3.bucket.name=dolphinscheduler
  33. # You need to set this parameter when private cloud s3. If S3 uses public cloud, you only need to set resource.aws.region or set to the endpoint of a public cloud such as S3.cn-north-1.amazonaws.com.cn
  34. resource.aws.s3.endpoint=http://localhost:9000
  35. # if resource.storage.type=HDFS, the user must have the permission to create directories under the HDFS root path
  36. resource.hdfs.root.user=hdfs
  37. # if resource.storage.type=S3, the value like: s3a://dolphinscheduler; if resource.storage.type=HDFS and namenode HA is enabled, you need to copy core-site.xml and hdfs-site.xml to conf dir
  38. resource.hdfs.fs.defaultFS=hdfs://mycluster:8020
  39. # whether to startup kerberos
  40. hadoop.security.authentication.startup.state=false
  41. # java.security.krb5.conf path
  42. java.security.krb5.conf.path=/opt/krb5.conf
  43. # login user from keytab username
  44. login.user.keytab.username=hdfs-mycluster@ESZ.COM
  45. # login user from keytab path
  46. login.user.keytab.path=/opt/hdfs.headless.keytab
  47. # kerberos expire time, the unit is hour
  48. kerberos.expire.time=2
  49. # resourcemanager port, the default value is 8088 if not specified
  50. resource.manager.httpaddress.port=8088
  51. # if resourcemanager HA is enabled, please set the HA IPs; if resourcemanager is single, keep this value empty
  52. yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx
  53. # if resourcemanager HA is enabled or not use resourcemanager, please keep the default value; If resourcemanager is single, you only need to replace ds1 to actual resourcemanager hostname
  54. yarn.application.status.address=http://ds1:%s/ws/v1/cluster/apps/%s
  55. # job history status url when application number threshold is reached(default 10000, maybe it was set to 1000)
  56. yarn.job.history.status.address=http://ds1:19888/ws/v1/history/mapreduce/jobs/%s
  57. # datasource encryption enable
  58. datasource.encryption.enable=false
  59. # datasource encryption salt
  60. datasource.encryption.salt=!@#$%^&*
  61. # data quality option
  62. data-quality.jar.name=dolphinscheduler-data-quality-dev-SNAPSHOT.jar
  63. #data-quality.error.output.path=/tmp/data-quality-error-data
  64. # Network IP gets priority, default inner outer
  65. # Whether hive SQL is executed in the same session
  66. support.hive.oneSession=false
  67. # use sudo or not, if set true, executing user is tenant user and deploy user needs sudo permissions; if set false, executing user is the deploy user and doesn't need sudo permissions
  68. sudo.enable=true
  69. # network interface preferred like eth0, default: empty
  70. #dolphin.scheduler.network.interface.preferred=
  71. # network IP gets priority, default: inner outer
  72. #dolphin.scheduler.network.priority.strategy=default
  73. # system env path
  74. #dolphinscheduler.env.path=dolphinscheduler_env.sh
  75. # development state
  76. development.state=false
  77. # rpc port
  78. alert.rpc.port=50052
  79. # Url endpoint for zeppelin RESTful API
  80. zeppelin.rest.url=http://localhost:8080
  81. # set path of conda.sh
  82. conda.path=/opt/anaconda3/etc/profile.d/conda.sh
  83. # Task resource limit state
  84. task.resource.limit.state=false

Note:

  • If only the api-server/conf/common.properties file is configured, then resource uploading is enabled, but you can not use resources in task. If you want to use or execute the files in the workflow you need to configure worker-server/conf/common.properties too.
  • If you want to use the resource upload function, the deployment user in installation and deployment must have relevant operation authority.
  • If you using a Hadoop cluster with HA, you need to enable HDFS resource upload, and you need to copy the core-site.xml and hdfs-site.xml under the Hadoop cluster to worker-server/conf and api-server/conf, otherwise skip this copy step.