Recreation config file

Since one of my nodes still has a very old config.yaml I was thinking about recreation of that specific file.

It is a non-dockerized Linux. So I was thinking if I run storagenode setup and add all the required modifications as flags, it sounds like this would be the way to go.

Does this command only create config.yaml or does it any additional things like database creation or something because this probably wouldn’t be a good idea.

Also for not overwriting the existing config.yaml, is it safe to test under a different name, to check, if the required modifications are correct before copying things over?

This command will fail, if there would be a config.yaml. So, you need to rename or delete it first. This is done to protect from second (unintended) run of the setup, because it’s very important for protection.
So you would need to do it only when you are sure what are you doing.

This command also will create all needed/missed folders structure and storage-dir-verification file containing your NodeID in binary form.
This file is used to check if the current NodeID matches the stored in file to protect from running with a wrong identity. It’s also verified if it ever exist, if not the node will fail to protect from disqualification because of missed disk in mountpoint for example.
If there would not be a needed folder structure the node will crash too to protect from missed disk in mountpoint again.
The file is checked also on write and node will fail, if it’s not writeable (in case of read-only fs or wrong permissions)

This does not sound like it was safe to play around / test with that command. I am sure I gonna miss something on my first attempts, any suggestions to get that done safely on a running node to not to mess things up and lose the node?

If the only purpose to generate a config.yaml I would recommend to specify a temp dir as a data location for the setup step, then move config.yaml to the normal location manually.

Yes it’s only about the config.yaml. I have just checked, the storage-dir-verification file does exist and it is in the correct location and I guess the folder structure I could check manually, just to compare if there is anything wrong.

Ok that means not to use the current data dir.

But once I know I have the command right and the resulting config.yaml is 100% correct, would it then be safe to run it with the original data dir on the running node?

Yes, of course, if you specified a correct (actual) path to the identity location.
You also can compare temp and actual data location folders with diff for example.

1 Like