溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Ubuntu 16.04怎么安裝OrientDB

發(fā)布時(shí)間:2022-01-25 14:26:10 來(lái)源:億速云 閱讀:129 作者:iii 欄目:開發(fā)技術(shù)

本篇內(nèi)容主要講解“Ubuntu 16.04怎么安裝OrientDB”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“Ubuntu 16.04怎么安裝OrientDB”吧!

OrientDB是一個(gè)開源NoSQL數(shù)據(jù)庫(kù)管理系統(tǒng)。 NoSQL數(shù)據(jù)庫(kù)提供了一種用于存儲(chǔ)和檢索引用除表式數(shù)據(jù)之外的數(shù)據(jù)(例如文檔數(shù)據(jù)或圖形數(shù)據(jù))的NO關(guān)系或非關(guān)系數(shù)據(jù)的機(jī)制。OrientDB也屬于NoSQL系列。 OrientDB是第二代分布式數(shù)據(jù)庫(kù),具有靈活性的文檔在一個(gè)產(chǎn)品與Apache 2許可證的開放源代碼。

Ubuntu 16.04怎么安裝OrientDB

下載 OrientDB

我們可以從最新的服務(wù)端上通過輸入下面的指令來(lái)下載最新版本的 OrientDB。

$ wget -O orientdb-community-2.2.22.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.22.tar.gz&os=linux

這里下載的是一個(gè)包含預(yù)編譯二進(jìn)制文件的壓縮包,所以我們可以使用 tar 指令來(lái)操作解壓它:

$ tar -zxf orientdb-community-2.2.22.tar.gz

將從中提取出來(lái)的文件夾整體移動(dòng)到 /opt:

# mv orientdb-community-2.2.22 /opt/orientdb

啟動(dòng) OrientDB 服務(wù)器

啟動(dòng) OrientDB 服務(wù)器需要運(yùn)行 orientdb/bin/ 目錄下的 shell 腳本:

# /opt/orientdb/bin/server.sh

如果你是第一次開啟 OrientDB 服務(wù)器,安裝程序還會(huì)顯示一些提示信息,以及提醒你設(shè)置 OrientDB 的 root 用戶密碼:

+---------------------------------------------------------------+
| WARNING: FIRST RUN CONFIGURATION |
+---------------------------------------------------------------+
| This is the first time the server is running. Please type a |
| password of your choice for the 'root' user or leave it blank |
| to auto-generate it. |
| |
| To avoid this message set the environment variable or JVM |
| setting ORIENTDB_ROOT_PASSWORD to the root password to use. |
+---------------------------------------------------------------+
Root password [BLANK=auto generate it]: ********
Please confirm the root password: ********

在完成這些后,OrientDB 數(shù)據(jù)庫(kù)服務(wù)器將成功啟動(dòng):

INFO OrientDB Server is active v2.2.22 (build fb2b7d321ea8a5a5b18a82237049804aace9e3de). [OServer]

從現(xiàn)在開始,我們需要用第二個(gè)終端來(lái)與 OrientDB 服務(wù)器進(jìn)行交互。

若要強(qiáng)制停止 OrientDB 執(zhí)行 Ctrl+C 即可。

配置守護(hù)進(jìn)程

此時(shí),我們可以認(rèn)為 OrientDB 僅僅是一串 shell 腳本,可以用編輯器打開 /opt/orientdb/bin/orientdb.sh:

# $EDITOR /opt/orientdb/bin/orientdb.sh

在它的首段,我們可以看到:

#!/bin/sh# OrientDB service script## Copyright (c) OrientDB LTD (http://orientdb.com/)# chkconfig: 2345 20 80# description: OrientDb init script# processname: orientdb.sh# You have to SET the OrientDB installation directory hereORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"

我們需要配置ORIENTDB_DIR 以及 ORIENTDB_USER.

然后創(chuàng)建一個(gè)用戶,例如我們創(chuàng)建一個(gè)名為 orientdb 的用戶,我們需要輸入下面的指令:

# useradd -r orientdb -s /sbin/nologin

orientdb 就是我們?cè)?ORIENTDB_USER 處輸入的用戶。

再更改 /opt/orientdb 目錄的所有權(quán):

# chown -R orientdb:orientdb /opt/orientdb

改變服務(wù)器配置文件的權(quán)限:

# chmod 640 /opt/orientdb/config/orientdb-server-config.xml

下載系統(tǒng)守護(hù)進(jìn)程服務(wù)

OrientDB 的壓縮包包含一個(gè)服務(wù)文件 /opt/orientdb/bin/orientdb.service。我們將其復(fù)制到 /etc/systemd/system 文件夾下:

# cp /opt/orientdb/bin/orientdb.service /etc/systemd/system

編輯該服務(wù)文件:

# $EDITOR /etc/systemd/system/orientdb.service

其中 [service] 內(nèi)容塊看起來(lái)應(yīng)該是這樣的:

[Service]
User=ORIENTDB_USER
Group=ORIENTDB_GROUP
ExecStart=$ORIENTDB_HOME/bin/server.sh

將其改成如下樣式:

[Service]
User=orientdb
Group=orientdb
ExecStart=/opt/orientdb/bin/server.sh

保存并退出。

重新加載系統(tǒng)守護(hù)進(jìn)程:

# systemctl daemon-reload

啟動(dòng) OrientDB 并使其開機(jī)自啟動(dòng):

# systemctl start orientdb# systemctl enable orientdb

確認(rèn) OrientDB 的狀態(tài):

# systemctl status orientdb

上述指令應(yīng)該會(huì)輸出:

● orientdb.service - OrientDB Server
Loaded: loaded (/etc/systemd/system/orientdb.service; disabled; vendor preset: enabled)
Active: active (running) ...

到此,相信大家對(duì)“Ubuntu 16.04怎么安裝OrientDB”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI