如何在 CentOS 7 上安装 OrientDB

在本教程中,我们将向您展示如何在您的 CentOS 7 上安装 OrientDB。对于那些不知道的人,OrientDB 有一个多模型 NoSQL 数据库,它支持带有图形的文档数据库,这是一个基于 java 的应用程序,可以可以在任何支持多主复制和易于水平扩展的操作系统上运行。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我将向您展示在 CentOS 7 服务器上逐步安装 OrientDB 的开源 NoSQL 数据库管理系统。

在 CentOS 7 上安装 OrientDB

第 1 步。首先,让我们首先确保您的系统是最新的。

yum clean all
yum -y update

步骤 2. 安装 OrientDB。

首先,创建一个新用户来运行 OrientDB:

adduser orientdb -d /opt/orientdb

现在您可以通过运行以下命令下载 OrientDB 二进制存档:

cd /opt/orientdb/
wget https://orientdb.com/download.php?file=orientdb-community-importers-2.2.29.tar.gz -O /opt/orientdb/orientdb.tar.gz

下载包后,我们将解压缩并将提取的文件夹移动到 /opt/orientdb

tar -xf orientdb.tar.gz
mv orientdb-community*/* .

使 OrientDB 用户成为提取文件的所有者:

chown -R orientdb:orientdb /opt/orientdb

步骤 3. 启动 OrientDB 服务器。

OrientDB 为您提供了一个安装程序脚本来启动服务器。 切换到 OrientDB 用户:

su - orientdb
sudo 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.   |
+---------------------------------------------------------------+

步骤 4. 配置 OrientDB 守护进程。

创建一个新的 systemd 轻松管理 OrientDB 启动和停止的服务:

nano /etc/systemd/system/orientdb.service

粘贴以下内容:

[Unit]
Description=OrientDB service
After=network.target

[Service]
Type=simple
ExecStart=/opt/orientdb/bin/server.sh
User=orientdb
Group=orientdb
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=orientdb

[Install]
WantedBy=multi-user.target

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

systemctl daemon-reload

启动 OrientDB 并启用在启动时启动:

systemctl start orientdb
systemctl enable orientdb

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

Save