如何在 Ubuntu 20.04 LTS 上安装 OrientDB

[ad_1]

在本教程中,我们将向您展示如何在 Ubuntu 20.04 LTS 上安装 OrientDB。 对于那些不知道的人,OrientDB 是一个用 Java 编写的开源 NoSQL 数据库管理系统。 它的主要特点之一是它不仅基于 NoSQL,而且速度非常快。 它是最通用的 DBMS,在一个多模型产品中支持图形、文档、反应式、全文、地理空间和键值模型。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将站点托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户中运行,否则您可能需要添加 ‘sudo‘ 到获得 root 权限的命令。 我将向您展示在 Ubuntu 20.04 (Focal Fossa) 上逐步安装 OrientDB 开源 NoSQL 数据库。 您可以按照针对 Ubuntu 18.04、16.04 和任何其他基于 Debian 的发行版(如 Linux Mint)的相同说明进行操作。

在 Ubuntu 20.04 LTS Focal Fossa 上安装 OrientDB

步骤 1. 首先,通过运行以下命令确保所有系统包都是最新的 apt 终端中的命令。

sudo apt update
sudo apt upgrade
sudo apt install curl apt-transport-https

步骤 2. 在 Ubuntu 20.04 上安装 OrientDB。

现在我们从官网下载最新的社区版本访问OrientDB:

wget https://s3.us-east-2.amazonaws.com/orientdb3/releases/3.0.4/orientdb-3.0.4.tar.gz
tar xvf orientdb-3.0.4.tar.gz

接下来,将提取的设置移动到 /opt/oriendb 目录:

sudo mv orientdb-3.0.4 /opt/orientdb

现在添加系统用户来管理 OrientDB:

sudo useradd -r orientdb -s /sbin/nologin
sudo chown -R orientdb:orientdb /opt/orientdb/

然后,打开配置脚本,替换用户和数据库配置路径:

sudo nano /opt/orientdb/bin/orientdb.sh

添加以下行:

ORIENTDB_DIR="/opt/orientdb"
ORIENTDB_USER="orientdb"

示例输出:

# chkconfig: 2345 20 80
# description: OrientDb init script
# processname: orientdb.sh

# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="/opt/orientdb"
ORIENTDB_USER="orientdb"
LOG_DIR="../log"

接下来,导航到 /opt/orientdb/bin 路径和运行 server.sh 脚本:

cd /opt/orientdb/bin
sudo ./server.sh

输出:

+---------------------------------------------------------------+
| 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: *********

步骤 3. 创建 OrientDB 服务。

首先,将OrientDB服务文件复制到 /etc/systemd/system/ 目录:

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

接下来,编辑 OrientDB 服务文件并添加以下内容:

sudo nano /etc/systemd/system/orientdb.service

添加以下行:

#
# right (c) OrientDB LTD (https://https://orientdb.com/)
#

[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

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

然后,启动 OrientDB 并启用它以在启动时启动:

sudo systemctl daemon-reload
sudo systemctl start orientdb.service
sudo systemctl status orientdb.service

步骤 4. 访问 OrientDB Web 界面。

成功安装后,打开您的网络浏览器并转到 https://your-server-ip:2480 你应该看到这个。

恭喜! 您已成功安装 OrientDB。 感谢您使用本教程在 Ubuntu 20.04 LTS Focal Fossa 系统上安装 OrientDB 开源 NoSQL 数据库。 如需更多帮助或有用信息,我们建议您查看 OrientDB 官方网站.

[ad_2]

Related Posts