1.软文推荐

2.软文推荐

3.软文推荐

OrientDB是属于NoSQL系列数据库管理系统,OrientDB是第二代分布式数据库具有灵活性的文档在一个产品与Apache 2许可证的开放源代码。

这个教程旨在教会大家如何在运行 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 服务器

启动 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 社区版成功安装并且正确运行在我们的服务器上了。

本文来源:www.lxlinux.net/624.html,若引用不当,请联系修改。

相关文章 8

1

Python基础讲解:关于条件 2分钟前

条件成立的条件 条件成立,即条件整体返回Ture,条件不成立,即条件整体返回False 比较运算符 分支条件判断的场景一般为: a大于b、a小于b、...

2

云服务器全球购(广州全球云购网络科技有限公司) 3分钟前

目录:1、购买云计算服务器哪家更优惠些?2、国外的云服务器,除了亚马逊aws,还有值得推荐的吗3、购买云计算服务器找哪家比较好?4、云...

3

Java Math使用方法 6分钟前

Math类包含完成基本数学函数所需的方法。这些方法分为三类:三角函数方法、指数函数方法和服务方法。除了这些方法以外,Math类还提供了...

4

Alpine linux安装:APK包管理器 8分钟前

alpine 提供了非常好用的apk软件包管理工具,通过apk help命令查看完整的包管理命令。 Alpine Linux的优劣 优势 Alpine Linux的Docker镜像特点是轻巧...

5

Linux系统中fork函数的具体使用方法 9分钟前

本篇文章主要为大家分享一下Linux系统中fork函数的具体使用方法,本篇中包含多个案例,大家一定要认真思考阅读,下面一起来看看fork函数...

6

北京云服务器哪家好(云服务器买哪里的好) 10分钟前

目录:1、有哪些云服务器比较好2、云服务器哪个品牌比较好3、云服务器哪家好用便宜4、云服务器哪家好?5、有没有好的云服务器推荐啊,...

7

Redis数据类型:List使用方法 11分钟前

Redis是一个开源的,先进的key-value存储,属于非关系型缓存数据库,通常被称为数据结构服务器。redis一共有五种基本的数据类型,String类型...

8

Bash Shell数组使用方法 14分钟前

数组变量可以存放多个值;bash只支持一维数组,初始化时不需要定义数组大小。 bash数组分为普通数组和关联数组,普通数组索引下标为从...