Arangodb 简明教程

ArangoDB - System Requirements

在本章中,我们将讨论 ArangoDB 的系统要求。

In this chapter, we will discuss the system requirements for ArangoDB.

ArangoDB 的系统要求如下 -

The system requirements for ArangoDB are as follows −

  1. A VPS Server with Ubuntu Installation

  2. RAM: 1 GB; CPU : 2.2 GHz

在本教程中的所有命令中,我们使用了一台 RAM 为 1GB 的 Ubuntu 16.04(xenial)实例,配备一个处理能力为 2.2GHz 的 CPU。并且本教程中的所有 arangosh 命令均针对 ArangoDB 版本 3.1.27 进行测试。

For all the commands in this tutorial, we have used an instance of Ubuntu 16.04 (xenial) of RAM 1GB with one cpu having a processing power 2.2 GHz. And all the arangosh commands in this tutorial were tested for the ArangoDB version 3.1.27.

How to Install ArangoDB?

在本节中,我们将了解如何安装 ArangoDB。ArangoDB 已针对许多操作系统和发行版预构建。有关更多详细信息,请参阅 ArangoDB 文档。如前所述,对于本教程,我们将使用 Ubuntu 16.04x64。

In this section, we will see how to install ArangoDB. ArangoDB comes pre-built for many operating systems and distributions. For more details, please refer to the ArangoDB documentation. As already mentioned, for this tutorial we will use Ubuntu 16.04x64.

第一步是下载其储存库的公钥 -

The first step is to download the public key for its repositories −

# wget https://www.arangodb.com/repositories/arangodb31/
xUbuntu_16.04/Release.key

Output

--2017-09-03 12:13:24-- https://www.arangodb.com/repositories/arangodb31/xUbuntu_16.04/Release.key
Resolving https://www.arangodb.com/
(www.arangodb.com)... 104.25.1 64.21, 104.25.165.21,
2400:cb00:2048:1::6819:a415, ...
Connecting to https://www.arangodb.com/
(www.arangodb.com)|104.25. 164.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3924 (3.8K) [application/pgpkeys]
Saving to: ‘Release.key’
Release.key 100%[===================>] 3.83K - .-KB/s in 0.001s
2017-09-03 12:13:25 (2.61 MB/s) - ‘Release.key’ saved [39 24/3924]

重点是,你应该看到 Release.key 保存于输出结尾处。

The important point is that you should see the Release.key saved at the end of the output.

让我们使用以下代码行安装已保存的密钥 -

Let us install the saved key using the following line of code −

# sudo apt-key add Release.key

Output

OK

运行以下命令以添加 apt 存储库并更新索引 -

Run the following commands to add the apt repository and update the index −

# sudo apt-add-repository 'deb
https://www.arangodb.com/repositories/arangodb31/xUbuntu_16.04/ /'
# sudo apt-get update

作为最后一步,我们可以安装 ArangoDB -

As a final step, we can install ArangoDB −

# sudo apt-get install arangodb3

Output

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
arangodb3
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 55.6 MB of archives.
After this operation, 343 MB of additional disk space will be used.

Enter 。现在,安装 ArangoDB 的进程将开始 -

Press Enter. Now the process of installing ArangoDB will start −

Get:1 https://www.arangodb.com/repositories/arangodb31/xUbuntu_16.04
arangodb3 3.1.27 [55.6 MB]
Fetched 55.6 MB in 59s (942 kB/s)
Preconfiguring packages ...
Selecting previously unselected package arangodb3.
(Reading database ... 54209 files and directories currently installed.)
Preparing to unpack .../arangodb3_3.1.27_amd64.deb ...

Unpacking arangodb3 (3.1.27) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up arangodb3 (3.1.27) ...
Database files are up-to-date.

当 ArangoDB 安装即将完成时,将出现以下屏幕 -

When the installation of ArangoDB is about to complete, the following screen appears −

installation of arangodb

在这里,系统将要求你为 ArangoDB root 用户提供密码。小心记录下密码。

Here, you will be asked to provide a password for the ArangoDB root user. Note it down carefully.

在出现以下对话框时选择 yes 选项 -

Select the yes option when the following dialog box appears −

configuration dialog box

当你像在上述对话框中那样单击 Yes 时,将出现以下对话框。在此处单击 Yes

When you click Yes as in the above dialog box, the following dialog box appears. Click Yes here.

configuration dialog box2

你还可以使用以下命令检查 ArangoDB 的状态 -

You can also check the status of ArangoDB with the following command −

# sudo systemctl status arangodb3

Output

arangodb3.service - LSB: arangodb
Loaded: loaded (/etc/init.d/arangodb3; bad; vendor pre set: enabled)
Active: active (running) since Mon 2017-09-04 05:42:35 UTC;
4min 46s ago
Docs: man:systemd-sysv-generator(8)
Process: 2642 ExecStart=/etc/init.d/arangodb3 start (code = exited,
status = 0/SUC
Tasks: 22
Memory: 158.6M
CPU: 3.117s
CGroup: /system.slice/arangodb3.service
├─2689 /usr/sbin/arangod --uid arangodb
--gid arangodb --pid-file /va
└─2690 /usr/sbin/arangod --uid arangodb
--gid arangodb --pid-file /va
Sep   04 05:42:33   ubuntu-512  systemd[1]:        Starting LSB:  arangodb...
Sep   04 05:42:33   ubuntu-512  arangodb3[2642]:  * Starting arango database server a
Sep   04 05:42:35   ubuntu-512  arangodb3[2642]:   {startup} starting up in daemon mode
Sep   04 05:42:35   ubuntu-512  arangodb3[2642]:   changed working directory for child
Sep   04 05:42:35   ubuntu-512  arangodb3[2642]:   ...done.
Sep   04 05:42:35   ubuntu-512  systemd[1]:        StartedLSB: arang odb.
Sep   04 05:46:59   ubuntu-512  systemd[1]:        Started LSB: arangodb. lines 1-19/19 (END)

现在,ArangoDB 已准备好使用。

ArangoDB is now ready to be used.

要调用 arangosh 终端,在终端中键入以下命令 −

To invoke the arangosh terminal, type the following command in the terminal −

# arangosh

Output

Please specify a password:

提供安装时创建的 root 密码 −

Supply the root password created at the time of installation −

_
__ _ _ __ __ _ _ __ __ _ ___ | |
/ | '__/ _ | ’ \ / ` |/ _ / | ’
| (| | | | (| | | | | (| | () _ \ | | |
_,|| _,|| ||_, |_/|/| ||
|__/
arangosh (ArangoDB 3.1.27 [linux] 64bit, using VPack 0.1.30, ICU 54.1, V8
5.0.71.39, OpenSSL 1.0.2g 1 Mar 2016)

Copyright (c) ArangoDB GmbH

Pretty printing values.
Connected to ArangoDB 'http+tcp://127.0.0.1:8529' version: 3.1.27 [server],
database: '_system', username: 'root'

Please note that a new minor version '3.2.2' is available
Type 'tutorial' for a tutorial or 'help' to see common examples
127.0.0.1:8529@_system> exit
output window root password

要从 ArangoDB 注销,请键入以下命令 −

To log out from ArangoDB, type the following command −

127.0.0.1:8529@_system> exit

Output

Uf wiederluege! Na shledanou! Auf Wiedersehen! Bye Bye! Adiau! ¡Hasta luego!
Εις το επανιδείν!

להתראות ! Arrivederci! Tot ziens! Adjö! Au revoir! さようなら До свидания! Até
Breve! !خداحافظ