为什么cnosdb集群无法初始化默认租户?

huangapple go评论47阅读模式
英文:

Why does cnosdb cluster failed to initialize the default tenants?

问题

我正在尝试在我的个人电脑上运行CnosDB集群模式,但它在启动时崩溃并抛出错误:make dbms: Meta { source: TenantNotFound { tenant: "cnosdb" } },似乎无法初始化默认租户。

版本:cnosdb 2.3.0,修订版本 f4b52408171467c5ea2b2f75480deecc6f6ad733

配置

我有这两个配置:

节点 - meta_1

用于 meta 节点的配置:

  • 服务地址:127.0.0.1:8901
id = 1
host = "127.0.0.1"
port = 8901

snapshot_path = "/tmp/meta_1/snapshot"
journal_path = "/tmp/meta_1/journal"
snapshot_per_events = 500

[log]
level = "info"
path = "/tmp/meta_1/logs"

[meta_init]
cluster_name = "meta_1"
admin_user = "root"
system_tenant = "cnosdb"
default_database = ["public", "usage_schema"]

[heartbeat]
heartbeat_recheck_interval = 300
heartbeat_expired_interval = 600

节点 - data_1

用于 data 节点的配置:

  • 服务地址:127.0.0.1:8912
host = '127.0.0.1'

[cluster]
name = 'data_1'
http_listen_port = 8912
grpc_listen_port = 8913
flight_rpc_listen_port = 8914
tcp_listen_port = 8915
meta_service_addr = ['127.0.0.1:8901']

[node_basic]
node_id = 1
cold_data_server = false
store_metrics = true

[deployment]
mode = 'query_tskv'
[query]
[storage]
path = '/tmp/data_1/data'
[wal]
path = '/tmp/data_1/wal'
[cache]
[log]
level = 'info'
path = '/tmp/data_1/wal'
[security]
[hinted_off]
[heartbeat]

命令和输出

