Akumuli icon indicating copy to clipboard operation
Akumuli copied to clipboard

transfer akumuli database to a different machine

Open igor-zacharov opened this issue 5 years ago • 2 comments

igor-zacharov avatar Aug 13 '19 19:08 igor-zacharov

I am testing procedure in which:

  1. on machine A the akumulid is stopped and obviously no update to db
  2. tar up the directory with the db
  3. unfold the directory on machine B
  4. set the /root/.akumulid definition file to point to the place where db is unfolded
  5. start akumulid on machine B

This should be used to analyze the db using grafana. The procedure above seems to be fine and akumulid gives no errors. However, the grafana access gives the error "res.data.charAt is not a function" for all plots I'm trying. The connection works, because the metric and tags are updated dynamically in grafana when I try to setup the queries. An example of a query as listed in akumulid.log: "group-aggregate": { "metric": "crtx.dew", "step": "15s", "func": [ "mean" ] }, "range": { "from": "20190813T190243.158", "to": "20190813T160243.158" }, "where": "", "order-by": "series", "apply": "", "limit": "1000000" }

What could be the problem?

igor-zacharov avatar Aug 13 '19 19:08 igor-zacharov

This can happen when akumulid can't find the database volumes. The database volumes are the files with names like db_0.vol, db_1.vol etc. There is also an sqlite database file called db.akumuli. It stores metadata, like series names, recovery points, and information about volumes (size, capacity, and location). If you open this file using sqlite3 command and issue the following query: sqlite> select * from akumuli_volumes; you will get something like this:

1|/home/dev/.akumuli/db_1.vol|30|0|262144|1
2|/home/dev/.akumuli/db_2.vol|30|0|262144|2
3|/home/dev/.akumuli/db_3.vol|30|0|262144|3
0|/home/dev/.akumuli/db_0.vol|30|720|262144|0

The second column here is a path to the volume. It should be the right one. If this is not the case, the Grafana plugin will be showing you the metric names but wont be able to fetch any data-points.

I can fancy some script that moves the database into different place but for now you can just run an SQL update query to fix the paths.

Lazin avatar Aug 13 '19 21:08 Lazin