首页 > 解决方案 > 涌入 - 之前连接后刚开始出现“未找到授权”错误

问题描述

为 Influx 使用 Windows 可下载的 EXE。直到今天早上,连接和工作都很好。

influxd今天开始,我在控制台中看到:

c:\Influx>influxd
2021-06-10T06:21:49.336269Z     info    Welcome to InfluxDB     {"log_id": "0Ue9Baal000", "version": "2.0.7", "commit": "2a45f0c037", "build_date": "2021-06-04T19:17:40Z"}
2021-06-10T06:21:49.341178Z     info    Resources opened        {"log_id": "0Ue9Baal000", "service": "bolt", "path": "C:\\Users\\guyl\\.influxdbv2\\influxd.bolt"}
2021-06-10T06:21:49.355301Z     info    Checking InfluxDB metadata for prior version.   {"log_id": "0Ue9Baal000", "bolt_path": "C:\\Users\\guyl\\.influxdbv2\\influxd.bolt"}
2021-06-10T06:21:49.356219Z     info    Using data dir  {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\data"}
2021-06-10T06:21:49.356219Z     info    Compaction settings     {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "max_concurrent_compactions": 4, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2021-06-10T06:21:49.356219Z     info    Open store (start)      {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "op_name": "tsdb_open", "op_event": "start"}
2021-06-10T06:21:49.391834Z     info    index opened with 8 partitions  {"log_id": "0Ue9Baal000", "service": "storage-engine", "index": "tsi"}
2021-06-10T06:21:49.392819Z     info    index opened with 8 partitions  {"log_id": "0Ue9Baal000", "service": "storage-engine", "index": "tsi"}
2021-06-10T06:21:49.397817Z     info    Reading file    {"log_id": "0Ue9Baal000", "service": "storage-engine", "engine": "tsm1", "service": "cacheloader", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\wal\\3198a3a2f58ea23a\\autogen\\2\\_00001.wal", "size": 1401771}
2021-06-10T06:21:49.397817Z     info    Reading file    {"log_id": "0Ue9Baal000", "service": "storage-engine", "engine": "tsm1", "service": "cacheloader", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\wal\\3198a3a2f58ea23a\\autogen\\1\\_00001.wal", "size": 10498778}
2021-06-10T06:21:49.516021Z     info    Opened shard    {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "op_name": "tsdb_open", "index_version": "tsi1", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\data\\3198a3a2f58ea23a\\autogen\\2", "duration": "140.184ms"}
2021-06-10T06:21:50.165166Z     info    Reading file    {"log_id": "0Ue9Baal000", "service": "storage-engine", "engine": "tsm1", "service": "cacheloader", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\wal\\3198a3a2f58ea23a\\autogen\\1\\_00002.wal", "size": 2714197}
2021-06-10T06:21:50.356368Z     info    Opened shard    {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "op_name": "tsdb_open", "index_version": "tsi1", "path": "C:\\Users\\guyl\\.influxdbv2\\engine\\data\\3198a3a2f58ea23a\\autogen\\1", "duration": "980.511ms"}
2021-06-10T06:21:50.357325Z     info    Open store (end)        {"log_id": "0Ue9Baal000", "service": "storage-engine", "service": "store", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "1001.082ms"}
2021-06-10T06:21:50.359335Z     info    Starting retention policy enforcement service   {"log_id": "0Ue9Baal000", "service": "retention", "check_interval": "30m"}
2021-06-10T06:21:50.359335Z     info    Starting precreation service    {"log_id": "0Ue9Baal000", "service": "shard-precreation", "check_interval": "10m", "advance_period": "30m"}
2021-06-10T06:21:50.360336Z     info    Starting query controller       {"log_id": "0Ue9Baal000", "service": "storage-reads", "concurrency_quota": 1024, "initial_memory_bytes_quota_per_query": 9223372036854775807, "memory_bytes_quota_per_query": 9223372036854775807, "max_memory_bytes": 0, "queue_size": 1024}
2021-06-10T06:21:50.362322Z     info    Configuring InfluxQL statement executor (zeros indicate unlimited).     {"log_id": "0Ue9Baal000", "max_select_point": 0, "max_select_series": 0, "max_select_buckets": 0}
2021-06-10T06:21:50.684777Z     info    Starting        {"log_id": "0Ue9Baal000", "service": "telemetry", "interval": "8h"}
2021-06-10T06:21:50.684777Z     info    Listening       {"log_id": "0Ue9Baal000", "service": "tcp-listener", "transport": "http", "addr": ":8086", "port": 8086}
2021-06-10T06:21:57.610274Z     info    Unauthorized    {"log_id": "0Ue9Baal000", "error": "authorization not found"}
2021-06-10T06:22:07.611932Z     info    Unauthorized    {"log_id": "0Ue9Baal000", "error": "authorization not found"}
2021-06-10T06:22:17.616794Z     info    Unauthorized    {"log_id": "0Ue9Baal000", "error": "authorization not found"}
2021-06-10T06:22:27.630195Z     info    Unauthorized    {"log_id": "0Ue9Baal000", "error": "authorization not found"}
2021-06-10T06:22:37.643137Z     info    Unauthorized    {"log_id": "0Ue9Baal000", "error": "authorization not found"}

首先我想可能是因为我的 influx.conf 文件有一个过时的令牌,所以我更新了它:

[default]
  url = "http://localhost:8086"
  token = "my updated token=="
  org = "My company name"
  active = true

我又试influxd了一次,但我得到了同样的结果。

我从 Admin DOS shell 运行。

数据库正在运行,因为我可以登录网站,但似乎我无法访问我的存储桶:

在此处输入图像描述

这是我的两个令牌: 在此处输入图像描述

“负载测试员的令牌”对所有内容都有读/写,就像我创建它一样。
在此处输入图像描述

这是我放入influx.conf文件中的令牌。(它改变了,出于某种原因。)

我的load_bucket保留期现在是 1 年。我尝试将其更改为永远,但即使我保存更改,它也会保留 1 年。

我还尝试创建一个新存储桶并从脚本写入,但脚本无法连接。

标签: authorizationinfluxdbbucketinfluxdb-2

解决方案


您可以按照以下步骤操作:

  1. 执行以下命令以检查您是否可以访问auth列表并查看所有令牌列表以及您是否具有读写权限:
    influx.exe auth list
    您也可以在仪表板中查看: 在此处输入图像描述
  2. 如果您看不到令牌,那么您可以生成具有读/写或所有访问权限的令牌。 在此处输入图像描述

3. 也可能发生您选择的保留期必须已经结束,因此没有可用的测量数据。4. 您可以创建一个新的存储桶并添加您在上述步骤中创建的令牌:

influx.exe bucket create --name <Nameofyourdb> --org <Organistaion name> --description <"Your description"> --token <token string>
  1. 写下你的测量数据:
influx.exe write --bucket <Nameofyourdb> --host http://localhost:8086 "m,host=host1 field1=1.2"

推荐阅读