Still very new to CrateDB and have a few basic questions.
I have a CrateDB cluster(version 4.6.6) running using the Prometheus adapter, thanks again to you guys.
Now I would like to understand how to do the following:
Identify the default location of the cratedb files. According to the /etc/crate/crate.yml config file, I can set a path(#path.data: /path/to/data1,/path/to/data2), but it’s not clear where the data is currently stored – as in the exact path.
Goal: I want to move the directory off of the “/” file system and store it on a separate disk on the system or an NFS mount point.
I would like to query a database table and do something like: “select * from crate-main-table” to confirm that the Prometheus scraped data is actually being stored in the crate database.
I also started to evaluate CrateDB for one of our projects recently. There’s one issue regarding storage path, maybe yours is similar to mine. Did you install from the official CrateDB APT repository?
You installed CrateDB using the apt packages, correct? If you do that, CrateDB starts automatically ins single-node mode which also prevents adding the nodes to any sort of cluster. This is intentional in a way, that apt packages should start without any additional confiuguration.
There are basically two ways to fix this
using the crate-node tool
or (easier)
deleting the cluster state by …
service crate stop
rm -rf /usr/share/crate/data
service crate start
As far as I understand, if you install from CrateDB APT package repository, the default path for CrateDB storage is /usr/share/crate/data.
If you have another disk, and if your system is a GNU/Linux distribution, and if you already mounted your disk, e.g. /path/to/my/disk/ then you can set the path.data: parameter in /etc/crate/crate.yml config file to the path (wherever you mounted your disk, e.g. /path/to/my/disk/) and restart the crate service.
I did something similar, and then observed that CrateDB started to write to that location, e.g. /path/to/my/disk/ (another disk, dedicated to data storage).