ran9nar
ran9nar
2016-05-11 05:19
采纳率: 71.4%
浏览 1.2k
已采纳

pyleus 无法将结果写入MySQL数据库

我在requirements.txt文件中写了MySQLdb的库MySQL-python,并且拓扑能够被顺利的build生成jar包,但是当我把jar
包提交以后,出现如下错误信息:

 11814 [Thread-12-result-count] ERROR backtype.storm.daemon.executor - 
java.lang.RuntimeException: Error when launching multilang subprocess
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/e16601e5-a293-4233-bb9e-0e68090a44d6/supervisor/stormdist/association-miner-1-1462975821/resources/association-miner/result.py", line 2, in <module>
    import MySQLdb
ImportError: No module named MySQLdb


我的yaml文件配置如下:

name: association-miner

topology:

- spout:
    name: trans-spout
    module: association-miner.spout

- bolt:
    name: mining
    module: association-miner.mining
    parallelism_hint: 3
    groupings:
        - shuffle_grouping: trans-spout

- bolt:
    name: result-count
    module: association-miner.result
    groupings:
        - global_grouping: mining
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • ran9nar
    ran9nar 2016-05-11 10:11
    已采纳

    问题已解决除了在requirements.txt中写‘MySQL-python’,在集群各个节点上也要安装MySQL-python

    点赞 评论

相关推荐