Two nodes on same machine using docker

I have installed a fresh server with ubuntu 22.
I have set 2 public ips on this server:
xx.xx.xx.21
xx.xx.xx.22

I have migrated my 2 existing nodes here.

Here are my nodes:

docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28901:28967/tcp \
    -p 28901:28967/udp \
    -p 127.0.0.1:14001:14002 \
    -e WALLET="0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    -e EMAIL="myemail@gmail.com" \
    -e ADDRESS="xx.xx.xx.21:28901" \
    -e STORAGE="14TB" \
    --mount type=bind,source="/root/.local/share/storj/identity/storagenode",destination=/app/identity \
    --mount type=bind,source="/storj/data",destination=/app/config \
    --name storagenode storjlabs/storagenode:latest
docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28902:28967/tcp \
    -p 28902:28967/udp \
    -p 127.0.0.1:14002:14002 \
    -e WALLET="0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    -e EMAIL="myemail@gmail.com" \
    -e ADDRESS="xx.xx.xx.22:28902" \
    -e STORAGE="14.5TB" \
    --mount type=bind,source="/root/.local/share/storj/identity/storagenode2",destination=/app/identity \
    --mount type=bind,source="/storj2/data",destination=/app/config \
    --name storagenode2 storjlabs/storagenode:latest

My nodes has started but I see this port (7778) for both of them:
Internal 127.0.0.1:7778
External xx.xx.xx.21:28901

Internal 127.0.0.1:7778
External xx.xx.xx.22:28902

Is it ok? And is it ok to use 28967 for both of them?

Yes. All correct.

Docker gives each Container an (different) internal ip. So using 28967 in Container is fine.

I recommend you copy the identity to the disk of the data.
This will save you headache when you forget to back it up after formatting your OS.

hey,

I too am trying to run 2 nodes on 1 machine.

So far I have one public IP.

is it essential to have separate public IPs for each node?

thanks in advance!

Hello @coinbene,
Welcome to the forum!

You should use the one public IP for all nodes running on the same host, but you need to specify different ports and forward them on your router.
Please note, each new node must be vetted, while unvetted the node can accept only 5% of the customers’ uploads. To be vetted on the satellite, the node should pass 100 successful audits from it. For the one node in the same /24 subnet of public IPs it should take at least a month.
We filter out nodes from the same /24 subnet of public IPs, and all such nodes are treated as a one big node for uploads, and as a separate ones for downloads, repairs, audits and online checks: we want to be decentralized as much as possible.
The vetting process for several vetting nodes in the same /24 subnet of public IPs could be in the same times longer as a number of such nodes.
Thus it’s better to run the next node when a previous one almost full or at least vetted.