Orientdb-installation

提供:Dev Guides
移動先:案内検索

OrientDB-インストール

OrientDBインストールファイルは2つのエディションで利用可能です-

  • コミュニティエディション-OrientDBコミュニティエディションは、オープンソースとして0.2ライセンスでApacheによってリリースされます。
  • Enterprise Edition -OrientDBエンタープライズエディションは、コミュニティエディション上に構築された独自のソフトウェアとしてリリースされます。 コミュニティ版の拡張機能として機能します。

この章では、OrientDBコミュニティエディションはオープンソースであるため、インストール手順について説明します。

前提条件

コミュニティエディションとエンタープライズエディションの両方は、Java仮想マシン(JVM)を実装する任意のオペレーティングシステムで実行できます。 OrientDBには、1.7以降のバージョンのJavaが必要です。

次の手順を使用して、OrientDBをダウンロードしてシステムにインストールします。

ステップ1-OrientDBバイナリセットアップファイルのダウンロード

OrientDBには、システムにデータベースをインストールするための組み込みセットアップファイルが付属しています。 さまざまなオペレーティングシステム向けに、さまざまなプリコンパイル済みバイナリパッケージ(tarまたはzip形式のパッケージ)を提供します。 OrientDBファイルは、http://orientdb.com/download/[OrientDBのダウンロード]リンクからダウンロードできます。

次のスクリーンショットは、OrientDBのダウンロードページを示しています。 適切なオペレーティングシステムアイコンをクリックして、zipファイルまたはtarファイルをダウンロードできます。

OrientDBのダウンロードページ

ダウンロードすると、 Downloads フォルダーにバイナリパッケージが取得されます。

ステップ2-OrientDBの抽出とインストール

以下は、さまざまなオペレーティングシステム用にOrientDBを抽出してインストールする手順です。

Linuxの場合

ダウンロード後、 Downloads フォルダーに orientdb-community-2.1.9.tar.gz ファイルを取得します。 次のコマンドを使用して、tarファイルを抽出できます。

$ tar –zxvf orientdb-community-2.1.9.tar.gz

次のコマンドを使用して、すべてのOrientDBライブラリファイルを orientdbcommunity-2.1.9から/opt/orientdb/ ディレクトリに移動できます。 ここでは、スーパーユーザーコマンド(sudo)を使用しているため、次のコマンドを実行するにはスーパーユーザーパスワードを入力する必要があります。

$ sudo mv orientdb-community-2.1.9/opt/orientdb

次のコマンドを使用して、 orientdb コマンドとOrientサーバーを登録できます。

$ export ORIENTDB_HoME =/opt/orientdb
$ export PATH = $PATH:$ORIENTDB_HOME/bin

Windowsの場合

  • ダウンロード後、 Downloads フォルダーに orientdb-community-2.1.9.zip ファイルを取得します。 zip抽出プログラムを使用してzipファイルを抽出します。
  • 抽出したフォルダーを C:\ ディレクトリーに移動します。
  • 次の値を指定して、2つの環境変数ORIENTDB_HOMEおよびPATH変数を作成します。
ORIENT_HOME = C:\orientdb-community-2.1.9
PATH = C:\orientdb-community-2.1.9\bin

ステップ3-OrientDBサーバーをサービスとして設定

上記の手順に従うことにより、OrientDBのデスクトップバージョンを使用できます。 次の手順を使用して、OrientDBデータベースサーバーをサービスとして起動できます。 手順は、オペレーティングシステムによって異なります。

Linuxの場合

OrientDBは、 orientdb.sh という名前のスクリプトファイルを提供して、データベースをデーモンとして実行します。 OrientDBインストールディレクトリのbin/ディレクトリである$ ORIENTDB_HOME/bin/orientdb.shにあります。

スクリプトファイルを実行する前に、2つの変数を定義するために orientdb.sh ファイルを編集する必要があります。 1つはインストールディレクトリ( /opt/orientdb )へのパスを定義する ORIENTDB_DIR で、2つ目は次のようにOrientDBを実行するユーザー名を定義する ORIENTDB_USER です。

ORIENTDB_DIR = "/opt/orientdb"
ORIENTDB_USER = "<username you want to run OrientDB>"

次のコマンドを使用して、スクリプトを初期化および実行するために orientdb.sh ファイルを /etc/init.d/ ディレクトリにコピーします。 ここでは、スーパーユーザーコマンド(sudo)を使用しているため、次のコマンドを実行するにはスーパーユーザーパスワードを入力する必要があります。

$ sudo cp $ORIENTDB_HOME/bin/orientdb.sh/etc/init.d/orientdb

