Home > System Tutorial > LINUX > body text

How to install and configure ArangoDB

WBOY
Release: 2024-08-07 18:19:21
Original
705 people have browsed it

ArangoDB is an open source distributed native multi-model database. It is a NoSQL database with three data models: graph, document and key/value. ArangoDB uses SQL-like query language (AQL) to build high-performance applications.

ArangoDB installation

ArangoDB supports installation on Windows, Linux, Docker, Mac and other systems.

Installation of ArangoDB under Windows

Under Windows, you can download the compressed package version or the executable file version. I prefer to use the compressed package version. After downloading, just select a directory and decompress it directly. The directory structure after decompression roughly includes:

  • etc: All configuration files are in this directory
  • usr: including database execution files and js module libraries
  • var: data directory and FOXX program directory

The startup file is in the usr/bin/ directory. When starting, open a terminal, switch to this directory, execute the startup file, or it can also be made into a windows service.

Installation of ArangoDB under Linux

This article takes CentOS 7 as an example. For other Linux distributions, just follow the official instructions.

Execute the following command with root privileges:

cd <span class="hljs-regexp">/etc/</span>yum.repos.d/
curl -OL <span class="hljs-string">https:</span><span class="hljs-comment">//download.arangodb.com/arangodb33/CentOS_7/arangodb.repo</span>
yum -y install arangodb3<span class="hljs-number">-3.3</span><span class="hljs-number">.7</span>

yum -y install arangodb3-debuginfo<span class="hljs-number">-3.3</span><span class="hljs-number">.7</span>(默认情况下不是必须的)
Copy after login

After successful installation, carefully check the terminal output information:

SECURITY HINT:
run 'arango-secure-installation' to set a root password
the current password is '894a31beb567898c6dc0easdefga1eb6b'

It can be found that the default user is root, and a temporary password is provided, as well as the command to change the root password: arango-secure-installation. This command is actually a soft link to arangod, and arangod is the database server command of ArangoDB. Can be used to start the database, change passwords, etc.

At the same time, ArangoDB provides a web client to operate the database. It can be opened after starting the database server. The default port is 8529. You can also change the password after logging in with the initial password. It is much more convenient for students who are new to the command line. After all, The graphical interface is more intuitive.

ArangoDB configuration

ArangoDB has many configuration files. The one we usually configure most is arangod.conf. The directory of this file under Linux is usually under /etc/arangodb3/. Under Windows, because I am often used to using compressed package version, its configuration file Just in the etc/arangodb3 directory of the unzipped directory.

The content that usually needs to be configured includes the data storage path, log path, access address, etc.

Configure data path:

directory = /var/lib/arangodb3

Configure log path:

file = /var/log/arangodb3/arangod.log

Configure access path:

endpoint = tcp://127.0.0.1:8529

If you only access it locally, there is no problem, but if you want to access it on the LAN or external network, you must also add the access address of the LAN or external network:

endpoint = tcp://192.168.1.101:8529

After modification, restart the database and it can be accessed outside the local machine.

ArangoDB Startup

初始安装后会提供一串很长的密码,不太容易记住,所以我们要修改一下密码。我主要介绍两种修改密码的方法:在终端使用命令修改和在图形界面中修改。

1,在终端修改密码

在终端输入以下命令:

<span class="hljs-attribute">sudo</span> arango-secure-installation
Copy after login

系统会提示你输入 root 的密码:

Please enter password for root user:

输入两遍新密码即完成了密码更改,貌似不校验旧密码。

密码修改完后启动数据库登陆即可。

2,图形界面修改密码

使用图形界面操作,首先要启动 ArangoDB 数据库,有两种方式可启动数据库,一是直接使用上面提到的 arangod 命令:

 <span class="hljs-attribute">sudo</span> arangod
Copy after login

或者使用系统的服务 systemd 操作

 <span class="hljs-attribute">sudo</span> systemctl start arangodb3
Copy after login

......

INFO ArangoDB (version 3.3.7 [linux]) is ready for business. Have fun!

启动后查看终端或日志中有以上提示,表示启动成功。

查看一下 ArangoDB 的状态:

 <span class="hljs-attribute">sudo</span> systemctl status arangodb3
Copy after login

如果显示类似如下:

Active: active (running) since ...

表明启动成功。

两种启动方式比较推荐后一种,通过系统启动可以方便统一管理。

启动后即可在浏览器中打开客户端界面,输入 http://localhost:8529:

How to install and configure ArangoDB

username 默认为 root,密码就是那初始的一长串字符,登陆后,数据库选择 _system,进入到主页中,在左边栏中选择 USERS,在右边点击 root 用户,进去后就会看到修改密码的按钮,点击就可以修改密码了。

到此基本安装配置就完成了。

The above is the detailed content of How to install and configure ArangoDB. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template