If you are trying to connect nodes through code: you need to turn your code into a distributed node. To do this, run Node.start(:fullNameOfServer) .
For example: if your IP address is 192.168.0.1, you can have the full name Node, for example :"foo@192.168.0.1"
Once you turn your Node into a distributed node, you will set a cookie: Node.set_cookie :cookie_name
Finally, you need to establish a connection with the remote node. (You also need node.start and node.set_cookie on the node remote control). To do this, you will need the remote name Node. Suppose the remote Node name is bar@192.168.0.2 (it is assumed that this Node is another computer on the same local network). The code for this looks like Node.connect :"bar@192.168.0.2"
Now you can run node.list to see bar@192.168.0.2 at foo@192.168.0.1 and vice versa.
To summarize the above points, your code should look something like this:
By car foo
Node.start :"foo@192.168.0.1" #this is the IP of the machine on which you run the code Node.set_cookie :cookie_name Node.connect "bar@192.168.0.2"
By car with a bar
Node.start :"bar@192.168.0.2" Node.set_cookie :cookie_name
adityah Sep 15 '17 at 4:51 on 2017-09-15 04:51
source share