How to set up a non-Docker node using systemd services with the official native storagenode binary

should we change to “always” on the config for both services or just the updater service?

From the other thread, @badfrog indicated that he changed it to always for both the node and updater. I would think that it’s more important for the node to restart upon update. I would do it for both services.

1 Like

Ive tried to set this up but come across a similar issue to @11FaTuSh11 but the reason is different I think? Ive tried reapplying “chown -R storj-storagenode:storj-storagenode /mnt/storagenode” Any ideas?

Feb 18 23:06:16 storj-node2 storagenode[4269]: Error: piecestore monitor: error verifying location and/or readability of storage directory: open /mnt/storagenode/config/storage/storage-dir-verification: no such file or directory
Feb 18 23:06:16 storj-node2 systemd[1]: storagenode.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 23:06:16 storj-node2 systemd[1]: storagenode.service: Failed with result ‘exit-code’.
Feb 18 23:06:16 storj-node2 systemd[1]: storagenode.service: Scheduled restart job, restart counter is at 185.

Can you confirm the following?

  • That /mnt/storagenode exists and that this is where you want to store your data (i.e. hard drive mounted here)
  • That you’ve run the storagenode setup --config-dir ... --identity-dir ... step

If so, what is the output of ls -la /mnt/storagenode/config and ls -la /mnt/storagenode/identity?

I may have messed up the permissions as I copied the files to the wrong location, do these look ok?

total 56
drwx------ 4 storj-storagenode storj-storagenode 4096 Feb 19 00:20 .
drwxr-xr-x 6 storj-storagenode storj-storagenode 4096 Feb 18 23:37 …
-rw------- 1 storj-storagenode storj-storagenode 8699 Feb 18 23:55 config.yaml
drwx------ 4 storj-storagenode storj-storagenode 4096 Feb 18 22:49 orders
-rw------- 1 storj-storagenode storj-storagenode 32768 Feb 19 00:20 revocations.db
drwx------ 6 storj-storagenode storj-storagenode 4096 Feb 19 00:20 storage
-rw------- 1 storj-storagenode storj-storagenode 1420 Feb 19 00:20 trust-cache.json

/mnt/storagenode/identity:
total 32
drwxr-xr-x 2 storj-storagenode storj-storagenode 4096 Feb 18 23:58 .
drwxr-xr-x 6 storj-storagenode storj-storagenode 4096 Feb 18 23:37 …
-rw-r–r-- 1 storj-storagenode storj-storagenode 558 Feb 18 23:58 ca.1606473117.cert
-rw-r–r-- 1 storj-storagenode storj-storagenode 1088 Feb 18 23:58 ca.cert
-rw------- 1 storj-storagenode storj-storagenode 241 Feb 18 23:58 ca.key
-rw-r–r-- 1 storj-storagenode storj-storagenode 1100 Feb 18 23:58 identity.1606473117.cert
-rw-r–r-- 1 storj-storagenode storj-storagenode 1630 Feb 18 23:58 identity.cert
-rw------- 1 storj-storagenode storj-storagenode 241 Feb 18 23:58 identity.key

That looks correct. Try running it again and see what comes up.

I think ive found the issue. Its my ip forwarding. Ill look more into it tomorrow when im more awake :slight_smile: thanks for your help though. Ill confirm when I get it working.

Done. You should be able to edit it now.

1 Like

I don’t see an Edit button up there still. Perhaps I don’t have the adequate trust level?

I can’t edit it either so something must have gone wrong.

thanks SOOO much for all your help yesterday @fmoledina got my first linux binary node working this morning. The problems I had weren’t anything to do with your instructions. I had an error which was caused by a missing file the node tried to write to when it starts, but because I had an error earlier in the setup process it didn’t create this file. I had to delete the config.yaml file and re run the setup to generate this file after I had put the certs/keys in the correct folder. Completely my mistake and wouldn’t have happened if I followed the instructions correctly.

The other issue I had was with port forwarding. My new ISP uses something called CGN (Carrier Grade Nat) and I needed them to configure me with a static IP so my port forwarding would work.

I do have one error in the logs though, its relating to the new QUIC implementation. Is there anything I need to do to fix this? Any idea if it’s using QUIC?

Feb 19 09:45:54 storj-node2 storagenode[652]: 2021-02-19T09:45:54.568Z INFO failed to sufficiently increase receive buffer size (was: 176 kiB, wanted: 2048 kiB, got: 352 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.

For anyone who has an Odroid HC2/4 ive updated my documentation at http://config.storagenode.uk

2 Likes

Glad to hear it all worked out!

Congratulations on getting yourself a static IP. Hopefully it didn’t cost you an arm and a leg.

I’m seeing that as well on my native node and my Docker nodes. Looks like a new quirk with v1.22.2 and nothing to do with your specific configuration, I don’t think.

Good luck and nice website!

1 Like

Oh, I thought you need a wiki for linked article.
Made your post a wiki now too

1 Like

I should have been more clear than just saying this :grin:. All good, I’ll make my quick edit. Thanks!

1 Like

I am getting the same log message. Have you decided to try to increase the UDP buffer according to the link from this INFO message?

Experiments have shown that QUIC transfers on high-bandhwidth connections can be limited by the size of the UDP receive buffer. This buffer holds packets that have been received by the kernel, but not yet read by the application (quic-go in this case). Once this buffer fills up, the kernel will drop any new incoming packet.

From the link description it might be useful to change.

I know the Storj team are aware of the error msg, and everyone gets it (even the Docker installs)

Quic was only recently implemented and they are testing things so no need to make any changes at this point. I’m sure we will see an announcement in the forum if they want us to make changes.

4 Likes

Would this work, if one sets up multiple nodes on the same machine as different services with different users? Have 4 ports with 4 separate IPs from 4 separate /24 subnets on a machine. May try this because the docker is playing in very nasty ways with iptables and can’t start all nodes at once.

I could see this working since the config allows setting up contact.external-address.

Would it need multiple of those for each node then?

That is exactly what I am doing. Here is my systemd service for the updater:

less /etc/systemd/system/storagenode-updatertest.service
# This is a SystemD unit file for the Storage Node
# To configure:
# - Update the user and group that the service will run as (User & Group below)
# - Ensure that the Storage Node binary is in /usr/local/bin and is named storagenode (or edit the ExecStart line
#   below to reflect the name and location of your binary
# - Ensure that you've run setup and have edited the configuration appropriately prior to starting the
#   service with this script
# To use:
# - Place this file in /etc/systemd/system/ or wherever your SystemD unit files are stored
# - Run systemctl daemon-reload
# - To start run systemctl start storagenode

[Unit]
Description  = Storage Node service
After        = network-online.target
Wants        = network-online.target

[Service]
User         = storagenode
Group        = storagenode
ExecStart    = /home/storagenode/binaries/storagenode-updatertest run --config-dir /mnt/testnode/storagenode/storagenode --binary-location /home/storagenode/binaries/storagenodetest --service-name storagenodetest --debug.addr 127.0.0.1:12018
Restart      = always
Type         = simple
NotifyAccess = main
Nice         = 10

[Install]
WantedBy     = multi-user.target

Note: You need --binary-location and --service-name

Maybe I will use this to create several services for each node on the same machine. Docker = epic fail. Thanks!

4 posts were split to a new topic: How do I use the SN updater on FreeBSD?