2

I have serval python processes talk to each other via socket; each process has a specific role or function.

These processes are initially running on a wire LAN (and the ip of the machines are static ), so I assign an ip address and port number for each one of them to let them find each other and talk to each other; but when I switch a dynamic environment where the ip address of each python process is not static, it's tedious to configure the ip address of the process each time. Currently, I use SSH to login and start different processes, and there are two machines with many different processes.

How can I easily deploy these process in a distributed environment, say in a wireless LAN or across the entire Internet so that they can find each other by themselves; and I will use twitter's murder to distribute my code on these machines.

I guess there should be something like a name service, but I am not sure what I should do.

9
  • how do you start them on the different machines? Commented Sep 18, 2012 at 6:50
  • @ted I use SSH to start them. Currently, I only used two machines. Commented Sep 18, 2012 at 6:54
  • You start them manually or by a script, if so how does the script know to which machines to connect? (My knowledge on the area is limited but I would say you are left with to options: a) the 'nameservice' you suggested, a server that is known and hands out ip addesses of other peers b) during startup you send the ip from where you send the command to start and thus have a connection back to your net of processes. The later one might cause trouble if a link in the chain dies (see next comment) Commented Sep 18, 2012 at 7:18
  • Lets assume every machine starts a process once instructed to do so, and then tries to find other machines on which to start processes. Machine A, user starts first process. MAchine A triggers process creation on Machine B, which creates a process and then Innitiates process creation on machine C, now the link between B and A dies. Since C only has knowledge of B after startup, part of your process is cut off. This is a single point of failure (unless you try to add connections after conencted to the net. This still leaves you with the problem to discover machines on which to start processes. Commented Sep 18, 2012 at 7:22
  • Can you do some sort of automatic search/discovery of machines? (scan) Commented Sep 18, 2012 at 7:23

1 Answer 1

1

you could

  • use dns instead of ip addresses
  • create your own name service (perhaps a rest service providing a register and a lookup function)
  • use a zeroconf implementation like bonjour or avahi (depending on your os)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.