GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing dolphinscheduler.apache.org — Configuration — apache-dolphinscheduler 4.1.0-dev documentation Configurationpydolphinscheduler has a built-in module setting necessary configuration to start and run your workflow code. You could directly use them if you only want to run a quick start or for a simple job like POC. But if you want to deep use pydolphinscheduler and even use it in production. You should probably need to modify and change the built-in configuration. We have two ways to modify the configuration:
Using Environment VariablesYou could change the configuration by adding or modifying the operating system’s environment variables. No matter what way you used, as long as you can successfully modify the environment variables. We use two common ways, Bash and Python OS Module, as examples: By BashSetting environment variables via Bash is the most straightforward and easiest way. We give some examples about how to change them by Bash. # Modify Java Gateway Address export PYDS_JAVA_GATEWAY_ADDRESS="192.168.1.1" # Modify Workflow Default User export PYDS_WORKFLOW_USER="custom-user" After executing the commands above, both By Python OS Modulepydolphinscheduler is a Python API for Apache DolphinScheduler, and you could modify or add system environment
variables via Python import os # Modify Java Gateway Address os.environ["PYDS_JAVA_GATEWAY_ADDRESS"] = "192.168.1.1" # Modify Workflow Default User os.environ["PYDS_WORKFLOW_USER"] = "custom-user" All Configurations in Environment VariablesAll environment variables as below, and you could modify their value via Bash or Python OS Module
Note The scope of setting configuration via environment variable is in the workflow, and it will not change the
value of the configuration file. The CLI command Using Configuration FileIf you want to persist and manage configuration in a file instead of environment variables, or maybe you want want to save your configuration file to a version control system, like Git or SVN, and the way to change configuration by file is the best choice. Export Configuration Filepydolphinscheduler allows you to change the built-in configurations via CLI or editor you like. pydolphinscheduler integrated built-in configurations in its package, but you could also export it locally by CLI pydolphinscheduler config --init And it will create a new YAML file in the path ~/pydolphinscheduler/config.yaml by default. If you want to export
it to another path, you should set PYDS_HOME before you run command export PYDS_HOME=<CUSTOM_PATH> pydolphinscheduler config --init After that, your configuration file will export into <CUSTOM_PATH>/config.yaml instead of the default path. Change ConfigurationIn section export configuration file you export the configuration file locally, and as a local file, you could edit it with any editor you like. After you save your change in your editor, the latest configuration will work when you run your workflow code. You could also query or change the configuration via CLI # Get single configuration in the leaf node, # The output look like below: # java_gateway.address = 127.0.0.1 pydolphinscheduler config --get java_gateway.address # Get multiple configuration in the leaf node, # The output look like below: # java_gateway.address = 127.0.0.1 # java_gateway.port = 25333 pydolphinscheduler config --get java_gateway.address --get java_gateway.port # Get parent configuration which contain multiple leaf nodes, # The output look like below: # java_gateway = ordereddict([('address', '127.0.0.1'), ('port', 25333), ('auto_convert', True)]) pydolphinscheduler config --get java_gateway # Set single configuration, # The output look like below: # Set configuration done. pydolphinscheduler config --set java_gateway.address 192.168.1.1 # Set multiple configuration # The output look like below: # Set configuration done. pydolphinscheduler config --set java_gateway.address 192.168.1.1 --set java_gateway.port 25334 # Set configuration not in leaf node will fail # The output look like below: # Raise error. pydolphinscheduler config --set java_gateway 192.168.1.1,25334,True For more information about our CLI, you could see document Command Line Interface. All Configurations in FileHere are all our configurations for pydolphinscheduler. # Setting about Java gateway server java_gateway: # Authentication token for connection from python api to python gateway server. Should be changed the default value # when you deploy in public network. auth_token: jwUDzpLsNKEFER4*a8gruBH_GsAurNxU7A@Xc # The address of Python gateway server start. Set its value to `0.0.0.0` if your Python API run in different # between Python gateway server. It could be be specific to other address like `127.0.0.1` or `localhost` address: 127.0.0.1 # The port of Python gateway server start. Define which port you could connect to Python gateway server from # Python API models. port: 25333 # Whether automatically convert Python objects to Java Objects. Default value is ``True``. There is some # performance lost when set to ``True`` but for now pydolphinscheduler do not handle the convert issue between # java and Python, mark it as TODO item in the future. auto_convert: true # Setting about dolphinscheduler default value, will use the value set below if property do not set, which # including ``user``, ``workflow`` default: # Default value for dolphinscheduler's user object user: name: userPythonGateway password: userPythonGateway email: [email protected] tenant: tenant_pydolphin phone: 11111111111 state: 1 # Default value for dolphinscheduler's workflow object workflow: project: project-pydolphin user: userPythonGateway queue: queuePythonGateway worker_group: default # Release state of workflow, default value is ``online`` which mean setting workflow online when it submits # to Java gateway, if you want to set workflow offline set its value to ``offline`` release_state: online time_zone: Asia/Shanghai # Warning type of the workflow, default value is ``NONE`` mean do not warn user in any cases of workflow state, # change to ``FAILURE`` if you want to warn users when workflow failed. All available enum value are # ``NONE``, ``SUCCESS``, ``FAILURE``, ``ALL`` warning_type: NONE # Default execution type about how to run multiple workflow instances, default value is ``parallel`` which # mean run all workflow instances parallel and the other value is ``SERIAL_WAIT``, ``SERIAL_DISCARD``, ``SERIAL_PRIORITY`` execution_type: parallel PriorityWe have two ways to modify the configuration and there is a built-in config in pydolphinscheduler too. It is very important to understand the priority of the configuration when you use them. The overview of configuration priority is.
This means that your setting in environment variables or configurations file will overwrite the built-in one. And you could temporarily modify configurations by setting environment variables without modifying the global config in the configuration file. | ||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |