简体   繁体   English

无法使用 influxdb docker 映像中的“Influx”命令访问或创建数据库

[英]Unable to access or create database using the 'Influx' command in influxdb docker image

I've created a container and executed it for influxdb.我创建了一个容器并为 influxdb 执行它。 Now as the previous versions we could access the databases by going inside the influx shell with influx command.现在作为以前的版本,我们可以通过使用 influx 命令进入 influx shell 来访问数据库。 But when I type the influx command I get list of help command.但是当我输入 influx 命令时,我会得到帮助命令列表。 Any one here has an idea how to create database in influxdb 2.x inside docker container.这里的任何人都知道如何在 docker 容器内的 influxdb 2.x 中创建数据库。 在此处输入图像描述

influxdb 2.0 is very different from 1.x. influxdb 2.0 与 1.x 非常不同。 databases don't exist anymore, they are named buckets now... There is a whole page explaining the different ways in which you can create a bucket in influxdb 2.0. databases不再存在,它们现在被命名为buckets ......有一整页解释了在 influxdb 2.0 中创建存储桶的不同方法。 Look specially at sections IV and V.特别看第四节和第五节。

In short there are two alternatives:简而言之,有两种选择:

  • using the cli: influx bucket create -n <bucketname> --org-id <org-id> -r 10h -t <secret-token> .使用 cli: influx bucket create -n <bucketname> --org-id <org-id> -r 10h -t <secret-token> Read further on the page on how to get your org id and token.在页面上进一步阅读有关如何获取您的组织 ID 和令牌的信息。
  • use the UI (located at http://localhost:9999 by default)使用 UI(默认位于 http://localhost:9999)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM