(本文不定期更新)
目录
二、指定虚拟python环境的python类型任务的执行时环境变量问题
一、租户问题
本人使用环境是大家分别使用自己账户登录跳板机,然后共同使用同一个服务器linux账户进行工作,所以不涉及多个linux用户的切换问题(即dolphinscheduler的多租户)。但是共用账户本身没有root权限,需要找运维申请,但是权限时间有限。故在部署的时候就不使用root权限账户,而直接使用共用账户部署。然后下载源码后,将涉及“sudo -u”相关的命令注释掉或者改写,从而实现正常使用。
二、指定虚拟python环境的python类型任务的执行时环境变量问题
因为某些特殊任务需要使用虚拟python环境,独立进行worker分组,并指定该环境为dolphinscheduler-env.sh的PYTHON_HOME。但是在执行的时候,出现了报错:
找不到JAVA_HOME,这个是使用pyflink的时候,由pyflink在创建执行环境的时候报的错:
s_env = StreamExecutionEnvironment.get_execution_environment()
将该代码注释掉,加入代码:
import os
print('os的环境变量有:',os.system('env'))
查看到该次执行的JAVA_HOME为空:
但是dolphinscheduler-env.sh命名设置了JAVA_HOME,重启worker-server也不生效。
最终解决:设置该用户的环境变量(修改全局环境变量有风险,只修改该用户的即可)
vim ~/.bashrc
export JAVA_HOME=/usr
export PATH=$JAVA_HOME/bin:$PATH
因为使用which java是能够在/usr/bin目录找到可执行java的,所以只设置为/usr即可。
三、资源中心创建目录或者文件失败
api-server报的错,查看日志:
### The error occurred while setting parameters
### SQL: INSERT INTO t_ds_resources ( file_name, size, create_time, description, full_name, alias, update_time, pid, type, user_id, is_directory ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: column "is_directory" is of type integer but expression is of type boolean
Hint: You will need to rewrite or cast the expression.
Position: 192
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: column "is_directory" is of type integer but expression is of type boolean
Hint: You will ne