OrientDB 默认安装在/opt/orientdb 下
OrientDB提供了一个名为orientdb.sh的脚本文件作为守护程序运行数据库。 可以在OrientDB安装目录的bin/目录中找到它,它完整文件路径是:$ORIENTDB_HOME/bin/orientdb.sh。
在运行脚本文件之前,必须编辑orientdb.sh文件以定义两个变量。 一个是定义安装目录路径(/opt/orientdb)的ORIENTDB_DIR,另一个是定义您想要运行OrientDB的用户名的ORIENTDB_USER,如下所示。
ORIENTDB_DIR = "/opt/orientdb"
ORIENTDB_USER = "root"
Shell
使用以下命令将orientdb.sh文件复制到/etc/init.d/目录中以初始化并运行脚本。 这里我们使用超级用户命令(sudo),因此您必须提供超级用户密码才能执行以下命令。
$ sudo cp $ORIENTDB_HOME/bin/orientdb.sh /etc/init.d/orientdb
Shell
使用以下命令将OrientDB安装目录($ORIENTDB_HOME/bin)中的console.sh文件复制到系统bin目录(/usr/bin)以访问Orient DB的控制台。
$ sudo cp $ ORIENTDB_HOME/bin/console.sh /usr/bin/orientdb
Shell
使用以下命令将ORIENTDB数据库服务器作为服务启动。 在这里,必须提供您在orientdb.sh文件中提到的用于启动服务器的相应用户密码。
$ service orientdb start
Shell
使用以下命令知道OrientDB服务器守护程序正在运行的PID。
$ service orientdb status
Shell
使用以下命令停止OrientDB服务器守护进程。 在这里必须提供相应的用户密码来停止服务器。
$ service orientdb stop