Skip to content
lvca edited this page Dec 10, 2012 · 1 revision

OrientDB Server

<wiki:toc max_depth="4" />

Introduction

OrientDB Server (DB-Server from now) is a multi-thread Java application that listen remote commands and execute them against the Orient databases. OrientDB Server supports both binary and HTTP protocols. The first one is used by Orient native client and Orient Console. The second one can be used by any languages since it's based on HTTP RESTful API. The HTTP protocol is used also by the OrientDB Studio application.

Start the server

To start the server execute the script bin/orient-db.sh (or bin/orient-db.bat in MS Windows systems). By default both interfaces are active: binary and http. If you want to disable one of these change the Server configuration.

When the server starts try to acquire the port 2424 for the binary protocol and 2480 for the HTTP one. If some port is busy the next one will be taken until the port it's free. By default the range for binary protocol is 2424-2430 and 2480-2490 for the http one, but you can always change these settings in Server configuration.

Stop the server

To stop a running server just press CTRL+C in the open window that runs the Server instance or soft kill the process to be sure that the opened databases close softly. Soft kill in MS Windows systems can be done by closing the window. In Unix like systems a kill it's enought (Don't use kill -9 unless you want to force a hard shutdown).

Connect to the server

Console

The OrientDB distribution provides the Console Commands tool as a console Java application that uses the binary protocol to work with the database.

OrientDB Studio

Starting from the release 0.9.13 Orient comes with the OrientDB Studio application, a client-side web app that uses the HTTP protocol to work with the database.

Write your application

To start writing your first application with Orient you need to consider the language to use. If you plan to use Java you can use the native APIs. For all the other languages you can use the HTTP RESTful protocol.

Cluster

To know more about the usage of a configuration of multiple servers in cluster look at Clustering.

Configuration

Default configuration

This is the content of the default config/orientdb-server.config file contained in the distribution:

    <!-- Enable/Disable logging. Levels are: finer, fine, finest, info, warning -->
    <entry name="log.console.level" value="info" />
    <entry name="log.file.level" value="fine" />
  </properties>
</orient-server>

Disable distributed configuration

If you don't want to run multiple OrientDB server instances in cluster you can disable it by removing the Distributed Server Manager handler and change the default listen protocol from "distributed" in "binary".

Example of single server configuration:

  <!-- Enable/Disable logging. Levels are: finer, fine, finest, info, warning -->
  <entry name="log.console.level" value="info" />
  <entry name="log.file.level" value="fine" />
 </properties>
</orient-server>

Change the Server's database directory

By default OrientDB server manages the database under the directory "$ORIENTDB_HOME/databases" where $ORIENTDB_HOME is the OrientDB installation directory. By setting the configuration parameter {{{"server.database.path"}}} in server orientdb-server-config.xml you can specify a custom path. Example: ... />

Lvc@

Plugins

Plug-ins (old name "Handler") are the way the OrientDB Server can be extended.

To write your own plug-in read below Extend the server.

Available plugins:

Protocols

Contains the list of protocols used by the listeners section. The protocols supported today are:

  • binary: the Raw binary protocol used by OrientDB clients and console application.
  • http: the HTTP RESTful protocol used by OrientDB Studio and direct raw access from any language and browsers.

Listeners

You can configure multiple listeners by adding items under the {{{}}} tag and selecting the ip-address and TCP/IP port to bind. The protocol used must be listed in the protocols section. Listeners can be configured with single port or port range. If a range of ports is specified, then it will try to acquire the first port available. If no such port is available, then an error is thrown. By default the Server configuration activates connections from both the protocols:

  • binary: by default the binary connections are listened to the port range 2424-2430.
  • http: by default the HTTP connections are listened to the port range 2480-2490.

Storages

Contains the list of the static configured storages. When the server starts for each storages static configured storage enlisted check if exists. If exists opens it, otherwise creates it transparently.

By convention all the storages contained in the $ORIENT_HOME/databases are visible from the OrientDB Server instance without the need of configure them. So configure storages if:

  • are located outside the default folder. You can use any environment variable in the path such the ORIENT_HOME that points to the Orient installation path if defined otherwise to the root directory where the Orient Server starts.
  • want to create/open automatically a database when the server start ups

By default the "temp" database is always configured as in-memory storage useful to store volatile information.

Example of configuration:

To create a new database use the CREATE DATABASE console command or create it dinamically using the Java API.

Users

Starting from v.0.9.15 OrientDB supports per-server users in order to protect sensible operations to the users. In facts the creation of a new database is a server operation as much as the retrieving of server statistics.

Automatic password generation

When an OrientDB server starts for the first time, a new user called "root" will be generated and saved in the server configuration. This avoid security problems when, very often, the passwords remain the default ones.

Resources

User based authentication checks if the logged user has the permission to access to the requested resource. "*" means access to all the resource. This is the typical setting for the user "root". Multiple resources must be separated by comma.

Example to let to the "root" user to access to all the server commands:

<user name="root" resources="*" password="095F17F6488FF5416ED24E"/>

Example to let to the "guest" user to access only to the "info-server" command:

<user name="guest" resources="info-server" password="3489438DKJDK4343UDH76"/>

Supported resources are:

  • {{{info-server}}}, to obtain statistics about the server
  • {{{database.create}}}, to create a new database
  • {{{database.exists}}}, to check if a database exists
  • {{{database.delete}}}, to delete an existent database
  • {{{database.share}}}, to share a database to another OrientDB Server node
  • {{{database.passthrough}}}, to access to the hosted databases without database's authentication
  • {{{server.config.get}}}, to retrieve a configuration setting value
  • {{{server.config.set}}}, to set a configuration setting value

Create new user with some privileges

To configure a new user open the config/orientdb-server-config.xml file and add a new XML tag under the tag {{{}}}:

<users>
  <user name="MyUser" password="MyPassword" resources="database.exists"/>
  </users>

Extend the server

To extend the server's features look at Extend Server.

Debug the server

To debug the server configure your IDE to execute the class OServerMain: com.orientechnologies.orient.server.OServerMain

Passing these parameters: -server -Dorientdb.config.file=config/orientdb-server-config.xml -Dorientdb.www.path=src/site -DORIENTDB_HOME=url/local/orientdb/releases/orientdb-1.2.0-SNAPSHOT -Djava.util.logging.config.file=config/orientdb-server-log.properties -Dcache.level1.enabled=false -Dprofiler.enabled=true

Changing the ORIENTDB_HOME according to your path.

Benchmarks

Database Benchmarks.

Roadmap

Roadmap.

Roadmap wiki page

History

Change history.

Clone this wiki locally