Access Logs across a cluster

时光毁灭记忆、已成空白 提交于 2019-12-10 17:03:27

问题


I have a cluster with 3 nodes. I have Database with App Server configured.

I would like to know If the access logs generated are same across the hosts in a cluster

Or each host has a separate "Access log" that logs request to their hosts.

I know that Each host in a cluster maintains its own audit log files. Does it work the same way for Access logs.

Thanks, Karthik


回答1:


All MarkLogic Logs on a host only contain info about that host.

HTH!




回答2:


You can access files on all hosts in a cluster using any of the filesystem related xdmp functions such as xdmp:filesystem-file using the URI "file://host/file" where 'host' is the hostname as defined in that marklogic server, not always the same as the DNS hostname.

e.g.:

for $hid in xdmp:hosts()
let $h := xdmp:host-name($hid)
return 
xdmp:filesystem-file("file://" || $h || "/"||xdmp:data-directory($hid)||"/Logs/ErrorLog.txt")

Will return all ErrorLog.txt contents from all hosts in the cluster

In V9 there is a REST API for accessing logfiles across hosts in a cluster, including optimized searching based on time range and regex

See /manage/v2/logs

As with all REST API endpoints, the current implementation can be inferred by inspecting the source for the REST API included in the publicly available ML V9 distribution.



来源:https://stackoverflow.com/questions/37331718/access-logs-across-a-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!