mirror of https://gitee.com/bigwinds/arangodb
212 lines
17 KiB
HTML
212 lines
17 KiB
HTML
<html><head><title>ArangoDB Manual</title> <style media="screen" type="text/css" style="display:none">body{background-color:white;font:13px Helvetica,arial,freesans,clean,sans-serif;line-height:1.4;color:#333;}#access{font-size:16px;margin-left:12px;display:block;margin-left:10px;margin-right:10px;background-color:#F3F1EE!important;}#access a{border-right:1px solid #DBDEDF;color:#A49F96;display:block;line-height:38px;padding:0 10px;text-decoration:none;}#navigation ul{text-transform:uppercase;list-style:none;margin:0;}#navigation li{float:left;position:relative;}#container{width:920px;margin:0 auto;}a{color:#4183C4;text-decoration:none;}.contents h2{font-size:24px;border-bottom:1px solid #CCC;color:black;}.contents h1{font-size:33px;border-bottom:1px solid #CCC;color:black;}.clearfix:after{content:".";display:block;clear:both;font-size:0;height:0;visibility:hidden;}/**/ *:first-child+html .clearfix{min-height:0;}/**/ * html .clearfix{height:1%;}</style></head><body><div id="container"><img src="images/logo_arangodb.png" width="397" height="67" alt="ArangoDB"><div id="access" role="navigation"><div id="navigation"><ul id="menu-ahome" class="menu"><li><a href="Home.html">Table of contents</a></li> <li><a href="http://www.arangodb.org">ArangoDB homepage</a></li></ul></div><div class="clearfix"></div></div><div>
|
|
<!-- Generated by Doxygen 1.7.5.1 -->
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<h1>About ArangoDB </h1> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<div class="textblock"><p>We recently started a new open source project - a universal nosql database called AvocadoDB which became ArangoDB in May 2012.</p>
|
|
<p>Key features include:</p>
|
|
<ul>
|
|
<li>
|
|
Schema-free schemata let you combine the space efficiency of MySQL with the performance power of NoSQL </li>
|
|
<li>
|
|
Use ArangoDB as an application server and fuse your application and database together for maximal throughput </li>
|
|
<li>
|
|
JavaScript for all: no language zoo, you can use one language from your browser to your back-end </li>
|
|
<li>
|
|
ArangoDB is multi-threaded - exploit the power of all your cores </li>
|
|
<li>
|
|
Flexible data modeling: model your data as combination of key-value pairs, documents or graphs - perfect for social relations </li>
|
|
<li>
|
|
Free index choice: use the correct index for your problem, be it a skip list or a n-gram search </li>
|
|
<li>
|
|
Configurable durability: let the application decide if it needs more durability or more performance </li>
|
|
<li>
|
|
No-nonsense storage: ArangoDB uses all of the power of modern storage hardware, like SSD and large caches </li>
|
|
<li>
|
|
It is open source (Apache Licence 2.0) </li>
|
|
</ul>
|
|
<p>For more in-depth information</p>
|
|
<ul>
|
|
<li>
|
|
read more on the <a href="http://www.arangodb.org/2012/03/07/avocadodbs-design-objectives">design goals of ArangoDB</a> </li>
|
|
<li>
|
|
<a href="http://vimeo.com/36411892">watch the video</a> - Martin Schoenert, architect of ArangoDB, gives an introduction of what the ArangoDB project is about. </li>
|
|
<li>
|
|
or give it a <a href="http://www.arangodb.org/try">try</a>. </li>
|
|
</ul>
|
|
<p>The ArangoDB database groups documents into collections. Collections and documents can be accessed using queries. For simple queries involving just one collection and one search criteria, you can use a simple interface from within JavaScript code or other languages supported by an API. This interface allows you to select documents from one collection based on just one search criteria. For more complex queries, you can use the Arango Query Language (AQL), which is an evolution of SQL resp. UNQL for the NoSQL world. AQL allows you to use more then one collection, similar to joins from SQL, while still retaining the document and list structures like UNQL.</p>
|
|
<p>The ArangoDB database packages comes with various programs:</p>
|
|
<ul>
|
|
<li><code>arangod</code>: The ArangoDB database daemon. This server program is intended to run as daemon process and to server the various clients connection to the server via TCP / HTTP. See <a class="el" href="UserManualBasics.html#UserManualServerStartStop">Starting the ArangoDB Server</a>.</li>
|
|
<li><code>arangosh</code>: The ArangoDB shell. A client that implements a read-eval-print loop (REPL) and provides functions to access and administrate the ArangoDB server. See <a class="el" href="UserManualBasics.html#UserManualShellStartStop">Starting the ArangoDB Shell</a>.</li>
|
|
<li><code>arangoimp</code>: A bulk importer for the ArangoDB server. See <a class="el" href="ImpManual.html">ArangoDB Importer Manual (1.0.0)</a></li>
|
|
</ul>
|
|
<hr/>
|
|
<ul>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html">About ArangoDB</a> <ul>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualServerStartStop">Starting the ArangoDB Server</a> <ul>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualServerStartStopOptions">Frequently Used Options</a> </li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualServerFE">ArangoDB's Front-End</a> </li>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualShellStartStop">Starting the ArangoDB Shell</a> <ul>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualShellStartStopOptions">Command-Line Options</a> </li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<a class="el" href="UserManualBasics.html#UserManualServerStartStopDebug">Starting the ArangoDB Emergency Console</a> </li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
<h2><a class="anchor" id="UserManualServerStartStop"></a>
|
|
Starting the ArangoDB Server</h2>
|
|
<p>The ArangoDB database server has two modes of operation: as server, where it will answer to client requests, and an emergency console, in which you can access the database directly. The latter - as the name suggests - should only be used in case of an emergency, for example, a corrupted collection. Using the emergency console allows you to issue all commands normally available in actions and transactions. When starting the server in emergency console mode, the server cannot handle any client requests.</p>
|
|
<p>You should never start more than one server using the same database directory, independent from the mode of operation. Normally ArangoDB will prevent you from doing this by placing a lockfile in the database directory and not allowing a second ArangoDB instance to use the same database directory if a lockfile is already present.</p>
|
|
<p>The following command starts the ArangoDB database in server mode. You will be able to access the server using HTTP requests on port 8529. See <a class="el" href="UserManualBasics.html#UserManualServerStartStopOptions">below</a> for a list of frequently used options, see <a class="el" href="CommandLine.html">here</a> for a complete list.</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangod /tmp/vocbase
|
|
2012-05-13T12:37:08Z [8145] INFO using built-in JavaScript startup files
|
|
2012-05-13T12:37:08Z [8145] INFO ArangoDB (version 1.x.y) is ready for business
|
|
2012-05-13T12:37:08Z [8145] INFO Have Fun!
|
|
</pre></div> <p>After starting the server, point your favorite browser to:</p>
|
|
<p><code><a href="http://localhost:8529/">http://localhost:8529/</a></code></p>
|
|
<p>to access the administration front-end.</p>
|
|
<p>To start the server at system boot time, you should use one of the pre-rolled packages that will install the necessary start / stop scripts for ArangoDB. To start and stop the server manually, you can use the start / stop script like this (provided the start / stop script is located in /etc/init.d/arangod, the command actual name and invocation are platform-dependent):</p>
|
|
<p><code>/etc/init.d/arangod start</code></p>
|
|
<p>To stop the server, you can use the command</p>
|
|
<p><code>/etc/init.d/arangod stop</code></p>
|
|
<p>You may require root privileges to execute these commands.</p>
|
|
<p>If you compiled ArangoDB from source and did not use any installation package, or you are using non-default locations and/or multiple ArangoDB instances on the same host, you may want to start the server process manually. You can do so by invoking the arangod binary from the command line as shown before. To stop the database server gracefully, you can either pressCTRL-C or by send the SIGINT signal to the server process. On many systems, this can be achieved with the following command:</p>
|
|
<p><code>kill -2 `pidof arangod`</code></p>
|
|
<h3><a class="anchor" id="UserManualServerStartStopOptions"></a>
|
|
Frequently Used Options</h3>
|
|
<p>The following command-line options are frequently used. For a full list of options see <a class="el" href="CommandLine.html">here</a>.</p>
|
|
<hr/>
|
|
<code><b><em>database-directory</em></b></code><hr/>
|
|
<p>Uses the <em>database-directory</em> as base directory. There is an alternative version available for use in configuration files, see <a class="el" href="CommandLine.html#CommandLineArango">here</a>.</p>
|
|
<hr/>
|
|
<code><b>--help</b></code><hr/>
|
|
<hr/>
|
|
<code><b>-h</b></code><hr/>
|
|
Prints a list of the most common options available and then exits. In order to see all options use <code>--help-all</code>. </p>
|
|
<hr/>
|
|
<code><b>--log <em>level</em></b></code><hr/>
|
|
<p>Allows the user to choose the level of information which is logged by the server. The <em>level</em> is specified as a string and can be one of the following values: fatal, error, warning, info, debug, trace. For more information see <a class="el" href="CommandLine.html#CommandLineLogging">here</a>.</p>
|
|
<hr/>
|
|
<code><b>--server.endpoint <em>endpoint</em></b></code><hr/>
|
|
Specifies an <em>endpoint</em> for HTTP requests by clients. Endpoints have the following pattern:</p>
|
|
<ul>
|
|
<li>tcp://ipv4-address:port - TCP/IP endpoint, using IPv4</li>
|
|
<li>tcp://[ipv6-address]:port - TCP/IP endpoint, using IPv6</li>
|
|
<li>ssl://ipv4-address:port - TCP/IP endpoint, using IPv4, SSL encryption</li>
|
|
<li>ssl://[ipv6-address]:port - TCP/IP endpoint, using IPv6, SSL encryption</li>
|
|
<li>unix:///path/to/socket - Unix domain socket endpoint</li>
|
|
</ul>
|
|
<p>If a TCP/IP endpoint is specified without a port number, then the default port (8529) will be used. If multiple endpoints need to be used, the option can be repeated multiple times.</p>
|
|
<p><b>Examples</b><br/>
|
|
</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangod --server.endpoint tcp://127.0.0.1:8529 --server.endpoint ssl://127.0.0.1:8530 -server.keyfile server.pem /tmp/vocbase
|
|
2012-07-26T07:07:47Z [8161] INFO using SSL protocol version 'TLSv1'
|
|
2012-07-26T07:07:48Z [8161] INFO using endpoint 'ssl://127.0.0.1:8530' for http ssl requests
|
|
2012-07-26T07:07:48Z [8161] INFO using endpoint 'tcp://127.0.0.1:8529' for http tcp requests
|
|
2012-07-26T07:07:49Z [8161] INFO ArangoDB (version 1.1.alpha) is ready for business
|
|
2012-07-26T07:07:49Z [8161] INFO Have Fun!
|
|
</pre></div><p>Note that if you are using SSL-encrypted endpoints, you must also supply the path to a server certificate using the --server.keyfile optionn. </p>
|
|
<hr/>
|
|
<code><b>--server.disable-authentication <em>value</em></b></code><hr/>
|
|
Setting <em>value</em> to true will turn off authentication on the server side so all clients can execute any action without authorisation and privilege checks.</p>
|
|
<p>The default value is <code>false</code>. </p>
|
|
<hr/>
|
|
<code><b>--server.keep-alive-timeout</b></code><hr/>
|
|
Allows to specify the timeout for HTTP keep-alive connections. The timeout value must be specified in seconds. Idle keep-alive connections will be closed by the server automatically when the timeout is reached. A keep-alive-timeout value 0 will disable the keep alive feature entirely. </p>
|
|
<hr/>
|
|
<code><b>--daemon</b></code><hr/>
|
|
<p>Runs the server as a daemon (as a background process).</p>
|
|
<h2><a class="anchor" id="UserManualServerFE"></a>
|
|
ArangoDB's Front-End</h2>
|
|
<p>The ArangoDB server has a graphical front-end, which allows you to inspect the current state of the server. You can read the front-end using the following URL:</p>
|
|
<p><code><a href="http://localhost:8529/_admin">http://localhost:8529/_admin</a></code></p>
|
|
<p>Unless you have loaded an application into the ArangoDB server, which remaps the paths, the front-end will also be available under</p>
|
|
<p><code><a href="http://localhost:8529/">http://localhost:8529/</a></code>.</p>
|
|
<img src="images/front-end-example-1.png" alt="ArangoDB Front-End"> <p>The front-end allows you the browser through the collections and documents. If you need to administrate the database, please use the ArgangoDB shell described in the next section.</p>
|
|
<h2><a class="anchor" id="UserManualShellStartStop"></a>
|
|
Starting the ArangoDB Shell</h2>
|
|
<p>After the server has been <a class="el" href="UserManualBasics.html#UserManualServerStartStop">started</a>, you can use the ArangoDB shell (arangosh) to administrate the server. Without any arguments, the ArangoDB shell will try to contact the server on port 8529 on the localhost. For more information see <a class="el" href="UserManualArangosh.html">The Arango Shell</a>.</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangosh
|
|
_
|
|
__ _ _ __ __ _ _ __ __ _ ___ ___| |__
|
|
/ _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \
|
|
| (_| | | | (_| | | | | (_| | (_) \__ \ | | |
|
|
\__,_|_| \__,_|_| |_|\__, |\___/|___/_| |_|
|
|
|___/
|
|
|
|
Welcome to arangosh 1.x.y. Copyright (c) 2012 triAGENS GmbH.
|
|
Using Google V8 3.9.4 JavaScript engine.
|
|
Using READLINE 6.1.
|
|
|
|
Connected to Arango DB 127.0.0.1:8529 Version 1.x.y
|
|
|
|
------------------------------------- Help -------------------------------------
|
|
Predefined objects:
|
|
arango: ArangoConnection
|
|
db: ArangoDatabase
|
|
Example:
|
|
> db._collections(); list all collections
|
|
> db.<coll_name>.all(); list all documents
|
|
> id = db.<coll_name>.save({ ... }); save a document
|
|
> db.<coll_name>.remove(<_id>); delete a document
|
|
> db.<coll_name>.document(<_id>); get a document
|
|
> help show help pages
|
|
> helpQueries query help
|
|
> exit
|
|
arangosh>
|
|
</pre></div> <p>You might need to set additional options (endpoint, username, and password) when connecting:</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root
|
|
</pre></div><p>The shell will print its own version number and, if successfully connected to a server, the version number of the ArangoDB server.</p>
|
|
<h3><a class="anchor" id="UserManualShellStartStopOptions"></a>
|
|
Command-Line Options</h3>
|
|
<p>Use <code>--help</code> to get a list of command-line options:</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangosh --help
|
|
STANDARD options:
|
|
--help help message
|
|
--javascript.modules-path <string> one or more directories separated by cola (default: "bin/../js/client/modules;bin/../js/common/modules")
|
|
--javascript.startup-directory <string> startup paths containing the JavaScript files; multiple directories can be separated by cola
|
|
--javascript.unit-tests <string> do not start as shell, run unit tests instead
|
|
--jslint <string> do not start as shell, run jslint instead
|
|
--log.level <string> log level (default: "info")
|
|
--max-upload-size <uint64> maximum size of import chunks (in bytes) (default: 500000)
|
|
--no-auto-complete disable auto completion
|
|
--no-colors deactivate color support
|
|
--pager <string> output pager (default: "less -X -R -F -L")
|
|
--pretty-print pretty print values
|
|
--quiet no banner
|
|
--server.connect-timeout <int64> connect timeout in seconds (default: 3)
|
|
--server.endpoint <string> endpoint to connect to, use 'none' to start without a server (default: "tcp://127.0.0.1:8529")
|
|
--server.password <string> password to use when connecting (leave empty for prompt)
|
|
--server.request-timeout <int64> request timeout in seconds (default: 300)
|
|
--server.username <string> username to use when connecting (default: "root")
|
|
--use-pager use pager
|
|
</pre></div> <h2><a class="anchor" id="UserManualServerStartStopDebug"></a>
|
|
Starting the ArangoDB Emergency Console</h2>
|
|
<p>The following command starts a emergency console. See below for a list of frequently used options, see <a class="el" href="CommandLine.html">here</a> for a complete list.</p>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>Never start the emergency console for a database which also has a server attached to it. In general the ArangoDB shell is what you want.</dd></dl>
|
|
<div class="fragment"><pre class="fragment">> ./arangod --console --log error /tmp/vocbase
|
|
ArangoDB shell [V8 version 3.9.4, DB version 1.x.y]
|
|
|
|
arango> 1 + 2;
|
|
3
|
|
|
|
arango> db.geo.count();
|
|
703
|
|
</pre></div> </div></div>
|
|
</div></body></html>
|