I tried to change directory in config file. As I want to save all data on disk D as it has more free space.
What I did is that I change: # directory for storing db tables and metadata. this directory is inside the server root directory provided at startup
cairo.root=D:
But I got this error:
could not open read-write [file=C:\WINDOWS\system32\qdbroot\D:_tab_index.d]
Documentation could be better, but
cairo.rootis not really the root directory for QuestDB. You should leave the default value ofdbfor that configuration parameter onserver.confbefore you continue. I will provide more context at the end of this answer.QuestDB uses a default directory by default when you run
start, depending on the OS, which for windows isC:\Windows\System32\qdbroot. Unless you explicitly pass a different root folder on startup, that folder will be used. Since theserver.conffile is only read after the root folder has been determined, the configurationcairo.rootwouldn't have any effect for this.So, if you want to change the root directory to the D:\ drive, you should start with something like:
questdb.exe start -d D:\qdbrootMake sure the folder
D:\qdbrootexists and the questdb service was not already started. If the service was started, you can issuequestdb.exe stop.If you have registered questdb as a service it via
questdb.exe install, it will always use the default folder, but this can be changed. You need first to deregister the service withquestdb.exe removeand then install again passing the-dparameter, as in:questdb.exe install -d D:\qdbroot.Again, make sure the folder
D:\qdbrootexists. This will cause questdb to start as a service on startup of your system.Now, what is the
cairo.rootconfig for then?. Well, QuestDB has by default this root directory structure:The
cairo.rootfolder makes reference to thedbfolder inside the root folder, which is why you get an error when changing that key on the config file. That property is only checked when doing things like attaching or detaching partitions, and you are better off just leaving the default value.