Search code examples
databasetime-seriescnosdb

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


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"}

Solution

  • 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::<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)