次のコマンドを使用して、Orient DBのコンソールにアクセスするために、 $ ORIENTDB_HOME/bin であるOrientDBインストールディレクトリから /usr/bin であるシステムbinディレクトリにconsole.shファイルをコピーします。

$ sudo cp $ ORIENTDB_HOME/bin/console.sh/usr/bin/orientdb

次のコマンドを使用して、ORIENTDBデータベースサーバーをサービスとして起動します。 ここでは、サーバーを起動するためにorientdb.shファイルで言及したそれぞれのユーザーのパスワードを提供する必要があります。

$ service orientdb start

次のコマンドを使用して、OrientDBサーバーデーモンが実行されているPIDを確認します。

$ service orientdb status

次のコマンドを使用して、OrientDBサーバーデーモンを停止します。 ここでは、サーバーを停止するためにorientdb.shファイルで言及したそれぞれのユーザーのパスワードを提供する必要があります。

$ service orientdb stop

Windowsの場合

OrientDBはサーバーアプリケーションであるため、Java仮想マシンプロセスのシャットダウンを開始する前にいくつかのタスクを実行する必要があります。 OrientDBサーバーを手動でシャットダウンする場合は、 shutdown.bat ファイルを実行する必要があります。 ただし、上記のスクリプトを実行せずにシステムが突然シャットダウンすると、サーバーインスタンスは正しく停止しません。 指定された信号のセットを使用してオペレーティングシステムによって制御されるプログラムは、Windowsでは*サービス*と呼ばれます。

WindowsユーザーがJavaアプリケーションをWindowsサービスとしてラップできるようにする Apache Common Daemon を使用する必要があります。 Apache共通デーモンをダウンロードして登録する手順は次のとおりです。

  • Apache Common Daemons for windowsの次のリンクをクリックします。
  • common-daemon-1.0.15-bin-windows をクリックしてダウンロードします。
  • common-daemon-1.0.15-bin-windows ディレクトリを解凍します。 解凍後、ディレクトリ内に prunsrv.exe および prunmgr.exe ファイルが見つかります。 それらで-
  • prunsrv.exe ファイルは、アプリケーションをサービスとして実行するためのサービスアプリケーションです。
  • prunmgr.exe ファイルは、Windowsサービスの監視と構成に使用されるアプリケーションです。
  • OrientDBインストールフォルダーに移動→新しいディレクトリを作成し、serviceという名前を付けます。
  • prunsrv.exe をコピーし、 prunmgr .exe をサービスディレクトリに貼り付けます。
  • OrientDBをWindowsサービスとして設定するには、prusrv.exeをWindowsサービスとして使用する短いスクリプトを実行する必要があります。
  • Windowsサービスを定義する前に、サービスの名前に応じてprunsrvおよびprunmgrの名前を変更する必要があります。 例えば OrientDBGraphおよびOrientDBGraphw。 ここで、OrientDBGraphはサービスの名前です。
  • 次のスクリプトを installService.bat という名前のファイルにコピーし、*%ORIENTDB_HOME%\ service \ *ディレクトリに配置します。
:: OrientDB Windows Service Installation
@echo off
rem Remove surrounding quotes from the first parameter
set str=%~1
rem Check JVM DLL location parameter
if "%str%" == "" goto missingJVM
set JVM_DLL=%str%
rem Remove surrounding quotes from the second parameter
set str=%~2
rem Check OrientDB Home location parameter
if "%str%" == "" goto missingOrientDBHome
set ORIENTDB_HOME=%str%


set CONFIG_FILE=%ORIENTDB_HOME%/config/orientdb-server-config.xml
set LOG_FILE = %ORIENTDB_HOME%/config/orientdb-server-log.properties
set LOG_CONSOLE_LEVEL = info
set LOG_FILE_LEVEL = fine
set WWW_PATH = %ORIENTDB_HOME%/www
set ORIENTDB_ENCODING = UTF8
set ORIENTDB_SETTINGS = -Dprofiler.enabled = true
-Dcache.level1.enabled = false Dcache.level2.strategy = 1
set JAVA_OPTS_SCRIPT = -XX:+HeapDumpOnOutOfMemoryError


rem Install service
OrientDBGraphX.X.X.exe//IS --DisplayName="OrientDB GraphEd X.X.X" ^
--Description = "OrientDB Graph Edition, aka GraphEd, contains OrientDB server
integrated with the latest release of the TinkerPop Open Source technology
stack supporting property graph data model." ^

--StartClass = com.orientechnologies.orient.server.OServerMain
-StopClass = com.orientechnologies.orient.server.OServerShutdownMain ^

