如何安装 Apache Debian 11 上的 CouchDB

在本教程中,我们将向您展示如何安装 Apache Debian 11 上的 CouchDB。对于那些不知道的人, Apache CouchDB 是一个开源的 NoSQL 数据库,由 Apache 软件基金会。 CouchDB 使用多种格式和协议来存储、传输和处理数据。 CouchDB 使用 JSON 存储数据,JavaScript 作为其查询语言,HTTP 作为 API。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我会告诉你一步一步的安装 Apache Debian 11 (Bullseye) 上的 CouchDB NoSQL 数据库服务器。

先决条件

  • 运行以下操作系统之一的服务器:Debian 10 或 Debian 11。
  • 建议您使用全新的操作系统安装来防止任何潜在问题。
  • 对服务器的 SSH 访问(或者如果您在桌面上,则只需打开终端)。
  • 一个 non-root sudo user或访问 root user. 我们建议充当 non-root sudo user,但是,如果您在充当 root 时不小心,可能会损害您的系统。

安装 Apache Debian 11 Bullseye 上的 CouchDB

第 1 步。在我们安装任何软件之前,重要的是通过运行以下命令确保您的系统是最新的 apt 终端中的命令:

sudo apt update sudo apt upgrade sudo apt install curl apt-transport-https gnupg nano lsb-release

步骤 2. 安装 Apache Debian 11 上的 CouchDB。

默认情况下,CouchDB 在 Debian 11 基础存储库中不可用。 所以,现在运行下面的命令来添加 Apache CouchDB 存储库到您的 Debian 系统:

echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ `lsb_release -cs` main"      | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null

接下来,导入 GPG 密钥:

curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1

启用存储库后,现在安装最新版本的 Apache CouchDB 使用以下命令:

sudo apt update sudo apt install couchdb

在安装过程中,系统会要求您配置 CouchDB。 在第一个窗口中,阅读配置并按 ok 继续:

┌──────────────────────────┤ Configuring couchdb ├──────────────────────────┐  │                                                                           │   │ Please select the CouchDB server configuration type that best meets your      │ needs.                                                                        │                                                                               │ For single-server configurations, select standalone mode. This will set       │ up CouchDB to run as a single server.                                         │                                                                               │ For clustered configuration, select clustered mode. This will prompt for      │ additional parameters required to configure CouchDB in a clustered            │ configuration.                                                                │                                                                               │ If you prefer to configure CouchDB yourself, select none. You will then       │ need to edit /opt/couchdb/etc/vm.args and /opt/couchdb/etc/local.d/*.ini      │ yourself. Be aware that this will bypass *all* configuration steps,           │ including setup of a CouchDB admin user - leaving CouchDB in "admin           │                                                                               │                                                                           │                                                                           │   └───────────────────────────────────────────────────────────────────────────┘

接下来,选择 独立的 选项并继续:

┌─────────┤ Configuring couchdb ├─────────┐                   │ General type of CouchDB configuration:  │                    │                                         │                    │               standalone                │                    │               clustered                 │                    │               none                      │                    │                                         │                    │                                         │                    │                                     │                    │                                         │                    └─────────────────────────────────────────┘

接下来,输入接口 IP 地址并继续:

┌─────────────────────────┤ Configuring couchdb ├──────────────────────────┐   │ A CouchDB node must bind to a specific network interface. This is done   │    │ via IP address. Only a single address is supported at this time.         │    │                                                                          │    │ The special value '0.0.0.0' binds CouchDB to all network interfaces.     │    │                                                                          │    │ The default is 127.0.0.1 (loopback) for standalone nodes, and 0.0.0.0    │    │ (all interfaces) for clustered nodes. In clustered mode, it is not       │    │ allowed to bind to 127.0.0.1.                                            │    │                                                                          │    │ CouchDB interface bind address:                                          │    │                                                                          │    │ 127.0.0.1_______________________________________________________________ │    │                                                                          │    │                                                                      │    │                                                                          │    └──────────────────────────────────────────────────────────────────────────┘

您可以使用以下方法验证您的 CouchDB 安装 curl Debian 11 上的命令:

curl https://127.0.0.1:5984/

输出:

{"couchdb":"Welcome","version":"3.2.3","git_sha":"d5b73187c","uuid":"7a20b1eadd8meilana7fb96jelitae","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

步骤 4. 访问 Apache CouchDB NoSQL Web 界面。

成功安装后,打开系统上的 Web 浏览器并在地址栏中输入服务器的 IP。 您将获得默认值 Apache 沙发数据库页面:

https://Your-IP-address:5984/_utils/

恭喜! 您已成功安装 Apache 沙发数据库。 感谢您使用本教程安装最新版本的 Apache Debian 11 Bullseye 上的 CouchDB NoSQL 数据库。 如需更多帮助或有用信息,我们建议您查看 官方 Apache 网站.