【发布时间】:2016-04-25 17:14:17
【问题描述】:
我正在尝试使用我发现 here 的 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
如果有人能在这里指出我的问题,那就太好了。
更新
也许这会有所帮助。我和 Jessie 一起在 Raspberry Pi 3 上,并用这个教程安装了 influxdb link
更新 2
如果我运行curl http://localhost:8086,我也会得到 404 页面未找到。在端口 8083 上,我得到了响应。
【问题讨论】: