在Windows环境中,cnosdb启动后无法读取配置文件。

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

After cnosdb starts in the windows environment, it fails to read the configuration file

问题

在Windows环境中启动cnosdb后,无法读取配置文件。我在Windows环境中启动了cnosdb的单节点部署,并检查了以下日志:

cnosdb run --deployment-mode singleton
-----------------------------------------------
2023-05-27 15:54:37.260629800+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.260707000+08:00 警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.260794800+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.260880000+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.260947900+08:00 警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.261032500+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.261085500+08:00 警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.261244600+08:00
2023-05-27 15:54:37.261253900+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.261274000+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.261387000+08:00
2023-05-27 15:54:37.261419500+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27 15:54:37.261534800+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.261558800+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级
2023-05-27T15:54:37.261687700+08:00
警告 models::runtime::executor: 不支持在此平台上设置工作线程优先级

2023-05-27T15:55:37.205699100+08:00
错误 meta::model::meta_admin: 无法获取磁盘信息:系统找不到指定的路径。
错误代码 21
2023-05-27 15:55:37.206866800+08:00
信息 meta::store::state_machine: 写入:/cluster xxx/data nodes metrics/11 tmidm: 11, ndisk_free: 0, ntime: 1685174167, status: "NoDiskSpace"
2023-05-27T15:56:07.206575300+08:00
错误 meta::model::meta_admin: 无法获取磁盘信息:系统找不到指定的路径。
错误代码 3
2023-05-27 15:56:07.207830800+08:00
信息 meta::store::state_machine: 写入:/cluster xxx/data nodes metrics/101 tmidm: 101, ndisk_free: 0, ntime: 1685174167, status: "NoDiskSpace"

注意:由于代码部分不需要翻译,因此我只提供了日志的翻译部分。

英文:

After cnosdb starts in the windows environment, it fails to read the configuration file.
I start cnosdb single node deployment in windows environment.And check the log as fllow:

cnosdb run --deployment-mode singleton
-----------------------------------------------
2023-05-2715:54:37.260629800+08:00
WARN models::runtime::executor: Setting worker thread priority not supported on this platform
2023-05-27T15:54:37.260707000+08:00 WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
2023-05-2715:54:37.260794800+08:00
WARN models::runtime: executor: Setting worker thread priority not supported on this platform
2023-05-2715:54:37.260880000+08:00
WARN models::runtime::executor: Setting worker thread priority not supported on this platform
2023-05-27715:54:37.260947900+08:00 WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
2023-05-2715:54:37.261032500+08:00
WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
2023-05-27T15:54:37.261085500+08:00
WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
2023-05-2715:54:37.261244600+08:00
2023-05-27715:54:37.261253900+08:00
WARN models: runtime: :executor: Setting worker thread priority not supported on this platform
WARN models::runtime: executor: Setting worker thread priority not supported on this platform
2023-05-27T15:54:37.261274000+08:00
WARN models: :runtime::executor: Setting worker thread priority not supported on this platform
2023-05-27T15:54:37.261387000+08:00
2023-05-2715:54:37.261419500+08:00
WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
2023-05-27715:54:37.261534800+08:00
WARN models::runtime: :executor: Setting worker thread priority not supported on this platform
WARN models::runtime::executor: Setting worker thread priority not supported on this platform
2023-05-27715:54:37.261558800+08:00
WARN models::runtime: executor: Setting worker thread priority not supported on this platform
2023-05-27T15:54:37.261687700+08:00
WARN models::runtime: :executor: Setting worker thread priority not supported on this platform



2023-05-27T i5:55:37.205699100+0g:00 ERRORmeta::modei::meta_ adinin: Failed to get disk info:系统找不到指定的路径。
as orror 21
2023-05-2715:55:37.206866800+08:00
INFO metae -store.:state machine. WRITE: Fcluster xxxrdata nades metrics/11 .midm. nogn ndisk freem-0.utimen-1695174137_ mstatus n . mNon iskSpaCen
2023-05-27T15:56:07.206575300+08:00 ERROR meta::model::meta admin: Failed to get disk info:系统找不到指定的路径。
los error 3
2023-05-27715:56:07.207830800+08:00
INFO meta::store::state mach ine: WRITE : /cluster xxx/data nodes
metrics/101 :tmidm: 1e01, ndisk_free":0,nt ime": 1685174167,"status": "NoDiskspace"}

答案1

得分: 1

很多“异世界”词汇在你的问题中,但我明白了。

我猜你在运行cnosdb在Windows上时对输出感到困惑。我已经在Windows 11上尝试了最新版本(69eaec74),并开启了所有设备安全选项,但仍然得到了相同的错误日志:

2023-06-11T05:50:43.260800900+09:00 ERROR meta::model::meta_admin: Failed to get disk info :The system cannot find the path specified. (os error 3)

然后我编辑了源代码,将依赖库winapi更改为windows,然后它就可以工作了:

use std::ffi::OsStr;

use windows::core::HSTRING;
use windows::Win32::Storage::FileSystem::GetDiskSpaceInformationW;

let hdir = HSTRING::from(OsStr::new(path));
let mut disk_space_info = MaybeUninit::<DISK_SPACE_INFORMATION>::zeroed();
let disk_space_info = unsafe {
    GetDiskSpaceInformationW(&hdir, disk_space_info.as_mut_ptr())
        .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
    disk_space_info.assume_init()
};
Ok(disk_space_info.ActualAvailableAllocationUnits
    * (disk_space_info.SectorsPerAllocationUnit * disk_space_info.BytesPerSector) as u64)

希望这对你有帮助。

英文:

A lot of Isekai words in your question, but still got it.

I guess that you're confusing about the output when you're running cnosdb on windows. I have tried the latest version (69eaec74) on windows 11 (with all device security options switched on) and got the same error log:

2023-06-11T05:50:43.260800900+09:00 ERROR meta::model::meta_admin: Failed to get disk info :The system cannot find the path specified. (os error 3)

Then I edited the source code, changed dependency crate winapi to windows, and it works:

use std::ffi::OsStr;

use windows::core::HSTRING;
use windows::Win32::Storage::FileSystem::GetDiskSpaceInformationW;

let hdir = HSTRING::from(OsStr::new(path));
let mut disk_space_info = MaybeUninit::&lt;DISK_SPACE_INFORMATION&gt;::zeroed();
let disk_space_info = unsafe {
    GetDiskSpaceInformationW(&amp;hdir, disk_space_info.as_mut_ptr())
        .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
    disk_space_info.assume_init()
};
Ok(disk_space_info.ActualAvailableAllocationUnits
    * (disk_space_info.SectorsPerAllocationUnit * disk_space_info.BytesPerSector) as u64)

答案2

得分: 0

我昨天使用了社区版本的最新图像,并且在Windows上可以正常读写。此外,请检查cnosdb官方网站,没有支持Windows环境。```bash
OS window 11
docker pull cnosdb/cnosdb:community-latest


<details>
<summary>英文:</summary>

I used the latest version of the community version of the image yesterday, and I can read and write normally on windows.In addition, check the cnosdb official website, there is no support for the windows environment.
```bash
OS window 11
docker pull cnosdb/cnosdb:community-latest 

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

发表评论

匿名网友

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

确定