自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

NoSQL: 如何在Ubuntu 16.04上安裝OrientDB

系統(tǒng) Linux
OrientDB 是一個多模式的非關(guān)系型數(shù)據(jù)庫管理系統(tǒng)。正如開發(fā)它的公司所說的“它是一個將圖形關(guān)系與文檔、鍵值對、反應(yīng)性、面向?qū)ο蠛偷乩砜臻g模型結(jié)合在一起的可擴展的、高性能的數(shù)據(jù)庫”。OrientDB 還支持 SQL ,經(jīng)過擴展可以用來操作樹和圖。

NoSQL: 如何在Ubuntu 16.04上安裝OrientDB

說明 - 非關(guān)系型數(shù)據(jù)庫(NoSQL)和 OrientDB

通常在我們提及數(shù)據(jù)庫的時候,想到的是兩個主要的分類:使用用于用戶和應(yīng)用程序之間進(jìn)行對接的一種被稱為結(jié)構(gòu)化查詢語言(Structured Query Language ,縮寫 SQL)的關(guān)系型數(shù)據(jù)庫管理系統(tǒng)(Relational Data base Management System,縮寫 RDBMS) 以及非關(guān)系型數(shù)據(jù)庫管理系統(tǒng)(non-relational database management systems 或稱 NoSQL 數(shù)據(jù)庫)。

這兩種模型在如何處理(存儲)數(shù)據(jù)的方面存在著巨大的差異。

關(guān)系數(shù)據(jù)庫管理系統(tǒng)

在關(guān)系模型中(如 MySQL,或者其分支 MariaDB),一個數(shù)據(jù)庫是一個表的集合,其中每個表包含一個或多個以列組織的數(shù)據(jù)分類。數(shù)據(jù)庫的每行包含一個唯一的數(shù)據(jù)實例,其分類由列定義。

舉個例子,想象一個包含客戶的表。每一行相當(dāng)于一個客戶,而其中的每一列分別對應(yīng)名字、地址以及其他所必須的信息。

而另一個表可能是包含訂單、產(chǎn)品、客戶、日期以及其它的種種。而這個數(shù)據(jù)庫的使用者則可以獲得一個滿足其需要的視圖,例如一個客戶在一個特定的價格范圍購買產(chǎn)品的報告。

非關(guān)系型數(shù)據(jù)庫管理系統(tǒng)

在非關(guān)系型數(shù)據(jù)庫(或稱為不僅僅是數(shù)據(jù)庫Not only SQL)管理系統(tǒng)中,數(shù)據(jù)庫被設(shè)計為使用不同的方式存儲數(shù)據(jù),比如文檔存儲、鍵值對存儲、圖形關(guān)系存儲以及其他方式存儲。使用此種形式實現(xiàn)的數(shù)據(jù)庫系統(tǒng)專門被用于大型數(shù)據(jù)庫集群和大型 Web 應(yīng)用?,F(xiàn)今,非關(guān)系型數(shù)據(jù)庫被用于某些大公司,如谷歌和亞馬遜。

文檔存儲數(shù)據(jù)庫

文檔存儲數(shù)據(jù)庫是將數(shù)據(jù)用文檔的形式存儲。這種類型的運用通常表現(xiàn)為 JavaScript 和 JSON,實際上,XML 和其他形式的存儲也是可以被采用的。這里的一個例子就是 MongoDB。

鍵值對存儲數(shù)據(jù)庫

這是一個由唯一的鍵key配對一個值value的簡單模型。這個系統(tǒng)在高速緩存方面具有高性能和高度可擴展性。這里的例子包括 BerkeleyDB 和 MemacacheDB。

圖形關(guān)系數(shù)據(jù)庫

正如其名,這種數(shù)據(jù)庫通過使用圖graph模型存儲數(shù)據(jù),這意味著數(shù)據(jù)通過節(jié)點和節(jié)點之間的互連進(jìn)行組織。這是一個可以隨著時間的推移和使用而發(fā)展的靈活模型。這個系統(tǒng)應(yīng)用于那些強調(diào)映射關(guān)系的地方。這里的例子有 IBM Graphs、Neo4j 以及 OrientDB。

