【问题标题】:Getting RabbitMQ and Graphite to connect让 RabbitMQ 和 Graphite 连接起来
【发布时间】:2026-01-09 10:55:01
【问题描述】:

我正在尝试使用 https://github.com/somic/graphite-rabbitmq 将 RabbitMQ 连接到 Graphite(0.9.9) 但是,我不完全确定应该放置 Graphite 中的哪个目录 Graphite-rabbitmq 文件。

当我运行carbon-agent-rabbitm1.py 时,我得到了

Failed to import the graphite package. Please verify that this package
was properly installed and that your PYTHONPATH environment variable
includes the directory in which it is installed.

For example, you may need to run the following command:

export PYTHONPATH="/home/myusername/lib/python/:$PYTHONPATH"

非常感谢您的帮助

【问题讨论】:

    标签: python django rabbitmq graphite


    【解决方案1】:

    python 模块的约定,你可以把下载的文件放在任意临时目录,cd 到那个目录,然后运行:

    python setup.py install
    

    标准的distutils 包将确保一切都到达正确的位置。

    您可能还想下载pip,它将为您管理下载和安装这些软件包的过程,在这种情况下,您只需键入:

    pip install graphite-web
    

    但除此之外,您真的可以将文件放在任何地方,只要您将目录添加到名为 PYTHONPATH 的环境变量中,就像您引用的错误消息所说的那样。

    【讨论】:

      【解决方案2】:

      除非您有使用该 github 存储库中的脚本的特定原因,否则我不会,因为它们似乎已经有 3 年历史了,并且石墨现在通过 Twisted Python AMQP 库 (txamqp) 支持 RabbitMQ ),这使得这些脚本完全没有必要。

      【讨论】:

        最近更新 更多