英文:
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_1
在 127.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: "cnosdb" } }
, 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 = "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
Node - data_1
Config for data node:
- service-addr: 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]
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 '{}'
{"Ok":null}
## Run `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
The application panicked (crashed).
Message: make dbms: Meta { source: TenantNotFound { tenant: "cnosdb" } }
Location: main/src/server.rs:246
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 10 frames hidden ⋮
11: cnosdb::server::ServiceBuilder::create_dbms::{{closure}}::h1aef1bae443f563d
at <unknown source file>:<unknown line>
12: cnosdb::server::ServiceBuilder::build_query_storage::{{closure}}::h778497860af930a7
at <unknown source file>:<unknown line>
13: cnosdb::main::{{closure}}::hd08bd0324e3b1f23
at <unknown source file>:<unknown line>
14: cnosdb::main::h4f1efcc4db9ef8ea
at <unknown source file>:<unknown line>
15: std::sys_common::backtrace::__rust_begin_short_backtrace::hf3cbd67dc5a868f8
at <unknown source file>:<unknown line>
16: std::rt::lang_start::{{closure}}::h76d82e46c7eb707c
at <unknown source file>:<unknown line>
17: std::rt::lang_start_internal::h672762ded3eb0218
at <unknown source file>:<unknown line>
18: _main<unknown>
at <unknown source file>:<unknown line>
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论