OrientDB

OrientDB 是一個多模式的非關(guān)系型數(shù)據(jù)庫管理系統(tǒng)。正如開發(fā)它的公司所說的“它是一個將圖形關(guān)系與文檔、鍵值對、反應(yīng)性、面向?qū)ο蠛偷乩砜臻g模型結(jié)合在一起的可擴展的、高性能的數(shù)據(jù)庫”。

OrientDB 還支持 SQL ,經(jīng)過擴展可以用來操作樹和圖。

目標(biāo)

這個教程旨在教會大家如何在運行 Ubuntu 16.04 的服務(wù)器上下載并配置 OrientDB 社區(qū)版。

下載 OrientDB

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

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

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

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

將從中提取出來的文件夾整體移動到 /opt:

  1. # mv orientdb-community-2.2.22 /opt/orientdb 

啟動 OrientDB 服務(wù)器

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

  1. # /opt/orientdb/bin/server.sh 

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

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

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

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

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

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

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

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

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

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

  1. #!/bin/sh 
  2. # OrientDB service script 
  3. # Copyright (c) OrientDB LTD (http://orientdb.com/) 
  4. # chkconfig: 2345 20 80 
  5. # description: OrientDb init script 
  6. # processname: orientdb.sh 
  7. # You have to SET the OrientDB installation directory here 
  8. ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH" 
  9. ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH" 

我們需要配置ORIENTDB_DIR 以及 ORIENTDB_USER.

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

  1. # useradd -r orientdb -s /sbin/nologin 

orientdb 就是我們在 ORIENTDB_USER 處輸入的用戶。

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

  1. # chown -R orientdb:orientdb /opt/orientdb 

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

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

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

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

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

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

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

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

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

將其改成如下樣式:

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

保存并退出。

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

  1. # systemctl daemon-reload 

啟動 OrientDB 并使其開機自啟動:

  1. # systemctl start orientdb 
  2. # systemctl enable orientdb 

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

  1. # systemctl status orientdb 

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

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

流程就是這樣了!OrientDB 社區(qū)版成功安裝并且正確運行在我們的服務(wù)器上了。

總結(jié)

在這個指導(dǎo)中,我們看到了一些關(guān)系型數(shù)據(jù)庫管理系統(tǒng)(RDBMS)以及非關(guān)系型數(shù)據(jù)庫管理系統(tǒng)(NoSQL DBMS)的簡單對照。我們也安裝 OrientDB 社區(qū)版的服務(wù)器端并完成了其基礎(chǔ)的配置。

這是我們部署完全的 OrientDB 基礎(chǔ)設(shè)施的***步,也是我們用于管理大型系統(tǒng)數(shù)據(jù)的起步。 

責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2018-02-25 11:03:00

LinuxUbuntuEncryptpad

2017-06-02 14:30:51

UbuntuOTRSLinux

2017-05-10 10:37:55

2018-02-23 14:50:30

2018-10-15 15:23:50

UbuntupipPython

2019-08-30 11:20:28

UbuntuVirtualBoxLinux

2023-08-08 12:38:52

2024-01-04 11:50:00

UbuntuDocker

2017-02-22 10:06:11

UbuntuCeph存儲

2019-08-02 15:30:42

UbuntuMongoDB命令

2016-07-28 13:30:49

UbuntuQQWine

2013-07-25 10:00:30

UbuntuVirtualBox

2017-03-29 16:18:11

LinuxUbuntuRedmine

2021-07-12 14:47:16

UbuntuZlib代碼

2021-09-11 15:41:55

UbuntuDropbox云服務(wù)

2015-10-16 10:07:22

Justniffer安裝Ubuntu

2017-08-09 13:13:25

LinuxUbuntuZabbix

2016-09-22 08:48:52

UbuntuFedoraXFCE 桌面

2015-12-07 14:47:15

UbuntuGIMP 2.8.16Linux

2018-09-30 10:35:29

UbuntuCinnamon桌面環(huán)境
點贊
收藏

51CTO技術(shù)棧公眾號