Skip to content

Commit

Permalink
Made changes for marklogic-community#312 more robust, added restart c…
Browse files Browse the repository at this point in the history
…luster feature
  • Loading branch information
grtjn committed Dec 10, 2014
1 parent fb6369f commit 5237992
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 392 deletions.
22 changes: 17 additions & 5 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,23 @@ def restart
logger.debug "this: #{self}"
setup = File.read ServerConfig.expand_path("#{@@path}/lib/xquery/setup.xqy")
r = execute_query %Q{#{setup} setup:do-restart("#{group}")}
logger.debug "code: #{r.code.to_i}"

r.body = parse_json(r.body)
logger.info r.body
end

def config
setup = File.read ServerConfig.expand_path("#{@@path}/lib/xquery/setup.xqy")
r = execute_query %Q{#{setup} setup:rewrite-config(#{get_config})}
r = execute_query %Q{
#{setup}
try {
setup:rewrite-config(#{get_config})
} catch($ex) {
xdmp:log($ex),
fn:concat($ex/err:format-string/text(), '
See MarkLogic Server error log for more details.')
}
}
logger.debug "code: #{r.code.to_i}"

r.body = parse_json(r.body)
Expand Down Expand Up @@ -544,10 +556,10 @@ def wipe
logger.debug r.body

if r.body.match("RESTART_NOW")
logger.warn "************************************"
logger.warn "*** RESTART OF MARKLOGIC IS REQUIRED"
logger.warn "************************************"
logger.info "... Wipe NOT Complete, rerun wipe after restart to complete!"
logger.warn "***************************************"
logger.warn "*** WIPE NOT COMPLETE, RESTART REQUIRED"
logger.warn "***************************************"
logger.info "... NOTE: RERUN WIPE AFTER RESTART TO COMPLETE!"
return false
elsif r.body.match("<error:error") || r.body.match("error log")
logger.error r.body
Expand Down
Loading

0 comments on commit 5237992

Please sign in to comment.