(1)python环境问题
报错:pythonjar包无法执行
spark-submit \
--deploy-mode cluster \
--master yarn \
--queue risk \
--driver-memory 4g \
--num-executors 2 \
--executor-memory 4g \
--executor-cores 4 \
--name sms_back \
--archives obs://africa-sa-risk-devops/python/back_env.zip#back_env \
--conf spark.pyspark.driver.python=./back_env/back_env/bin/python3 \
--conf spark.pyspark.python=./back_env/back_env/bin/python3 \
--conf spark.yarn.maxAppAttempts=1 \
--py-files obs://africa-sa-risk-devops/python/ng_risk_core.zip \
/home/sms_seach_back.py
注意在打包python依赖时必须在相应环境中打包
(2)net.razorvine.pickle.PickleException: expected zero arguments for construction of ClassDict (for numpy.dtype)
由于python脚本中使用
ret = ret.dtype.type(ret / rcount)
解决方案:
float(retval)