rml52
April 24, 2024, 7:41pm
61
I did the prune command a couple days ago, while it did free up some space, that file size tool ncdu still shows the current docker has 12gigs of logs.
I just want someone from Storj to tell me it is safe to do something and maybe provide safe steps on how to do it because this node if 5 years old, has a lot of used data and I don’t want to loose it and have to start all over.
Based on nuggets of comments from these last couple days, I speculate that I will have to stop the node, change the config.yaml to put the logs somewhere else, MAYBE delete the xxxx.jason-log file in the screenshots??? (that is the part I want someone to tell me is ok to do), then restart the node, and setup logrotate to auto delete the new log location
rml52
April 24, 2024, 7:53pm
62
@Knowledge Would you be able to answer or know a storjling who can?
rml52
April 24, 2024, 7:55pm
63
Seems to me that this may be a bigger issue for Storj Labs to look into. Older nodes not having logs rotated out trapped in the docker.
lyoth
April 24, 2024, 8:11pm
64
this is not a Storj Lab issue…
There are docker run commands you can use to log rotate it.
Well it sounds like a Docker issue. You can configure Docker to rotate and purge logs based on size limits. See here…
You can also remove the container and recreate it which will also purge the logs.
It’s difficult to help you if you don’t answer all questions.
rml52
April 24, 2024, 8:23pm
67
I have done this and it doesn’t go down that I why I want to make sure I don’t break anything
rml52
April 24, 2024, 8:27pm
68
last log shows 2024-04-24T20:26:13
Ok, that means, it’s the right logfile and currently used. If you don’t need the logs, just empty that file (don’t delete it!) with
echo > /path/to/file
1 Like
rml52
April 24, 2024, 8:42pm
70
I ran the command. all seems healthy. node didn’t go offline. and df -h shows 28% down from 97%
rml52
April 24, 2024, 9:23pm
71
Spoke too soon, just got the email that my node is down. Troubleshooting now
rml52
April 24, 2024, 9:34pm
72
Rebooted VM. Back online. Drive space still at 28%, Dashboard says up and OK.
1 Like
rml52:
and it doesn’t go down
Then it sounds that something is wrong with your docker installation. If you remove the container the log should be deleted with it.
1 Like
Hmm, I’ve check my own container, it show 7GB of logs as well (and I’ve watchtower so it got replacement when new node version came out?).
Alexey
April 25, 2024, 4:26am
75
command:
- --log.output=config/storagenode.log
And your logs will be written to the file storagenode.log
on your data location.
Then you likely will need to setup a logrotate on your host:
Hi phillipe,
This is easy to do with logrotate since you can use wildcards to define your paths and files. I placed a logrotate config file in /etc/logrotate.d/ called storagenode . It is a plain text file. My logrotate config file is as follows. Don’t include comments in your config file (there is an uncommented version below).
/mnt/logs-usb/storj*/storagenode*.log {
#the wildcard (*) characters tell logrotate to look in any subfolder that
#begins with storj, and rotate any log that starts wi…
are you running in a NAS or Windows or Linux?
In Ubuntu I use the “logrotate” command in a cron job to create/compress log files.
First you have to make sure you have added in the “Log Location” and “Log level” fields in the “config.yaml”
Then look in the “/etc/logrotate.d/” folder, you’ll see a list of files, those are the configs used to rotate logfiles ( usually found in “/var/log/”). I just put a “storj” config file in the logrotate.d/ and it’s done automatically
To rotate my logs i use …
1 Like
Alexey
April 25, 2024, 4:32am
76
Perhaps you may empty them like suggested by
Ok, that means, it’s the right logfile and currently used. If you don’t need the logs, just empty that file (don’t delete it!) with
echo > /path/to/file
However, it’s possible that you have other running containers, which may log to there. So I would suggest to stop and remove all containers, include stopped, you may see them with the command
docker ps -a
Then check a usage, it should be reduced.
After that run the needed containers back.
JWvdV
April 25, 2024, 4:37am
77
Perhaps this might help:
docker run -d --restart unless-stopped --stop-timeout 300 \
(...) \
--log-opt max-size=20m --log-opt max-file=3 \
--name "storagenode" storjlabs/storagenode:latest \
(...)
1 Like
Alexey
April 26, 2024, 12:53pm
78
It’s suggested there:
but I suppose was ignored…