Introduction | Usually when we mention databases, we think of two main categories: using a type of interface between users and applications called Structured Query Language (Structured Query Language, (SQL) relational database management system (RDBMS) and non-relational database management systems (NoSQL database). |
There are huge differences between these two models in how they process (store) data.
Relational database management systemIn a relational model (such as MySQL, or its offshoot MariaDB), a database is a collection of tables, each of which contains one or more data categories organized in columns. Each row of the database contains a unique instance of data, whose classification is defined by columns.
As an example, imagine a table containing customers. Each row is equivalent to a customer, and each column corresponds to the name, address and other necessary information.
The other table may contain orders, products, customers, dates and others. Users of this database can get a view that meets their needs, such as a report on a customer's purchases of products within a specific price range.
Non-relational database management systemIn a non-relational database (or not only SQL) management system, the database is designed to store data in different ways, such as document storage, key-value pair storage, graph relational storage, and other methods. storage. Database systems implemented in this form are specifically used for large database clusters and large web applications. Today, non-relational databases are used by some large companies such as Google and Amazon.
Document storage databaseDocument storage database stores data in the form of documents. This type of use is typically represented by JavaScript and JSON, although XML and other forms of storage can also be used. An example here is MongoDB.
Key-value pair storage databaseThis is a simple model with a unique key key paired with a value value. This system is high-performance and highly scalable in terms of caching. Examples here include BerkeleyDB and MemacacheDB.
Graph relational databaseAs the name suggests, this kind of database stores data by using a graph model, which means that data is organized through nodes and interconnections between nodes. This is a flexible model that can evolve over time and use. This system should be used where mapping relationships are emphasized. Examples here are IBM Graphs, Neo4j, and OrientDB.
OrientDBOrientDB is a multi-mode non-relational database management system. As the company that developed it puts it "It is a scalable, high-performance database that combines graph relationships with document, key-value, reactive, object-oriented and geospatial models".
OrientDB also supports SQL, which can be used to operate trees and graphs after expansion.
contentTarget
This tutorial is designed to teach you how to download and configure OrientDB Community Edition on a server running Ubuntu 16.04.
We can download the latest version of OrientDB from the latest server by entering the following command.
$ wget -O orientdb-community-2.2.22.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.22.tar.gz&os=linux
What is downloaded here is a compressed package containing precompiled binary files, so we can use the tar command to decompress it:
$ tar -zxf orientdb-community-2.2.22.tar.gz
Move the extracted folder as a whole to /opt:
# mv orientdb-community-2.2.22 /opt/orientdb
To start the OrientDB server, you need to run the shell script in the orientdb/bin/ directory:
# /opt/orientdb/bin/server.sh
If you start the OrientDB server for the first time, the installation program will also display some prompt information and remind you to set the root user password of OrientDB:
+---------------------------------------------------------------+ | 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: ********
After completing these, the OrientDB database server will start successfully:
INFO OrientDB Server is active v2.2.22 (build fb2b7d321ea8a5a5b18a82237049804aace9e3de). [OServer]
From now on, we need to use a second terminal to interact with the OrientDB server.
To force stop OrientDB, just press Ctrl C.
Configuration daemonAt this point, we can think of OrientDB as just a string of shell scripts, which can be opened with an editor /opt/orientdb/bin/orientdb.sh:
# $EDITOR /opt/orientdb/bin/orientdb.sh
In its first paragraph, we can see:
#!/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"
We need to configure ORIENTDB_DIR and ORIENTDB_USER.
Then create a user. For example, if we create a user named orientdb, we need to enter the following command:
# useradd -r orientdb -s /sbin/nologin
orientdb is the user we entered at ORIENTDB_USER.
Then change the ownership of the /opt/orientdb directory:
# chown -R orientdb:orientdb /opt/orientdb
Change the permissions of the server configuration file:
# chmod 640 /opt/orientdb/config/orientdb-server-config.xml
The compressed package of OrientDB contains a service file /opt/orientdb/bin/orientdb.service. We copy it to the /etc/systemd/system folder:
# cp /opt/orientdb/bin/orientdb.service /etc/systemd/system
Edit the service file:
# $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 社区版成功安装并且正确运行在我们的服务器上了。
总结在这个指导中,我们看到了一些关系型数据库管理系统(RDBMS)以及非关系型数据库管理系统(NoSQL DBMS)的简单对照。我们也安装 OrientDB 社区版的服务器端并完成了其基础的配置。
这是我们部署完全的 OrientDB 基础设施的第一步,也是我们用于管理大型系统数据的起步。
The above is the detailed content of Install OrientDB on Ubuntu 16.04. For more information, please follow other related articles on the PHP Chinese website!