2

I am trying to create multiple instance of application on same marklogic environment. I can able to create all the configurations(users,roles,databases,forests,app servers...) but could not able to schedule individual tasks for separate database with same module path.

When tried to run ml-gradle mldeployApps failing at Tasks creation.

My whole application configuration will depends on from property file. for any APP-NAME a seperate insiance need to be created.

I tried deploying through ml-gradle The mlDeployTasks is failing as already an task is available for the module path. When try to run secong with new failing as it is not recognizing task database

JSON:

      {
         "task-enabled":true,
         "task-path":"/ext/schedules/monitor.xqy",
         "task-root":"/",
         "task-type":"daily",
         "task-period":1,
         "task-start-time": "10:00:00",
         "task-database":"%%DATABASE%%",
         "task-modules":"%%MODULES_DATABASE%%",
         "task-user":"admin",
         "task-priority":"normal"
       }

ERROR:

Logging HTTP response body to assist with debugging: {"errorResponse":{"statusCode":"500", "status":"Internal Server Error", "messageCode":"MANAGE-INVALID", "message":"MANAGE-INVALID (err:FOER0000): task-database"}} Error occurred while sending PUT request to /manage/v2/tasks/5389046897270663947/properties?group-id=Default; logging request body to assist with debugging: {

Expectation :

wants to deploy and undeploy whole application including schedules tasks based on APPLICATION-NAME as seperate instance

Actual:

the mlDeployTasks based on the module-path each task is identified with old existing database and fails to create a new task server.

Please suggest me the right way to achieve the same

mpuram
  • 149
  • 9

2 Answers2

1

MarkLogic's Management API is seeing your request as an attempt to change the task-database, but it only allows one property for a scheduled task to change (task-enabled). I think what you'll need to do here is have different task-path values for your different databases. That's not ideal, but if the implementation logic is all in a library that's imported by the task, the different modules themselves will be very lightweight.

Dave Cassel
  • 8,352
  • 20
  • 38
  • 1
    Hi @Dave Cassel , the suggestion provided by you is helpful but in my case it will be difficult to change task-path everytime. I am to do whole application instance setup based on application-name which makes me flexible to setup any number of instances on the same marklogic environment with just a single application-name change in property files. – mpuram Feb 01 '19 at 17:35
1

Try ml-gradle 3.10.0 - support for this now exists - see the release notes for ml-app-deployer 3.10.0 (which provides most of the functionality in ml-gradle) - https://github.com/marklogic-community/ml-app-deployer/releases/tag/3.10.0

rjrudin
  • 2,108
  • 9
  • 7
  • thanks for the providing information about ml-gradle 3.10.0 , it helped me partially. I could see **mlUndeployTasks** not working in ml-gradle 3.10.0 , I could not able to Undeploy Tasks where as mldeleteAllTasks working fine. Could you please assist me if 3.10.0 is having issue or I am something wrong? – mpuram Feb 01 '19 at 17:29
  • If you can share a minimal config for your project - perhaps just the two scheduled tasks? - please open an issue in the ml-gradle project to track this. – rjrudin Feb 03 '19 at 16:41
  • Hi @rjrudin , I have created an issue in ml-gradle project for tracking [link](https://github.com/marklogic-community/ml-gradle/issues/427) – mpuram Feb 03 '19 at 22:48
  • The configurations are as below ml-gradle : 3.10.0 JSON : as mentioned in Question Changes in two tasks : task-database,task-modules &task-user change "task-database":"%%DATABASE%%", "task-modules":"%%MODULES_DATABASE%%", "task-user":"%%User%%", – mpuram Feb 03 '19 at 23:02