HTTP Servers, Database, Forest
HTTP Server(Hypertext Transfer Protocol):
An HTTP Server is an application server with HTTP support and XQuery support, providing a server from which you execute XQuery programs via HTTP.
You can create an HTTP server through the Admin UI page of the MarkLogic server. Please refer the screenshot-1 for the same.
Screenshot-1:
Or, You can also create an HTTP server with the help of the admin API function,
(:Import admin api:)
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
(:Get the Config file of server:)
let $config := admin:get-configuration()
(: Get the Group ID file of server, if have created multiple Groups, please specify the Group name else it will be 'Default':)
let $groupid := admin:group-get-id($config, "Default")
(:
Below is the function for creating the Server,
It will take 7 parameters as mentioned below.
1. config file of Marklogic server.
2. Group ID
3. Server name which you want to create
4. Root directory, use '/' if you use module database else give the path of file directory.
5. New port no.
6. Module database Name, use 0 if you want to use filesystem directory instead of module database.
7. Main DB name
:)
let $server-create := admin:http-server-create($config, $groupid, "myNewAppServer", "/", 8007, 0, xdmp:database("testing-db") )
(:Save the configuration file create by server functions:)
return admin:save-configuration($server-create)
WebDAV Server:
A WebDAV Server allows access to a database via a WebDAV client. A WebDAV server also allows HTTP access to the server, but you cannot execute XQuery code against it.
XDBC (XML Database Connector):
An XDBC Server is an App Server that accepts requests from an XCC(XML Contentbase Connector) or XDBC(XML Database Connector) client and returns the results to the client.
ODBC server(Open Database Connectivity):
The basic purpose of an ODBC server is to return relational-style data resident in MarkLogic Server in response to SQL queries.
Database:
A database is a layer of abstraction between forests and HTTP, WebDAV, or XDBC servers.
- Multiple HTTP, XDBC, and WebDAV servers can be connected to the same database.
You can create an database through the Admin UI page of the MarkLogic server. Please refer the screenshot-2 for the same.
screenshot-2:
Below is the function for creating the Databases,
It will take 4 parameters as mentioned below.
1. config file of Marklogic server.
2. New DB name which you want to create
(:Save the configuration file create by DB functions:)
- During installation, a database named Modules is created, but any database can be used as a modules database, as long as the HTTP or XDBC server is configured to use it as a modules database.
- Also, it is possible to use the same database to store executable modules, to store queryable documents, and/or to store triggers.
- A forest can only be attached to one database at a time.
- You cannot load data into a forest that is not attached to a database.
screenshot-3
Or, You can also create an forest with the help of the admin API function.
Comments
Post a Comment