import os

l = ['ssh a;scp /data/visitlog/*11* root@d:/data/mapReduceVisitorLog/'] # b c
for i in l:
os.system(i)



在执行py脚本前,配置好了免密登录;
python this_.py
成功登录到a服务器,但是剩下的不能执行;


实现思路:
事件触发机制;
各个节点 http 监听;收到后执行命令;




import os

sh_, nodes = 'ssh A "scp /data/visitlog/* root@d:/data/mapReduceVisitorLog/A/"', ['a', 'b', 'c']

for i in nodes:
s = sh_.replace('A', i)
os.system(s)



python 执行 python 文件
import os

sh_, nodes = 'ssh A "scp /data/visitlog/* root@d:/data/mapReduceVisitorLog/A/"', ['a', 'b', 'c']

for i in nodes:
s = sh_.replace('A', i)
os.system(s)

os.system('python mapReduceBatchDeleteLoopDate20180101-20200101.py')
os.system('python mapReduceBatchDeleteLoopDateDealLog20180101-20200101.py')






相关文章:

  • 2021-10-02
  • 2021-12-21
  • 2021-12-24
  • 2022-12-23
  • 2021-07-22
  • 2022-02-05
  • 2021-12-04
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案