有时需要在airflow中运行如sshpass远程免密登录调度指令的

所需元素 

1、包:from airflow.contrib.operators.ssh_operator import SSHOperator

2、bash

sh_bash = '''


sshpass -p ‘XXXXXX’ ssh XXXXX@IP  'bash XX.sh'

'''

3、operator

XXXXXX_operator = SSHOperator(

task_id='XXXXXX',

command=sh_bash,

ssh_conn_id='XXXXXXX',

dag=dag)

相关文章:

  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-11-20
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案