Storagenode: allow configuring database path independently (v1.4.2 and above only)

Hello,

So from the 1.4.2 Changelog we can at least move the database to an SSD ! Sound great but the documentation is lacking, I know, too soon™.

From a post here it looks like the new parameter is named “Storage2.Database-Dir” and it should probably be added to the “config.yaml” file

Obviously it’s a change you want to make with the services down, but not 100% sure wich files to move. On the storage folder I can find all those *.db files. Should I move all of them to the new folder?

  • bandwidth.db
  • heldamount.db
  • info.db
  • notifications.db
  • orders.db (By far the biggest)
  • piece_expiration.db
  • piece_spaced_used.db
  • pieceinfo.db
  • pricing.db
  • reputation.db
  • satellites.db
  • storage_usage.db
  • used_serial.db

Anyone did the change already?

EDIT:
I did it and everything works fine :

  • Stopped both services
  • I edited the “config.yaml” file and added “Storage2.Database-Dir: S:\Storj\Databases”
  • Moved all the *.db files from their orriginal location to the new one “S:\Storj\Databases”
  • Restarted the services and looked at the loog, no errors
1 Like

I didnt make it, wait Linux binary
But of course need stop storagenode service, move all database files to New location and make change in config.
If you stop storagenode correctly *. Db files all what you need. But if not, in storage folder May be present db log files (shm and wal)
And i dont know is it worked with docker. There was some flaws when config.yaml not fully parsed with docker

1 Like

Thank for the bit of information. On windows we can use full path like “S:\DB” we are not limited to relative path like “/app/db” correct?

Next maintenance on the node i’ll try to move the DBs.

When will the version 1.4.2 be available with docker update ?
And I don’t understand if we can move all db type file or only some of them ?
Thanks for help, I find this community really cool.

Thanks you for the quick answer. I discover binary node. What is the difference (pro & cons) with docker node ? Is there a tutorial to do it ?

Thank you @Alexey

Sorry, could you add a sentence with your link…
I know about docker install.
I mean I have see it is possible to don’t use storj with docker, but I don’t know how to do it and is there a tutorial ?

Thnks for your help if you have the answer.

There is no tutorial since we do not offer the non-docker version for Linux. The current method is to run it as a docker container.
We even do not have such tutorial for FreeBSD yet.

But you can try to use a community version:

1 Like

Thank you very much @Alexey , a last question, in the new version, is it all db file we can move or only some of them ?

For all database files. However, I have not tested it myself to be sure.

2 Likes

Took the risk to move the database files to my boot drive.

Stopped the Windows GUI, copied all the .db files from my node storage root, added the line
Storage2.Database-Dir: C:\Users\Administrator\AppData\Roaming\Storj\Database to my config file
then brought the server service back up. Server looks to be writing to the new location now without issue so far.

I do wonder if moving the DB off the storage drive will allow the storage drive to idle to the point of sleeping. Blobs do seem to be accessed at a fairly fast rate under current usage though.

1 Like

If you dont know about difference w/o docker maybe it is not nececary for you.
But some time ago i write script, updater and downloader linux binary from docker image that works without docker.
I just put a link here.

If you have a good amount of data i really dont think this will append.
And actually it’s bad for the drive. most “NAS” drives prefer to stay awake (even without read / write) than going to sleep entirely

Hello the new storj docker version is here.
I install a fresh node.
I try this parameter:
–mount type=bind,source=/media/db/,target=/app/db

But it don’t create database in the folder /media/db/

Please could you tell me where is my mistake ?

That just maps the path. You need to also move the db files to that path and change the option in the config.yaml.

Storage2.Database-Dir: /app/db/

Please make sure you know what you’re doing. Messing this up can result in damaging your databases or creating multiple versions that can’t simply be merged.

1 Like

Hello and thank you for quick reply. I use docker, so I don’t have config.yaml or could you tell where is it ?

Are you sure you want to do this? If you have to ask these questions I feel like you shouldn’t take the risk of moving the db files. Most SNOs have no reason to do so.

The config.yaml is in the config path you used in the docker run command.

5 Likes

No problem, it is a fresh new node. I try it to understand more about storj. Thank you very much for your help. So we can’t directly start a new node with database file in the right directory ?