databasetime-seriesquestdb

QuestDB root folder


Is there any way of knowing which is the root folder of a running QuestDB instance? Programmatically if possible.

I have checked all the meta functions, and they seem to provide information about the disk storage capacity or about the current version, but they fail to provide root folder information.

I also tried with SHOW PARAMETERS, but the root folder is not a config parameter, but a runtime parameter, so it is not listed there. I am running out of ideas here.


Solution

  • Even if SHOW PARAMETERS does not list the db root folder itself, we can search for the cairo.sql.copy.work.root, which is a subfolder of the root folder by default. Note that this value can be changed, so if it is not the default, it might be outside the root folder.

    We can execute this query to know both the current folder (defaults to /tmp under the db root), and also if it is the default location of now. If value_source returns default, you know you have the root folder.

    select value, value_source from (show parameters) where property_path = 'cairo.sql.copy.work.root'
    

    If we see the value source is not the default, but env or conf, this means the location has been defined via environment or server.conf values, and we cannot be sure about the root folder using this method.

    An alternative in this case is parsing the startup log. The first lines of the log on startup will show something like this

    
    2025-03-24T11:59:33.993921Z A server-main QuestDB 8.2.4-SNAPSHOT. Copyright (C) 2014-2025, all rights reserved.
    2025-03-24T11:59:34.153961Z A server-main darwin-aarch64 [Vanilla,0, 64 bits, 8 processors]
    2025-03-24T11:59:34.159261Z I server-main Web Console is up to date
    2025-03-24T11:59:34.166166Z A server-main Server config: /opt/homebrew/var/questdb/conf/server.conf
    

    And the startup sequence ends with something like

        ___                  _   ____  ____
        / _ \ _   _  ___  ___| |_|  _ \| __ )
       | | | | | | |/ _ \/ __| __| | | |  _ \
       | |_| | |_| |  __/\__ \ |_| |_| | |_) |
        \__\_\\__,_|\___||___/\__|____/|____/
                            www.questdb.io
    
        Web Console URL                 ILP Client Connection String
    
        http://192.168.64.1:9000        http::addr=192.168.64.1:9000;
        http://192.168.50.40:9000       http::addr=192.168.50.40:9000;
        http://127.0.0.1:9000           http::addr=127.0.0.1:9000;
    
    QuestDB configuration files are in /opt/homebrew/var/questdb/conf
    
    
    2025-03-24T11:59:34.879669Z A server-main enjoy
    

    As you see on both extracts, the location of the root folder is printed out.