我正在尝试使用我找到的 influxdb-python 库here https://github.com/influxdata/influxdb-python。但我什至无法让教程程序运行。
当我运行以下示例代码时:
$ python
>>> from influxdb import InfluxDBClient
>>> json_body = [
{
"measurement": "cpu_load_short",
"tags": {
"host": "server01",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
}
]
>>> client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
>>> client.create_database('example')
我在最后一行收到此错误消息:
>>> client.create_database('example')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 318, in create_database
status_code=201
File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 124, in request
raise InfluxDBClientError(response.content, response.status_code)
influxdb.client.InfluxDBClientError: 404: 404 page not found
我安装的版本:
pi@raspberrypi:~ $ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.9.6.1
InfluxDB shell 0.9.6.1
如果有人能指出我的问题,那就太好了。
UPDATE
也许这很有帮助。我与 Jessie 一起使用 Raspberry Pi 3,并使用此教程安装了 influxdblink http://padcom13.blogspot.co.at/2015/12/influxdb-telegraf-and-grafana-on.html
UPDATE 2
如果我跑curl http://localhost:8086
我也得到 404 页面未找到。在端口 8083 上我得到了响应。