I've downloaded the mincemeat.py with example from https://github.com/michaelfairley/mincemeatpy/zipball/v0.1.2
example.py as follows:
#!/usr/bin/env python
import mincemeat
data = ["Humpty Dumpty sat on a wall",
"Humpty Dumpty had a great fall",
"All the King's horses and all the King's men",
"Couldn't put Humpty together again",
]
datasource = dict(enumerate(data))
def mapfn(k, v):
for w in v.split():
yield w, 1
def reducefn(k, vs):
result = sum(vs)
return result
s = mincemeat.Server()
s.datasource = datasource
s.mapfn = mapfn
s.reducefn = reducefn
results = s.run_server(password="changeme")
print results
It is used for a word counting program.
I've connected two computers in network by LAN. I have used one computer as a server and run example.py on it; and on a second computer as client, I've run mincemeat.py with following command line statement:
python mincemeat.py -p changeme server-IP
It works fine.
Now I have connected 3 computers in a LAN by a router. Then one machine works as a server and I want to run the example.py on it, and run the remaining two machines as client machines.
I want to distribute the task to my two client machines. So what is the process to distribute the task of the map and reduce to the two computers? How can I distribute my task, defined in example.py, to two client computers with their unique IPs respectively?