温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么在Ubuntu16.04上安装OrientDB

发布时间:2022-01-21 14:33:02 来源:亿速云 阅读:135 作者:iii 栏目:开发技术

这篇文章主要讲解了“怎么在Ubuntu16.04上安装OrientDB”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么在Ubuntu16.04上安装OrientDB”吧!

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

下载 OrientDB

我们可以从最新的服务端上通过输入下面的指令来下载最新版本的 OrientDB。

  1. $ 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 指令来操作解压它:

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

将从中提取出来的文件夹整体移动到 /opt

  1. # mv orientdb-community-2.2.22 /opt/orientdb

启动 OrientDB 服务器

启动 OrientDB 服务器需要运行 orientdb/bin/ 目录下的 shell 脚本:

  1. # /opt/orientdb/bin/server.sh

如果你是第一次开启 OrientDB 服务器,安装程序还会显示一些提示信息,以及提醒你设置 OrientDB 的 root 用户密码:

  1. +---------------------------------------------------------------+

  2. | WARNING: FIRST RUN CONFIGURATION |

  3. +---------------------------------------------------------------+

  4. | This is the first time the server is running. Please type a |

  5. | password of your choice for the 'root' user or leave it blank |

  6. | to auto-generate it. |

  7. | |

  8. | To avoid this message set the environment variable or JVM |

  9. | setting ORIENTDB_ROOT_PASSWORD to the root password to use. |

  10. +---------------------------------------------------------------+

  11. Root password [BLANK=auto generate it]: ********

  12. Please confirm the root password: ********

在完成这些后,OrientDB 数据库服务器将成功启动:

  1. INFO OrientDB Server is active v2.2.22 (build fb2b7d321ea8a5a5b18a82237049804aace9e3de). [OServer]

从现在开始,我们需要用第二个终端来与 OrientDB 服务器进行交互。

若要强制停止 OrientDB 执行 Ctrl+C 即可。

配置守护进程

此时,我们可以认为 OrientDB 仅仅是一串 shell 脚本,可以用编辑器打开 /opt/orientdb/bin/orientdb.sh

  1. # $EDITOR /opt/orientdb/bin/orientdb.sh

在它的首段,我们可以看到:

  1. #!/bin/sh

  2. # OrientDB service script

  3. #

  4. # Copyright (c) OrientDB LTD (http://orientdb.com/)

  5. # chkconfig: 2345 20 80

  6. # description: OrientDb init script

  7. # processname: orientdb.sh

  8. # You have to SET the OrientDB installation directory here

  9. ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"

  10. ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"

我们需要配置ORIENTDB_DIR 以及 ORIENTDB_USER.

然后创建一个用户,例如我们创建一个名为 orientdb 的用户,我们需要输入下面的指令:

  1. # useradd -r orientdb -s /sbin/nologin

orientdb 就是我们在 ORIENTDB_USER 处输入的用户。

再更改 /opt/orientdb 目录的所有权:

  1. # chown -R orientdb:orientdb /opt/orientdb

改变服务器配置文件的权限:

  1. # chmod 640 /opt/orientdb/config/orientdb-server-config.xml

下载系统守护进程服务

OrientDB 的压缩包包含一个服务文件 /opt/orientdb/bin/orientdb.service。我们将其复制到 /etc/systemd/system 文件夹下:

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

编辑该服务文件:

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

其中 [service] 内容块看起来应该是这样的:

  1. [Service]

  2. User=ORIENTDB_USER

  3. Group=ORIENTDB_GROUP

  4. ExecStart=$ORIENTDB_HOME/bin/server.sh

将其改成如下样式:

  1. [Service]

  2. User=orientdb

  3. Group=orientdb

  4. ExecStart=/opt/orientdb/bin/server.sh

保存并退出。

重新加载系统守护进程:

  1. # systemctl daemon-reload

启动 OrientDB 并使其开机自启动:

  1. # systemctl start orientdb

  2. # systemctl enable orientdb

确认 OrientDB 的状态:

  1. # systemctl status orientdb

上述指令应该会输出:

  1. ● orientdb.service - OrientDB Server

  2. Loaded: loaded (/etc/systemd/system/orientdb.service; disabled; vendor preset: enabled)

  3. Active: active (running) ...

感谢各位的阅读,以上就是“怎么在Ubuntu16.04上安装OrientDB”的内容了,经过本文的学习后,相信大家对怎么在Ubuntu16.04上安装OrientDB这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI