I want to run two separate nodes on my computer but it seems that the two nodes will collide with other. I know some considerations should be taken such as the ports, but anything else should I take care of?
For different clients all you need to do is changing the listening port, like that:
pyethapp # defaults to 30303
eth --listen 30304 --no-ipc
geth --port 30305 # default ipc
parity --port 30306
ethereumj you can configure the port in the config file, e.g.,
30307. Never was able to change the port in pyethapp though. Running parity in
--geth mode here would conflict with geth, depending on your needs you should disable ipc on all clients except one, the example above defaults to geth ipc.
For multiple instances of the same client, you would also have to adjust the data directory.
geth # defaults to port 30303 and ~/.ethereum
geth --port 30304 --datadir ~/.ethereum-04
geth --port 30305 --datadir ~/.ethereum-05
geth --port 30306 --datadir ~/.ethereum-06
Or for parity:
parity # defaults to port 30303 and ~/.parity
parity --port 30304 --db-path ~/.parity-04
parity --port 30305 --db-path ~/.parity-05
parity --port 30306 --db-path ~/.parity-06
On top you can add fine tuning such as rpc ports or pruning methods, but that's up to you.
I have successfully used this docker-compose system, where you can even define the number of nodes as a parameter:
Yes you will have to use different ports and directories for the data of each node. I shared a docker-compose (Geth+Parity) setup, on the same host. You can use that example to start. Cheers! https://github.com/gregbkr/ethereum-nodes-docker