uwsgi vassal魔法变量

时间:2013-11-21 11:59:27

标签: django uwsgi graphite graphite-carbon

我在皇帝模式下运行uwsgi 1.9.20并将所有封臣的统计数据发送到碳/石墨服务器。看起来不错,除了%n魔术变量不会返回docs中指定的“没有扩展名的文件名”,而是返回套接字设置,例如127_0_0_1:14002。或者至少这是我在石墨中看到的。

# uwsgi.ini
[uwsgi]
emperor = /usr/local/uwsgi/vassals/
emperor-tyrant = 1 
vacuum = 1
carbon = 172.12.2.4:2003
carbon-id = %n
# settings to apply to all vassals
vassal-set = plugin-dir=/usr/local/uwsgi/plugins 
vassal-set = enable-metrics=1 
vassal-set = carbon=172.12.2.4:2003
vassal-set = plugins=carbon
vassal-set = carbon-use-metrics=1

皇帝开始于:

uwsgi --ini /usr/local/uwsgi/uwsgi.ini

示例vassal配置:

# bob.xml
<uwsgi>
    <pidfile>/home/bob/bob.pid</pidfile>
    <socket>127.0.0.1:14002</socket>
    <protocol>scgi</protocol>
    <pythonpath>/home/bob/pybin/bob</pythonpath>
    <virtualenv>/home/bob/pybin/bob-venv</virtualenv>
    <module>bob.wsgi</module>
    <workers>3</workers>
    <procname-prefix>bob: </procname-prefix>
    <buffer-size>8192</buffer-size>
    <daemonize>/home/bob/logs/bob.log</daemonize>
    <disable-logging />
    <master />
    <vacuum />
</uwsgi>

我也试过了vassal-set = carbon-id=%n,但在石墨中只显示uwsgi。我在这里使用魔法变量做错了什么?

在CentOS 6.4上,FYI Python版本为2.7.3。

1 个答案:

答案 0 :(得分:2)

碳指标名称构建为:

carbon-root.hostname.carbon-id

因此您需要同时设置carbon-rootcarbon-id