Sometimes I need to automatically perform custom migration tasks on all content servers in a cluster and I think dm_method is a right way to execute shell commands remotely.
The caller java process is going to be executed on a Jenkins server. My plan is to iterate the entries in dm_server_config and issue "EXECUTE do_method" as many times as needed.
dm_job has the target_server attribute (the "Designated Server" field in DA). It allows to choose the cluster node to run the job on.
However, you can't run a job immediately, you have to wait a couple of minutes for dm_agent_exec to poll the jobs list.
As far as I understand, dm_agent_exec on each node sends requests directly to the method server on localhost and it will just skip the job if it has a different target_server.
When a remote client issues "EXECUTE do_method", then it's the content server who sends requests to the method server. How do I make the content server connect to the right method server node? Or should I open multiple client connections to all the content server nodes? If so, how?