2 ran9nar ran9nar 于 2016.05.11 13:19 提问

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 18:11
已采纳

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

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!