python – 使用AMQP和石墨9.9

我正在尝试使用内置于Graphite中的AMQP将RabbitMQ连接到Graphite.但是,当我取消注释carbon.conf中的设置时,我得到:

notroot@ubuntu:/opt/graphite/bin$sudo python carbon-cache.py start
Starting carbon-cache (instance a)
Traceback (most recent call last):
  File "carbon-cache.py", line 30, in <module>
    run_twistd_plugin(__file__)
  File "/opt/graphite/lib/carbon/util.py", line 92, in run_twistd_plugin
    runApp(config)
  File "/usr/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 386, in run
    self.application = self.createOrGetApplication()
  File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 446, in createOrGetApplication
    ser = plg.makeService(self.config.subOptions)
  File "/opt/graphite/lib/twisted/plugins/carbon_cache_plugin.py", line 21, in makeService
    return service.createCacheService(options)
  File "/opt/graphite/lib/carbon/service.py", line 115, in createCacheService
    root_service = createBaseService(config)
  File "/opt/graphite/lib/carbon/service.py", line 50, in createBaseService
    from carbon import amqp_listener
  File "/opt/graphite/lib/carbon/amqp_listener.py", line 29, in <module>
    from txamqp.protocol import AMQClient
ImportError: No module named txamqp.protocol

解决方法:

pip install txamqp

http://pypi.python.org/pypi/txAMQP

因为石墨碳中没有真正实现amqp
它使用txamqp

上一篇:Spring Bus 刷新配置 AMQP集群问题


下一篇:RabbitMq学习笔记——RabbitMQ C的使用