New node config.yml is not updated (Linux Docker installation)

Installed my first node on Linux with official website guide on Docker but config.yml values are incorrect/default?

docker run --rm -e SETUP="true" \
    --user $(id -u):$(id -g) \
    --mount type=bind,source=/mnt/storjnode_1/identity,destination=/app/identity \
    --mount type=bind,source=/mnt/storjnode_1/data,destination=/app/config \
    --name storagenode_1 storjlabs/storagenode:latest
docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28967:28967/tcp \
    -p 28967:28967/udp \
    -p 192.168.50.212:14002:14002 \
    -e WALLET="0xCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -e EMAIL="mail@gmail.com" \
    -e ADDRESS="1xx.xx.xxx.xxx:28967" \
    -e STORAGE="6.5TB" \
    --user $(id -u):$(id -g) \
    --mount type=bind,source=/mnt/storjnode_1/identity,destination=/app/identity \
    --mount type=bind,source=/mnt/storjnode_1/data,destination=/app/config \
    --name storagenode_1 storjlabs/storagenode:latest

Also setup Watchtower.
I ran all these as Root user, hope thats not going to create an issue in future.

When I tried to change some values, the config.yml file has not saved any of the parameters passed from Docker run. Wallet address is blank, Size is set 2.0 TB instead of 6.5 TB and many more fields are blank/incorrect. I dont have deep knowledge how docker works but the values are all correct when I open dashboard. Do I setup correct parameters manually in config?

Also, Is it possible/How to add a mount point for badger, databases now?

Thanks!

Hey,

I recommend running sudo usermod -aG docker $(whoami) to add your user to the Docker group so you don’t have to use sudo with Docker commands.

Difference: Instead of: -p 192.168.50.212:14002:14002 \ I use: -p 14002:14002 \ This could be the only difference affecting the network binding.

Script: I also add this at the start to make sure the latest Docker image is used:

#!/bin/bash

docker pull storjlabs/storagenode:latest
docker stop storagenode
docker rm storagenode

#Now the usual run command

Logs: To check for errors, you can view the logs with this command: docker logs storagenode_1 2>&1 | grep "error"

This should help you identify the issue!

1 Like

Docker parameters are not saved in the config.yaml. You have to edit the config.yaml by yourself.

I’d recommend to put your docker command in a script so that you don’t have to type it every time.

2 Likes

You mean the docker run commands? Why do I have to run them everytime after PC reboots? Isnt it set and forget in config.yml?

Yes. You can set them in the config file. Or you can pass them in the command line. Or both; command line takes precedence. It’s up to you.

2 Likes

Thanks!
If I pass --storage2.piece-scan-on-startup=true in docker run and later set to false in config.yml, It will be set to false right?

Whatever you set on the command line is what will get used, regardless of what’s written in the config file.

Why would you want to disable scan on startup? Generally, I would stick to defaults.

2 Likes

I am just trying to understand how the flow works..
So for example if I want to increase the node space from 6TB to 10TB in the future. I have to edit/delete container & re-run the docker command? config.yml cannot override if I change in there?

The command line options have a precedence above parameters in the config.yaml file.
So, it’s recommended to put all options in your docker run command. However, if you didn’t provide them, part of options would be used from the config.yaml still.

No, the command line options have a precedence above options in config.yaml. Moreover, you need to use tricks to make it reverse :smiley:

2 Likes

Can you please guide me on how to edit docker run command? I want to change my 6.5TB space to 7TB.

Are the changes to be done in containers config.v2.json file?
I saw some steps on internet.
Like, Stop container → Make changes in config.v2.json → Restart Docker service → Start container?

You have to do:

docker stop storagenode_1

docker rm storagenode_1

docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28967:28967/tcp \
    -p 28967:28967/udp \
    -p 192.168.50.212:14002:14002 \
    -e WALLET="0xCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -e EMAIL="mail@gmail.com" \
    -e ADDRESS="1xx.xx.xxx.xxx:28967" \
    -e STORAGE=“7TB" \
    --user $(id -u):$(id -g) \
    --mount type=bind,source=/mnt/storjnode_1/identity,destination=/app/identity \
    --mount type=bind,source=/mnt/storjnode_1/data,destination=/app/config \
    --name storagenode_1 storjlabs/storagenode:latest

You do not need to modify the config file because this is a priority.

In practice you only need to change this entry:

-e STORAGE=“7TB" 
3 Likes

I saw this method is recommended but I have mounted 2 more volumes by editing configv2.json and hostconfig.json, thought i can do the same again.

What’s weird software you have used? These configs do not belongs to Storj storagenode.

1 Like

These files are created by docker inside the container. When you login inside the container you see these files.

Starting to sound like Docker Site hacked.. lol.

2 cents
Julio

On Debian, Path is /var/lib/docker/(container_id)/files
Its easy to change values there.

You can also use a docker compose file to keep track of your options. Especially useful if running multiple nodes.

1 Like

Why?

There is a normal way like modify variables in your docker run command, or provide the command line options after the image name or modify config.yaml in the data location, or use a docker compose, see

2 Likes