-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from sravotto/doc
setup + minimal readme
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
** Query Plan Viewer | ||
|
||
The Query Plan Viewer displays in a graphical interface optimization and diagnostic plans produced by the MarkLogic Optic and SPARQL engine. | ||
|
||
** Setup | ||
|
||
On the host where MarkLogic server is running, execute: | ||
|
||
./setup.sh ---user=ADMIN_USER --pass=ADMIN_PASS --port=PORT | ||
|
||
It will create an http server on the specified port. | ||
|
||
Access the Query Plan Viewer: | ||
|
||
http://MARKLOGIC_HOST:PORT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#! /bin/bash | ||
|
||
usage() | ||
{ | ||
cat <<-EOF 1>&2 | ||
use: setup.sh [OPTIONS]* | ||
Options: Default | ||
--host=HOST localhost | ||
--port=PORT 9999 | ||
--user=USE admin | ||
--pass=PAS admin | ||
--dir=DIR current dir | ||
--group=GROUP Default | ||
EOF | ||
exit 1 | ||
} | ||
|
||
|
||
|
||
HOST=localhost | ||
PORT=9999 | ||
USER=admin | ||
PASS=admin | ||
DIR="$PWD/${1#./}" | ||
GROUP="Default" | ||
|
||
while [ $# != 0 ]; do | ||
case "$1" in | ||
--host=*) | ||
HOST=$(echo $1 | sed 's%--host=%%') | ||
shift;; | ||
--port=*) | ||
PORT=$(echo $1 | sed 's%--port=%%') | ||
shift;; | ||
--dir=*) | ||
DIR=$(echo $1 | sed 's%--dir=%%') | ||
shift;; | ||
--user=*) | ||
USER=$(echo $1 | sed 's%--user=%%') | ||
shift;; | ||
--pass=*) | ||
PASS=$(echo $1 | sed 's%--pass=%%') | ||
shift;; | ||
--group=*) | ||
GROUP=$(echo $1 | sed 's%--group=%%') | ||
shift;; | ||
-?) | ||
usage | ||
;; | ||
*) | ||
echo "Bad option - $1" | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
CURL="curl --anyauth --user ${USER}:${PASS} -s -S" | ||
|
||
|
||
|
||
$CURL -X POST -d @- -H "Content-type: application/json" \ | ||
"http://${HOST}:8002/manage/v2/servers" <<-EOF | ||
{ "server-name": "${PORT}-queryplan-viewer", | ||
"server-type": "http", | ||
"group-name": "$GROUP", | ||
"root": "${DIR}", | ||
"port": $PORT, | ||
"content-database": "Documents", | ||
"threads": 32, | ||
"error-handler" : "/MarkLogic/rest-api/error-handler.xqy" | ||
} | ||
EOF | ||
|