The V7 REST API has this feature for several critical admin functions. See here for an example. https://docs.marklogic.com/REST/DELETE/admin/v1/host-config
This is used in the AWS/EC2 management in order to determine when (and which) host(s) need restarting. Even with this it can be tricky as there are occasions when a host is in the middle of processing a restart and the REST API fails - in which case its not always known if a restart is needed or if the API needs to be called again - Usually this is not an issue but if your configuring the system while it's in the process of starting up for the first time or joining or rejoining a cluster or if other calls that alter the configuration and may cause a restart are pending you need to be very conservative or aggressive dealing with errors. This may also be a strong case for not running the configuration code itself within XQuery - but rather from outside ... depending on how resilient it needs to be in these cases. ( You can't retry test or retry in a query if the server itself shuts down before your done) ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected] Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected] [mailto:[email protected]] On Behalf Of Danny Sokolsky Sent: Thursday, October 23, 2014 1:11 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] How to tell if restart required? One other (low-tech) idea is to look at the list of cod tasks and do some static analysis on your code. There are relatively few cold tasks, and most of the cold tasks are app-server related (like removing ports and so forth). -Danny From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Whitby, Rob Sent: Thursday, October 23, 2014 8:39 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] How to tell if restart required? Hi Ken, Yep I saw in xdmp:host-status there is a timestamp for those config files. But I think this method will just tell me if there is a change - not if it requires a restart. My plan at the moment is to add the host ids returned from admin:save-configuration-without-restart() to a map in a server field. Thanks Rob From: Ken Tune <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Thursday, 23 October 2014 16:24 To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] How to tell if restart required? Rob All the 'cold' changes affect either all hosts in a group or none ( with the exception of mimetypes, which is global ) http://docs.marklogic.com/guide/admin/hotcold#chapter so you could possibly experiment with looking at the last write time of the relevant configuration file ( i.e. groups.xml / mimetypes.xml ), via xdmp:filesystem-directory ( e.g. groups.xml ) and comparing that with the last restart time ( via xdmp:host-status ) Ken Tune From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Dave Cassel Sent: 23 October 2014 16:09 To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] How to tell if restart required? I just ran a quick test to see whether re-running admin:save-configuration-without-restart() with the results of admin:get-config() would give you that list, but it doesn't. I think your options are to write the list of servers that need restart into the database or handle it at the client level (have your calls return the list and output or track that). -- Dave Cassel Developer Community Manager MarkLogic Corporation<http://www.marklogic.com/> Cell: +1-484-798-8720 From: <Whitby>, Rob <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Thursday, October 23, 2014 at 10:44 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] How to tell if restart required? Hi, I¹m using admin:save-configuration-without-restart() in setup scripts, I know it returns a list of hosts that require a restart, but would like to get that information independently, so I can run a bunch of scripts and then check what needs restarting. Something like admin:get-hosts-requiring-restart(). I was hoping it would be in xdmp:host-status() but seems not. Thanks Rob _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
