ArangoDB - Web 界面



在本节中,我们将学习如何启用/禁用身份验证,以及如何将 ArangoDB 绑定到公共网络接口。

# arangosh --server.endpoint tcp://127.0.0.1:8529 --server.database "_system"

它会提示你输入之前保存的密码 −

Please specify a password:

在配置中使用你为 root 创建的密码。

还可以使用 curl 检查你是否真的针对需要身份验证的请求获得了 HTTP 401(未授权)服务器响应 −

# curl --dump - http://127.0.0.1:8529/_api/version

输出

HTTP/1.1 401 Unauthorized
X-Content-Type-Options: nosniff
Www-Authenticate: Bearer token_type = "JWT", realm = "ArangoDB"
Server: ArangoDB
Connection: Keep-Alive
Content-Type: text/plain; charset = utf-8
Content-Length: 0

为了避免在学习过程中每次都输入密码,我们将禁用身份验证。为此,打开配置文件 −

# vim /etc/arangodb3/arangod.conf

如果代码不可见,应更改配色方案。

:colorscheme desert

如下面的屏幕截图所示,将身份验证设置为 false。

Output Window Root Password

重新启动服务 −

# service arangodb3 restart

将身份验证设为 false 后,你将能够登录(在本例中使用 root 或创建的用户,如 Harry),而无需在 请指定密码中输入任何密码。

当身份验证关闭时,让我们检查一下 api 版本 −

# curl --dump - http://127.0.0.1:8529/_api/version

输出

HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Server: ArangoDB
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
Content-Length: 60
{"server":"arango","version":"3.1.27","license":"community"}
广告
© . All rights reserved.