首页 > 解决方案 > 无法通过 influx CLI 工具连接到 influxd

问题描述

我在我的 CentOS 8.2 服务器中安装了 influx。

[root@dele opt]# influxd version
InfluxDB 2.0.2 (git: 84496e507a) build_date: 2020-11-19T03:59:35Z
[root@dele opt]# influx version
Influx CLI 2.0.2 (git: 84496e507a) build_date: 2020-11-19T03:59:35Z

我开始涌入:

influxd &

在那里听 8086。

tcp6       0      0 :::8086                 :::*                    LISTEN 

但我无法连接到 influxd:

[root@fastnetmon opt]# influx -host localhost -p 8086
Error: unknown shorthand flag: 'o' in -ost
See 'influx -h' for help
[root@fastnetmon opt]# influx --host localhost --p 8086
Error: unknown flag: --host
See 'influx -h' for help

也不是通过命令:

[root@dele opt]# /usr/bin/influx -precision rfc3339
Error: unknown shorthand flag: 'p' in -precision

标签: influxdbinfluxdb-2

解决方案


经过一段时间的努力,我验证了2.0版本不支持这些命令。
如果是 2.0 版本,您可以在“数据资源管理器部分”的 influxdb 中执行查询。在 2.0 版本中,您拥有类似于数据库的存储桶,您可以从 cli 创建它们,如下例所示:

influx bucket create -n <bucketname> --org-id <Organisation ID> -r 10h -t <your token>

令牌是从 influxdb 的主页生成的,您可以从该主页访问 InfluxDB 2.0 实例的每个部分。
您可以从此处访问您的组织、仪表板和文档。


推荐阅读