--Classpath = "%ORIENTDB_HOME%\lib\*" --JvmOptions
"Dfile.Encoding = %ORIENTDB_ENCODING%; Djava.util.logging.config.file = "%LOG_FILE%";
Dorientdb.config.file = "%CONFIG_FILE%"; -Dorientdb.www.path = "%WWW_PATH%";
Dlog.console.level = %LOG_CONSOLE_LEVEL%; -Dlog.file.level = %LOG_FILE_LEVEL%;
Dorientdb.build.number = "@BUILD@"; -DORIENTDB_HOME = %ORIENTDB_HOME%" ^

--StartMode = jvm --StartPath = "%ORIENTDB_HOME%\bin" --StopMode = jvm
-StopPath = "%ORIENTDB_HOME%\bin" --Jvm = "%JVM_DLL%"
-LogPath = "%ORIENTDB_HOME%\log" --Startup = auto

EXIT/B

:missingJVM
echo Insert the JVM DLL location
goto printUsage

:missingOrientDBHome
echo Insert the OrientDB Home
goto printUsage

:printUsage
echo usage:
echo     installService JVM_DLL_location OrientDB_Home
EXIT/B

スクリプトには2つのパラメータが必要です-

  • たとえば、jvm.dllの場所。 C:\ ProgramFiles \ java \ jdk1.8.0_66 \ jre \ bin \ server \ jvm.dll
  • OrientDBのインストール場所(例: C:\ orientdb-community-2.1.9
  • このサービスは、OrientDBGraph.exeファイル(Original prunsrv)を実行してダブルクリックするとインストールされます。
  • 次のコマンドを使用して、Windowsにサービスをインストールします。
> Cd %ORIENTDB_HOME%\service
> installService.bat "C:\Program Files\Java\jdk1.8.0_66\jre\bin\server
   \jvm.dll" C:\orientdb-community-2.1.9

タスクマネージャーサービスを開くと、登録済みのサービス名が含まれている次のスクリーンショットが表示されます。

タスクマネージャー

ステップ4-OrientDBインストールの検証

この手順では、次の手順を使用してOrientDBデータベースサーバーのインストールを確認します。

  • サーバーを実行してください。
  • コンソールを実行します。
  • スタジオを実行します。

これは、オペレーティングシステムによって異なります。

Linuxの場合

LinuxでOrientDBのインストールを確認するには、所定の手順に従ってください。

サーバーの実行-次のコマンドを使用してサーバーを起動できます。

$ cd $ORIENTDB_HOME/bin
$ ./server.sh

または、次のコマンドを使用して、OrientDBサーバーをUNIXデーモンとして起動できます。

$ service orientdb start

正常にインストールされると、次の出力が表示されます。

          .
          .`        `
          ,      `:.
         `,`    ,:`
         .,.   :,,
         .,,  ,,,
    .    .,.:::::  ````                                 :::::::::     :::::::::
    ,`   .::,,,,::.,,,,,,`;;                      .:    ::::::::::    :::    :::
    `,.  ::,,,,,,,:.,,.`  `                       .:    :::      :::  :::     :::
     ,,:,:,,,,,,,,::.   `        `         ``     .:    :::      :::  :::     :::
      ,,:.,,,,,,,,,: `::, ,,   ::,::`   : :,::`  ::::   :::      :::  :::    :::
       ,:,,,,,,,,,,::,:   ,,  :.    :   ::    :   .:    :::      :::  :::::::
        :,,,,,,,,,,:,::   ,,  :      :  :     :   .:    :::      :::  :::::::::
  `     :,,,,,,,,,,:,::,  ,, .::::::::  :     :   .:    :::      :::  :::     :::
  `,...,,:,,,,,,,,,: .:,. ,, ,,         :     :   .:    :::      :::  :::     :::
    .,,,,::,,,,,,,:  `: , ,,  :     `   :     :   .:    :::      :::  :::     :::
      ...,::,,,,::.. `:  .,,  :,    :   :     :   .:    :::::::::::   :::     :::
           ,::::,,,. `:   ,,   :::::    :     :   .:    :::::::::     ::::::::::
           ,,:` `,,.
          ,,,    .,`
         ,,.     `,                                          GRAPH DATABASE
       ``        `.
                 ``                                          orientdb.com
                 `

2016-01-20 19:17:21:547 INFO  OrientDB auto-config DISKCACHE = 1,
   649MB (heap = 494MB os = 4, 192MB disk = 199, 595MB) [orientechnologies]
2016-01-20 19:17:21:816 INFO  Loading configuration from:
  /opt/orientdb/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2016-01-20 19:17:22:213 INFO  OrientDB Server v2.1.9-SNAPSHOT
   (build 2.1.x@r; 2016-01-07 10:51:24+0000) is starting up... [OServer]
2016-01-20 19:17:22:220 INFO  Databases directory:/opt/orientdb/databases [OServer]
2016-01-20 19:17:22:361 INFO  Port 0.0.0.0:2424 busy,
   trying the next available... [OServerNetworkListener]
2016-01-20 19:17:22:362 INFO  Listening binary connections on 0.0.0.0:2425
   (protocol v.32, socket = default) [OServerNetworkListener]
...
2016-01-20 19:17:22:614 INFO  Installing Script interpreter. WARN:
   authenticated clients can execute any kind of code into the server
   by using the following allowed languages:
   [sql] [OServerSideScriptInterpreter]
2016-01-20 19:17:22:615 INFO  OrientDB Server v2.1.9-SNAPSHOT
   (build 2.1.x@r; 2016-01-07 10:51:24+0000) is active. [OServer]

コンソールの実行-次のコマンドを使用して、OrientDBをコンソールで実行できます。

$ orientdb

正常にインストールされると、次の出力が表示されます。

OrientDB console v.2.1.9-SNAPSHOT (build 2.1.x@r; 2016-01-07 10:51:24+0000) www.orientdb.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb>
  • Studioの実行*-サーバーの起動後、ブラウザで次のURL( http://localhost:2480/ )を使用できます。 次のスクリーンショットが表示されます。

スタジオの実行

Windowsの場合

WindowsでOrientDBのインストールを確認するには、所定の手順に従ってください。

サーバーの実行-次のコマンドを使用してサーバーを起動できます。

> cd %ORIENTDB_HOME%\bin
> ./server.bat

正常にインストールされると、次の出力が表示されます。

          .
          .`        `
          ,      `:.
         `,`    ,:`
         .,.   :,,
         .,,  ,,,
    .    .,.:::::  ````                                 :::::::::     :::::::::
    ,`   .::,,,,::.,,,,,,`;;                      .:    ::::::::::    :::    :::
    `,.  ::,,,,,,,:.,,.`  `                       .:    :::      :::  :::     :::
     ,,:,:,,,,,,,,::.   `        `         ``     .:    :::      :::  :::     :::
      ,,:.,,,,,,,,,: `::, ,,   ::,::`   : :,::`  ::::   :::      :::  :::    :::
       ,:,,,,,,,,,,::,:   ,,  :.    :   ::    :   .:    :::      :::  :::::::
        :,,,,,,,,,,:,::   ,,  :      :  :     :   .:    :::      :::  :::::::::
  `     :,,,,,,,,,,:,::,  ,, .::::::::  :     :   .:    :::      :::  :::     :::
  `,...,,:,,,,,,,,,: .:,. ,, ,,         :     :   .:    :::      :::  :::     :::
    .,,,,::,,,,,,,:  `: , ,,  :     `   :     :   .:    :::      :::  :::     :::
      ...,::,,,,::.. `:  .,,  :,    :   :     :   .:    :::::::::::   :::     :::
           ,::::,,,. `:   ,,   :::::    :     :   .:    :::::::::     ::::::::::
           ,,:` `,,.
          ,,,    .,`
         ,,.     `,                                          GRAPH DATABASE
       ``        `.
                 ``                                          orientdb.com
                 `

2016-01-20 19:17:21:547 INFO  OrientDB auto-config DISKCACHE = 1,649MB
   (heap = 494MB os = 4, 192MB disk = 199, 595MB) [orientechnologies]
2016-01-20 19:17:21:816 INFO  Loading configuration from:
  /opt/orientdb/config/orientdb-server-config.xml...
   [OServerConfigurationLoaderXml]
...
2016-01-20 19:17:22:615 INFO  OrientDB Server v2.1.9-SNAPSHOT
   (build 2.1.x@r; 2016-01-07 10:51:24+0000) is active. [OServer]

コンソールの実行-次のコマンドを使用して、コンソールでOrientDBを実行できます。

> %ORIENTDB_HOME%\bin\console.bat

正常にインストールされると、次の出力が表示されます。

OrientDB console v.2.1.9-SNAPSHOT (build 2.1.x@r; 2016-01-07 10:51:24+0000) www.orientdb.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb\>
  • Studioの実行*-サーバーの起動後、ブラウザで次のURL( http://localhost:2480/ )を使用できます。 次のスクリーンショットが表示されます。

スタジオの実行