Running job on different machine with ES cluster

(from github.com/shwetazilpe)
Hi,
I have 2 machines say M1 and M2, both having ES installed in cluster and both having Fess installed as well. I want to create a job in M1 which will run on M2. I tried to set up host name of M2 in “scheduler.target.name” in fess_config.properties and created a job in Scheduler page from admin console with target as M2, but it didn’t worked. How can I do it?
Any ideas or suggestions would be sincerely appreciated…
Thanks!

(from github.com/marevol)
Did you restart Fess in M2?

(from github.com/shwetazilpe)
Thank You for the reply.
I configured “scheduler.target.name=M2” in fess_config.properties and created a job with target as M2
After restart, I’m able to run job on demand from machine M1 as both the target matches. But still not sure if that’s running on Fess from machine1 or machine2. By checking the code, it looks Fess check for target match from fess_config.properties and admin page. If possible can you please share how the target is being controlled in Fess?
Thanks again!

(from github.com/marevol)
AllJobScheduler checks a target name.