## 清理
$ rm -rf /tmp/test/*

## 运行 `cnosdb-meta`
$ cnosdb-meta --config ./meta_1.toml
..........

## 初始化 cnosdb-meta 为集群
$ curl http://127.0.0.1:8901/init -d '{}'
{"Ok":null}

## 运行 `cnosdb`
$ cnosdb run --config data_1.toml
.........
2023-05-29T00:36:19.264002000+08:00  INFO tskv::wal: WAL '1' starts write
2023-05-29T00:36:19.264278000+08:00  WARN tskv::wal: Recover: reading wal from seq '0'
2023-05-29T00:36:19.264431000+08:00  INFO tskv::kvcore: Job 'WAL' starting.
2023-05-29T00:36:19.264463000+08:00  INFO tskv::kvcore: Flush task handler started
2023-05-29T00:36:19.264510000+08:00  INFO tskv::kvcore: Job 'WAL' started.
2023-05-29T00:36:19.264742000+08:00  INFO tskv::kvcore: Summary task handler started
应用程序发生了崩溃。
消息:make dbms: Meta { source: TenantNotFound { tenant: "cnosdb" } }
位置:main/src/server.rs:246

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 调用堆栈 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10 个隐藏的帧 ⋮
  11: cnosdb::server::ServiceBuilder::create_dbms::{{closure}}::h1aef1bae443f563d
      在 <未知源文件>:<未知行数>
  12: cnosdb::server::ServiceBuilder::build_query_storage::{{closure}}::h778497860af930a7
      在 <未知源文件>:<未知行数>
  13: cnosdb::main::{{closure}}::hd08bd0324e3b1f23
      在 <未知源文件>:<未知行数>
  14: cnosdb::main::h4f1efcc4db9ef8ea
      在 <未知源文件>:<未知行数>
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::hf3cbd67dc5a868f8
      在 <未知源文件>:<未知行数>
  16: std::rt::lang_start::{{closure}}::h76d82e46c7eb707c
      在 <未知源文件>:<未知行数>
  17: std::rt::lang_start_internal::h672762ded3eb0218
      在 <未知源文件>:<未知行数>
  18: _main<unknown>
      在 <未知源文件>:<未知行数>

我刚刚检查了配置,并确保 meta_1127.0.0.1:8901 上监听,并且 data_1 正在连接到 127.0.0.1:8901,但我对输出消息感到困惑。

英文:

I'm trying to run CnosDB cluster mode on my PC, but it crushed on start and throw an error: make dbms: Meta { source: TenantNotFound { tenant: &quot;cnosdb&quot; } }, seems failed initializing the default tenant.

> Version: cnosdb 2.3.0, revision f4b52408171467c5ea2b2f75480deecc6f6ad733

Configurations

I have these two configurations:

Node - meta_1

Config for meta node:

  • service-addr: 127.0.0.1:8901
id = 1
host = &quot;127.0.0.1&quot;
port = 8901

snapshot_path = &quot;/tmp/meta_1/snapshot&quot;
journal_path = &quot;/tmp/meta_1/journal&quot;
snapshot_per_events = 500

[log]
level = &quot;info&quot;
path = &quot;/tmp/meta_1/logs&quot;

[meta_init]
cluster_name = &quot;meta_1&quot;
admin_user = &quot;root&quot;
system_tenant = &quot;cnosdb&quot;
default_database = [&quot;public&quot;, &quot;usage_schema&quot;]

[heartbeat]
heartbeat_recheck_interval = 300
heartbeat_expired_interval = 600

Node - data_1

Config for data node:

  • service-addr: 127.0.0.1:8912
host = &#39;127.0.0.1&#39;

[cluster]
name = &#39;data_1&#39;
http_listen_port = 8912
grpc_listen_port = 8913
flight_rpc_listen_port = 8914
tcp_listen_port = 8915
meta_service_addr = [&#39;127.0.0.1:8901&#39;]

[node_basic]
node_id = 1
cold_data_server = false
store_metrics = true

[deployment]
mode = &#39;query_tskv&#39;
[query]
[storage]
path = &#39;/tmp/data_1/data&#39;
[wal]
path = &#39;/tmp/data_1/wal&#39;
[cache]
[log]
level = &#39;info&#39;
path = &#39;/tmp/data_1/wal&#39;
[security]
[hinted_off]
[heartbeat]

Commands and outputs

## Clean
$ rm -rf /tmp/test/*

## Run `cnosdb-meta`
$ cnosdb-meta --config ./meta_1.toml
.........

## Init cnosdb-meta as a cluster
$ curl http://127.0.0.1:8901/init -d &#39;{}&#39;
{&quot;Ok&quot;:null}

## Run `cnosdb`
$ cnosdb run --config data_1.toml
.........
2023-05-29T00:36:19.264002000+08:00  INFO tskv::wal: WAL &#39;1&#39; starts write
2023-05-29T00:36:19.264278000+08:00  WARN tskv::wal: Recover: reading wal from seq &#39;0&#39;
2023-05-29T00:36:19.264431000+08:00  INFO tskv::kvcore: Job &#39;WAL&#39; starting.
2023-05-29T00:36:19.264463000+08:00  INFO tskv::kvcore: Flush task handler started
2023-05-29T00:36:19.264510000+08:00  INFO tskv::kvcore: Job &#39;WAL&#39; started.
2023-05-29T00:36:19.264742000+08:00  INFO tskv::kvcore: Summary task handler started
The application panicked (crashed).
Message:  make dbms: Meta { source: TenantNotFound { tenant: &quot;cnosdb&quot; } }
Location: main/src/server.rs:246

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 10 frames hidden ⋮
  11: cnosdb::server::ServiceBuilder::create_dbms::{{closure}}::h1aef1bae443f563d
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  12: cnosdb::server::ServiceBuilder::build_query_storage::{{closure}}::h778497860af930a7
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  13: cnosdb::main::{{closure}}::hd08bd0324e3b1f23
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  14: cnosdb::main::h4f1efcc4db9ef8ea
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::hf3cbd67dc5a868f8
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  16: std::rt::lang_start::{{closure}}::h76d82e46c7eb707c
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  17: std::rt::lang_start_internal::h672762ded3eb0218
      at &lt;unknown source file&gt;:&lt;unknown line&gt;
  18: _main&lt;unknown&gt;
      at &lt;unknown source file&gt;:&lt;unknown line&gt;

I‘ve just checked the configurations and i've made sure that the meta_1 listens on 127.0.0.1:8901 and, the data_1 is connecting to 127.0.0.1:8901, but I'm puzzled by the output messages.

答案1

得分: 2

在datanoe的配置文件中,确保在[cluster]部分的name='data_1'和[meta_init]部分的cluster_name="meta_1"两者的名称相同。否则,它将将它们视为两个独立的集群。

英文:

In the configuration file of datanoe, ensure that the name in both [cluster] section with name='data_1' and [meta_init] section with cluster_name="meta_1" are the same. Otherwise, it will consider them as two separate clusters.

huangapple
  • 本文由 发表于 2023年5月29日 01:02:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76352613.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定