阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

如何在Ubuntu 16.04上安装OrientDB及基本配置

104次阅读
没有评论

共计 3874 个字符,预计需要花费 10 分钟才能阅读完成。

简介 – NoSQL 和 OrientDB

在讨论数据库时,一般来说,我们提到两个主要的系列:RDBMS(关系数据库管理系统),它们用作用户和应用程序接口一种名为结构化查询语言(或 SQL)和非关系数据库管理系统的语言,比如 NoSQL 数据库。

在两个模型之间,存储数据的方式有很大的差异。

关系数据库管理系统

在关系模型(如 MySQL 或其分支 MariaDB)中,数据库是一组表,每个表包含一个或多个以列组织的数据类别。数据库的每一行都包含由列定义的类别的唯一数据实例。

举个例子,考虑一个包含客户的表。每行对应于一个客户,其中列有名称,地址和每个必需的信息。
另一张表可能包含订单,包括产品,客户,日期和其他一切。该 DB 的用户可以获得符合其需求的视图,例如关于以特定价格范围购买产品的客户的报告。

NoSQL 数据库管理系统

在 NoSQL(或不仅仅是 SQL)数据库管理系统中,数据库被设计为数据实现不同的“格式”,如文档,键值,图形等。使用此范例实现的数据库系统专门用于大型数据库集群和巨大的 Web 应用程序。今天,NoSQL 数据库被像 Google 和 Amazon 这样的主要公司使用。

文档数据库

文档数据库以文档格式存储数据。这种数据库的使用通常是用 JavaScript 和 JSON 引用的,但是接受 XML 和其他格式。一个例子是 MongoDB。

键值数据库

这是一个简单的模型,将唯一键与值配对。这些系统具有高性能和高度可扩展性用于缓存。示例包括 BerkeleyDB 和 MemcacheDB。

图数据库

如名称预测,这些数据库使用图形模型存储数据,这意味着数据被组织为节点和它们之间的互连。这是一个灵活的模式,可以随着时间的推移和使用而发展。这些系统应用于需要映射关系的地方。
示例是 IBM Graphs 和 Neo4j 和 OrientDB。

OrientDB

OrientDB,正如其背后的公司所指出的那样,是一个多模式的 NoSQL 数据库管理系统,它将图形的功能与文档,关键 / 价值,反应性,面向对象和地理空间模型结合成一个可扩展的高性能操作数据库

OrientDB has also support for SQL, with extensions to manipulate trees and graphs.

OrientDB 还支持 SQL,通过扩展来操纵 trees 和 graphs。

目标

本教程介绍如何在运行 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

这是一个包含预先编译的二进制文件的 tarball,因此用 tar 提取归档文件:

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

 将提取的目录移动到 /opt:

# mv orientdb-community-2.2.22 /opt/orientdb

启动 OrientDB 服务器

启动 OrientDB 服务器需要执行 orientdb/bin/ 中包含的 shell 脚本:

# /opt/orientdb/bin/server.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 服务器将启动:

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.

按 Ctrl + C 停止 OrientDB。

配置守护进程

我们需要修改 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

安装 Systemd 服务

OrientDB tarball 包含一个服务文件 /opt/orientdb/bin/orientdb.service。使用以下命令将其复制到 /etc/systemd/system 目录中:

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

编辑 OrientDB 服务文件:

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

There, the [service] block should look like this:

现在修改用户,组和 ExecStart 下变量服务来完成匹配安装。ExecStart 指定脚本的路径如下:

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

编辑如下:

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

保存并退出。

重新加载 systemd 守护进程服务:

# 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) ...

OK,就这样!OrientDB 社区版已安装并正确运行。

总结

在本教程中,我们看到了 RDBMS 和 NoSQL DBMS 的简单比较。我们还安装并完成了 OrientDB 社区服务器端的基本配置。

这是部署完整的 OrientDB 基础架构的第一步,可以管理大型系统数据。

Ubuntu 16.04 上 OrientDB 安装配置教程  http://www.linuxidc.com/Linux/2017-05/143863.htm

OrientDB 的详细介绍 :请点这里
OrientDB 的下载地址 :请点这里

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-07/145689.htm

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-22发表,共计3874字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中