I’ve been doing some reading up today on how I would go about adding a second HDD and node to my existing Linux Docker setup, 2 nodes on 1 machine. One thing I know would need to be handled carefully is the usage of ports. I didn’t see a good explanation on what the port list ("-p") parameters in our Docker commands represented. I’ve read up on Docker and think I now understand. Considering a “container” as a sort of packaged virtual machine helped me to wrap my head around this. Putting this out there for critique (I’ll edit if needed, please provide feedback) and reference by the community. @SGC, maybe something for your flight manual.
Each storage node container has two fixed ports on which it will listen: 28967 for cloud communication and 14002 for the dashboard. Use of the Docker -p (
--publish list) parameter allows us to define forwarding to these ports at the machine level. The structure of the parameter is as follows:
Because the container ports are defined in the node code these will always be 28967 and 14002 unless the code changes.
The machine values are how we control communications outside of the container (machine level) reaching the internal ports of the container, how we publish the ports. For a single node the documented and recommended settings are to use the same machine ports as the container ports. If you will be using the dashboard from the same machine hosting the node this is where you will use the machine IP string of “127.0.0.1:” to allow loopback.
If you intend to run multiple nodes on the same machine or for some reason already have the recommended ports in use on the machine, you will need to specify different ports for the machine side. This will change the ports which you need to use to access the dashboard or to which your firewall forwards node traffic. For example, if you already have a node on the machine set up with:
Your second node will need to have different published machine ports defined. You might use:
So to access the dashboard of your first node from a separate machine you would use
But to access your second node dashboard you would use
Similarly your firewall forwarding rules would need to specify internal ports of 28967 for your first node and 28970 for your second. Remember that it is your firewall external ports that are referenced in the “-e ADDRESS” parameter; changing your Docker published ports does not directly effect the value of this.
What do you think, sirs?