问题
I have a MArkLogic cluster with 3 nodes:
- Node 1
- Node 2
- Node 3
On this clustered environemnt I have a database test which has one forest test-01. The Primary Host for the forest test-01 is on Node 1. Also, I have CPF installed on the database test
Now, when I insert any document in the database test, the CPF action module will be executed on which Node's Task Server thread?
Will the Primary Host of the forest in which the document gets created ALWAYS executes the CPF action module?
What If I configure a failover replica of forest test-01 on Node 2 and Node 3 and after that stop the MarkLogic service on Node 01. which Node's Task Server will then execute the CPF action modules?
回答1:
CPF uses triggers. A pre-commit trigger will fire on the same host that processes the update. This is independent of forest and cluster configuration. A post-commit trigger will run on the Task Server on the host with the affected forest (thanks to John Snelson for correcting my understanding on this point).
CPF actions use both kinds of triggers. So if you want to limit triggers to a single host, ensure that all your updates are processed on that host and ensure all the affected forests are on that same host. You'd also want to handle host failover by moving update traffic to the next host.
CPF also uses the database online event, which is a little different. I believe that can run on any host, but it may be limited to hosts with any forests attached to the database.
来源:https://stackoverflow.com/questions/27106378/which-node-in-a-marklogic-cluster-runs-the-cpf-action-module