mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #5862 from LCTT/revert-5858-master
Revert "翻译 How To Install OrientDB on Ubuntu 16.04 完成"
This commit is contained in:
commit
f0b9f4c859
@ -0,0 +1,233 @@
|
||||
Translating by a972667237
|
||||
NoSQL: How To Install OrientDB on Ubuntu 16.04
|
||||
============================================================
|
||||
|
||||
|
||||
[![OrientDB NoSQL DBMS](https://www.unixmen.com/wp-content/uploads/2017/07/orientdb-696x318.png "orientdb")][2]
|
||||
|
||||
### Introduction – NoSQL and OrientDB
|
||||
|
||||
When talking about databases, in general, we refer to two major families: RDBMS (**R**elational **D**ata**b**ase **M**anagement **S**ystem), which use as user and application program interface a language named **S**tructured **Q**uery **L**anguage (or SQL) and non-relational database management systems, or **NoSQL** databases.
|
||||
|
||||
Between the two models there is a huge difference in the way they consider (and store) data.
|
||||
|
||||
#### Relational Database Management Systems
|
||||
|
||||
In the relational model (like MySQL, or its fork, MariaDB), a database is a set of tables, each containing one or more data categories organized in columns. Each row of the DB contains a unique instance of data for categories defined by columns.
|
||||
|
||||
Just as an example, consider a table containing customers. Each row correspond to a customer, with columns for name, address, and every required information.
|
||||
Another table could contain an order, with product, customer, date and everything else. A user of this DB can obtain a view that fits its needs, for example a report about customers that bought products in a specific range of prices.
|
||||
|
||||
#### NoSQL Database Management Systems
|
||||
|
||||
In the NoSQL (or Not only SQL) database management systems, databases are designed implementing different “formats” for data, like a document, key-value, graph and others. The database systems realized with this paradigm are built especially for large-scale database clusters, and huge web applications. Today, NoSQL databases are used by major companies like Google and Amazon.
|
||||
|
||||
##### Document databases
|
||||
|
||||
Document databases store data in document format. The usage of this kind of DBs is usually raised with JavaScript and JSON, however, XML and other formats are accepted. An example is MongoDB.
|
||||
|
||||
##### Key-value databases
|
||||
|
||||
This is a simple model pairing a unique key with a value. These systems are performant and highly scalable for caching. Examples include BerkeleyDB and MemcacheDB.
|
||||
|
||||
##### Graph databases
|
||||
|
||||
As the name predicts, these databases store data using graph models, meaning that data is organized as nodes and interconnections between them. This is a flexible model which can evolve over time and use. These systems are applied where there is the necessity of mapping relationships.
|
||||
Examples are IBM Graphs and Neo4j **and OrientDB**.
|
||||
|
||||
### OrientDB
|
||||
|
||||
[OrientDB][3], as stated by the company behind it, is a multi-model NoSQL Database Management System that “ _combines the power of graphs with documents, key/value, reactive, object-oriented and geospatial models into one **scalable, high-performance operational database**“._
|
||||
|
||||
OrientDB has also support for SQL, with extensions to manipulate trees and graphs.
|
||||
|
||||
### Goals
|
||||
|
||||
This tutorial explains how to install and configure OrientDB Community on a server running Ubuntu 16.04.
|
||||
|
||||
### Download OrientDB
|
||||
|
||||
On an up to date server, download the latest version of OrientDB by executing the following command:
|
||||
|
||||
```
|
||||
$ wget -O orientdb-community-2.2.22.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.22.tar.gz&os=linux
|
||||
```
|
||||
|
||||
This is a tarball containing pre-compiled binaries, so extract the archive with `tar`:
|
||||
|
||||
```
|
||||
$ tar -zxf orientdb-community-2.2.22.tar.gz
|
||||
```
|
||||
|
||||
Move the extracted directory into `/opt`:
|
||||
|
||||
```
|
||||
# mv orientdb-community-2.2.22 /opt/orientdb
|
||||
```
|
||||
|
||||
### Start OrientDB Server
|
||||
|
||||
Starting the OrientDB server requires the execution of the shell script contained in `orientdb/bin/`:
|
||||
|
||||
```
|
||||
# /opt/orientdb/bin/server.sh
|
||||
```
|
||||
|
||||
During the first start, this installer will display some information and will ask for an OrientDB root password:
|
||||
|
||||
```
|
||||
+---------------------------------------------------------------+
|
||||
| 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: ********
|
||||
```
|
||||
|
||||
After that, the OrientDB server will start:
|
||||
|
||||
```
|
||||
INFO OrientDB Server is active v2.2.22 (build fb2b7d321ea8a5a5b18a82237049804aace9e3de). [OServer]
|
||||
```
|
||||
|
||||
From now on, we will need a second terminal to interact with the OrientDB server.
|
||||
|
||||
Stop OrientDB by hitting `Ctrl+C`.
|
||||
|
||||
### Configure a Daemon
|
||||
|
||||
At this point, OrientDB is just a bunch of shell scripts. With a text editor, open `/opt/orientdb/bin/orientdb.sh`:
|
||||
|
||||
```
|
||||
# $EDITOR /opt/orientdb/bin/orientdb.sh
|
||||
```
|
||||
|
||||
In the first lines, we will see:
|
||||
|
||||
```
|
||||
#!/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 here
|
||||
ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"
|
||||
ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"
|
||||
```
|
||||
|
||||
Configure `ORIENTDB_DIR` and `ORIENTDB_USER`.
|
||||
|
||||
Create a user, for example **orientdb**, by executing the following command:
|
||||
|
||||
```
|
||||
# useradd -r orientdb -s /sbin/nologin
|
||||
```
|
||||
|
||||
**orientdb** is the user we enter in the `ORIENTDB_USER` line.
|
||||
|
||||
Change the ownership of `/opt/orientdb`:
|
||||
|
||||
```
|
||||
# chown -R orientdb:orientdb /opt/orientdb
|
||||
```
|
||||
|
||||
Change the configuration server file’s permission:
|
||||
|
||||
```
|
||||
# chmod 640 /opt/orientdb/config/orientdb-server-config.xml
|
||||
```
|
||||
|
||||
#### Install the Systemd Service
|
||||
|
||||
OrientDB tarball contains a service file, `/opt/orientdb/bin/orientdb.service`. Copy it to the `/etc/systemd/system` directory:
|
||||
|
||||
```
|
||||
# cp /opt/orientdb/bin/orientdb.service /etc/systemd/system
|
||||
```
|
||||
|
||||
Edit the OrientDB service file:
|
||||
|
||||
```
|
||||
# $EDITOR /etc/systemd/system/orientdb.service
|
||||
```
|
||||
|
||||
There, the `[service]` block should look like this:
|
||||
|
||||
```
|
||||
[Service]
|
||||
User=ORIENTDB_USER
|
||||
Group=ORIENTDB_GROUP
|
||||
ExecStart=$ORIENTDB_HOME/bin/server.sh
|
||||
```
|
||||
|
||||
Edit as follow:
|
||||
|
||||
```
|
||||
[Service]
|
||||
User=orientdb
|
||||
Group=orientdb
|
||||
ExecStart=/opt/orientdb/bin/server.sh
|
||||
```
|
||||
|
||||
Save and exit.
|
||||
|
||||
Reload systemd daemon service:
|
||||
|
||||
```
|
||||
# systemctl daemon-reload
|
||||
```
|
||||
|
||||
Start OrientDB and enable for starting at boot time:
|
||||
|
||||
```
|
||||
# systemctl start orientdb
|
||||
# systemctl enable orientdb
|
||||
```
|
||||
|
||||
Check OrientDB status:
|
||||
|
||||
```
|
||||
# systemctl status orientdb
|
||||
```
|
||||
|
||||
The command should output:
|
||||
|
||||
```
|
||||
● orientdb.service - OrientDB Server
|
||||
Loaded: loaded (/etc/systemd/system/orientdb.service; disabled; vendor preset: enabled)
|
||||
Active: active (running) ...
|
||||
```
|
||||
|
||||
And that’s all! OrientDB Community is installed and correctly running.
|
||||
|
||||
### Conclusion
|
||||
|
||||
In this tutorial we have seen a brief comparison between RDBMS and NoSQL DBMS. We have also installed and completed a basic configuration of OrientDB Community server-side.
|
||||
|
||||
This is the first step for deploying a full OrientDB infrastructure, ready for managing large-scale systems data.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/nosql-install-orientdb-ubuntu-16-04/
|
||||
|
||||
作者:[Giuseppe Molica ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/tutan/
|
||||
[1]:https://www.unixmen.com/author/tutan/
|
||||
[2]:https://www.unixmen.com/wp-content/uploads/2017/07/orientdb.png
|
||||
[3]:https://orientdb.com/
|
@ -1,230 +0,0 @@
|
||||
非关系型数据库: 如何在 Ubuntu 16.04 上安装 OrientDB
|
||||
============================================================
|
||||
|
||||
|
||||
![OrientDB NoSQL DBMS]【(https://www.unixmen.com/wp-content/uploads/2017/07/orientdb-696x318.png "orientdb")][2]
|
||||
|
||||
### 说明 - 非关系型数据库和 OrientDB
|
||||
|
||||
通常在我们提及数据库的时候,想到的是两个主要的分类:用于用户和应用程序之间进行对接的一种被称为结构化查询语言(**S**tructured **Q**uery **L**anguage or SQL)的关系型数据库管理系统(RDBMS, **R**elational **D**ata **b**ase **M**anagement **S**ystem) 以及非关系型数据库管理系统(non-relational database management systems 或称 NoSQL 数据库).
|
||||
|
||||
这两个模型,在如何处理(存储)数据的方面存在着巨大的差异。
|
||||
|
||||
#### 关系数据库管理系统
|
||||
|
||||
在关系模型中(如MySQL,或者其分支 MariaDB),一个数据库是一系列包含一个或多个以列组织的数据实例的表。数据库的每行包含一个唯一的由列定义的数据实例。
|
||||
|
||||
举个例子,想象一个包含客户的表。每一行相当于一个客户,而其中的每一列分别对应名字、地址以及其他所必须的信息。
|
||||
|
||||
而另一个表可能是包含订单、产品、客户、日期以及其他一切。而这个数据库的使用者则可以获得一个满足其需要的视图,例如一个客户在一个特定的价格范围购买产品的报告。
|
||||
|
||||
#### 非关系型数据库管理系统
|
||||
|
||||
在非关系型数据库(或称不仅仅是数据库)管理系统中,数据库被设计为使用不同的方式存储数据,比如文档存储、键值对存储、图形关系存储以及其他方式存储。使用此种形式实现的数据库系统专门被用于大型数据库集群和大型 Web 应用。现今,非关系型数据库被用于某些大公司,如谷歌和亚马逊。
|
||||
|
||||
##### 文档存储数据库
|
||||
|
||||
文档存储数据库是将数据用文档的形式存储。这种类型的运用通常表现为 JavaScript 和 JSON,实际上,XML 和其他形式的存储也是可以被采用的。这里的一个例子就是 MongoDB。
|
||||
|
||||
##### 键值对存储数据库
|
||||
|
||||
这是一个唯一键(key)配对一个值(value)的简单模型。这个系统在高速缓存方面具有高性能和高度可扩展性。这里的例子包括 BerkeleyDB 和 MemacacheDB。
|
||||
##### 图形关系数据库
|
||||
|
||||
正如其名,这种数据库通过使用图模型存储数据,这意味着数据通过节点和两个节点之间的互连进行组织。这是一个可以随着时间的推移和使用而发展的灵活模型。这个系统应用于那些强调映射关系的地方。这里的例子有 IBM Graphs、Neo4j 以及 **OrientDB**。
|
||||
|
||||
### OrientDB
|
||||
|
||||
[OrientDB][3] 是一个多模式的非关系型数据库管理系统。正如开发它的公司所说的“_它是一个将图形与文档、键值对、反应性、面向对象和地理空间模型结合在一起的**可扩展的、高性能的数据库**_”。
|
||||
|
||||
OrientDB 还支持 SQL 来扩展操作树和图。
|
||||
|
||||
### 目标
|
||||
|
||||
这个教程旨在教会大家如何在运行 Ubuntu 16.04 的服务器上下载和配置 OrientDB 公开版。
|
||||
|
||||
### 下载 OrientDB
|
||||
|
||||
我们可以从最新的服务端上通过输入下面的指令来下载最新版本的 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
|
||||
```
|
||||
|
||||
这里下载的是一个包含预编译二进制文件的压缩包,所以我们可以使用 `tar` 指令来操作解压它:
|
||||
|
||||
```
|
||||
$ tar -zxf orientdb-community-2.2.22.tar.gz
|
||||
```
|
||||
|
||||
将从中提取出来的文件夹整体移动到 `/opt`:
|
||||
|
||||
```
|
||||
# mv orientdb-community-2.2.22 /opt/orientdb
|
||||
```
|
||||
|
||||
### 启动 OrientDB Server
|
||||
|
||||
启动 OrientDB 服务 需要运行 `orientdb/bin/` 目录下的shell:
|
||||
|
||||
```
|
||||
# /opt/orientdb/bin/server.sh
|
||||
```
|
||||
|
||||
如果你是第一次开启 OrientDB 服务,安装程序还会显示一些提示信息以及提醒你设置 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 数据库服务将成功启动:
|
||||
```
|
||||
INFO OrientDB Server is active v2.2.22 (build fb2b7d321ea8a5a5b18a82237049804aace9e3de). [OServer]
|
||||
```
|
||||
|
||||
从现在开始,我们需要第二个终端来与 OrientDB 服务进行交互。(有些问题)
|
||||
|
||||
若要强制停止 OrientDB 执行 `Ctrl+C` 即可。
|
||||
|
||||
### 配置守护进程
|
||||
|
||||
|
||||
此时,我们可以认为 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 here
|
||||
ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"
|
||||
ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"
|
||||
```
|
||||
|
||||
我们需要配置`ORIENTDB_DIR` 以及 `ORIENTDB_USER`.
|
||||
|
||||
然后创建一个用户,例如我们创建一个名为**orientdb**的用户,我们需要输入下面的指令:
|
||||
|
||||
```
|
||||
# useradd -r orientdb -s /sbin/nologin
|
||||
```
|
||||
|
||||
**orientdb** 就是我们在 `ORIENTDB_USER` 输入处的用户。
|
||||
|
||||
再更改 `/opt/orientdb` 目录的所有权:
|
||||
|
||||
```
|
||||
# chown -R orientdb:orientdb /opt/orientdb
|
||||
```
|
||||
|
||||
改变服务配置文件的权限:
|
||||
|
||||
```
|
||||
# chmod 640 /opt/orientdb/config/orientdb-server-config.xml
|
||||
```
|
||||
|
||||
#### 下载系统守护进程服务
|
||||
|
||||
OrientDB 的压缩包包含一个服务文件`/opt/orientdb/bin/orientdb.service`。我们将其复制到 `/etc/systemd/system` 文件夹下:
|
||||
|
||||
```
|
||||
# cp /opt/orientdb/bin/orientdb.service /etc/systemd/system
|
||||
```
|
||||
|
||||
编辑该服务文件:
|
||||
|
||||
```
|
||||
# $EDITOR /etc/systemd/system/orientdb.service
|
||||
```
|
||||
|
||||
其中`[service]` 内容块看起来应该是这样的:
|
||||
|
||||
```
|
||||
[Service]
|
||||
User=ORIENTDB_USER
|
||||
Group=ORIENTDB_GROUP
|
||||
ExecStart=$ORIENTDB_HOME/bin/server.sh
|
||||
```
|
||||
|
||||
将其改成如下样式:
|
||||
|
||||
```
|
||||
[Service]
|
||||
User=orientdb
|
||||
Group=orientdb
|
||||
ExecStart=/opt/orientdb/bin/server.sh
|
||||
```
|
||||
|
||||
保存并退出。
|
||||
|
||||
重新加载系统守护进程:
|
||||
|
||||
```
|
||||
# systemctl daemon-reload
|
||||
```
|
||||
|
||||
启动 OrientDB 并同意其开机自启动:
|
||||
|
||||
```
|
||||
# systemctl start orientdb
|
||||
# systemctl enable orientdb
|
||||
```
|
||||
|
||||
确认 OrientDB 的状态:
|
||||
|
||||
```
|
||||
# systemctl status orientdb
|
||||
```
|
||||
|
||||
上述指令应该会输出:
|
||||
|
||||
```
|
||||
● orientdb.service - OrientDB Server
|
||||
Loaded: loaded (/etc/systemd/system/orientdb.service; disabled; vendor preset: enabled)
|
||||
Active: active (running) ...
|
||||
```
|
||||
|
||||
流程就是这样了!OrientDB 社区版成功安装并且正确运行在我们的服务器上了。
|
||||
|
||||
### 总结
|
||||
|
||||
在这个指导中,我们看到了一些关系型数据库管理系统(RDBMS)以及非关系型数据库管理系统(NoSQL DBMS)的简单对照。我们也安装 OrientDB 社区版的服务器端并完成了其基础的配置。
|
||||
|
||||
这是我们部署完全的 OrientDB 基础设施的第一步,也是我们用于管理大型系统数据的起步。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/nosql-install-orientdb-ubuntu-16-04/
|
||||
|
||||
作者:[Giuseppe Molica ][a]
|
||||
译者:[a92667237](https://github.com/a972667237)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/tutan/
|
||||
[1]:https://www.unixmen.com/author/tutan/
|
||||
[2]:https://www.unixmen.com/wp-content/uploads/2017/07/orientdb.png
|
||||
[3]:https://orientdb.com/
|
Loading…
Reference in New Issue
Block a user