Apache CouchDB是一个面向NoSQL文档的数据库系统,以其简单性,可扩展性和容错性而闻名。它旨在帮助您在分布式环境中轻松存储、管理和检索数据。CouchDB 有一个 RESTful API,使您能够使用 HTTP 请求与数据库进行交互。
在 Ubuntu 22.04 LTS Jammy Jellyfish 上安装 Apache CouchDB
第 1 步。首先,通过在终端中运行以下命令,确保所有系统软件包都是最新的。apt
<span class="pln">sudo apt update sudo apt upgrade</span>
第 3 步。在 Ubuntu 22.04 上安装 Apache CouchDB。
默认情况下,Apache CouchDB 软件包在默认的 Ubuntu 22.04 仓库中不可用,因此您需要将 CouchDB 仓库添加到您的系统中。运行以下命令以添加 Icinga 存储库:
<span class="pln">echo </span><span class="str">"deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ jammy main"</span> <span class="pun">|</span><span class="pln"> sudo tee </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="pln">list</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">couchdb</span><span class="pun">.</span><span class="pln">list </span><span class="pun">></span><span class="str">/dev/</span><span class="kwd">null</span>
接下来,使用以下命令添加 GPG 密钥:
<span class="pln">curl https</span><span class="pun">:</span><span class="com">//couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1 source /etc/os-release</span>
添加 CouchDB 存储库后,通过运行以下命令更新系统并安装 CouchDB 软件包:
<span class="pln">sudo apt update sudo apt install couchdb</span>
第一个提示询问 CouchDB 配置的类型:
<span class="pun">┌─────────┤</span> <span class="typ">Configuring</span><span class="pln"> couchdb </span><span class="pun">├─────────┐</span> <span class="pun">│</span> <span class="typ">General</span><span class="pln"> type </span><span class="kwd">of</span> <span class="typ">CouchDB</span><span class="pln"> configuration</span><span class="pun">:</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span><span class="pln"> standalone </span><span class="pun">│</span> <span class="pun">│</span><span class="pln"> clustered </span><span class="pun">│</span> <span class="pun">│</span><span class="pln"> none </span><span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">└─────────────────────────────────────────┘</span>
出于演示目的,考虑到数据库安装在单个服务器中,独立选项是可行的方法。
接下来,输入接口 IP 地址并继续:
<span class="pun">┌─────────────────────────┤</span> <span class="typ">Configuring</span><span class="pln"> couchdb </span><span class="pun">├──────────────────────────┐</span> <span class="pun">│</span><span class="pln"> A </span><span class="typ">CouchDB</span><span class="pln"> node must bind to a specific network </span><span class="kwd">interface</span><span class="pun">.</span> <span class="typ">This</span> <span class="kwd">is</span> <span class="kwd">done</span> <span class="pun">│</span> <span class="pun">│</span><span class="pln"> via IP address</span><span class="pun">.</span> <span class="typ">Only</span><span class="pln"> a single address </span><span class="kwd">is</span><span class="pln"> supported at </span><span class="kwd">this</span><span class="pln"> time</span><span class="pun">.</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="typ">The</span><span class="pln"> special </span><span class="kwd">value</span> <span class="str">'0.0.0.0'</span><span class="pln"> binds </span><span class="typ">CouchDB</span><span class="pln"> to all network interfaces</span><span class="pun">.</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="typ">The</span> <span class="kwd">default</span> <span class="kwd">is</span> <span class="lit">127.0</span><span class="pun">.</span><span class="lit">0.1</span> <span class="pun">(</span><span class="pln">loopback</span><span class="pun">)</span> <span class="kwd">for</span><span class="pln"> standalone nodes</span><span class="pun">,</span> <span class="kwd">and</span> <span class="lit">0.0</span><span class="pun">.</span><span class="lit">0.0</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">(</span><span class="pln">all interfaces</span><span class="pun">)</span> <span class="kwd">for</span><span class="pln"> clustered nodes</span><span class="pun">.</span> <span class="typ">In</span><span class="pln"> clustered mode</span><span class="pun">,</span><span class="pln"> it </span><span class="kwd">is</span> <span class="kwd">not</span> <span class="pun">│</span> <span class="pun">│</span><span class="pln"> allowed to bind to </span><span class="lit">127.0</span><span class="pun">.</span><span class="lit">0.1</span><span class="pun">.</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="typ">CouchDB</span> <span class="kwd">interface</span><span class="pln"> bind address</span><span class="pun">:</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="lit">127.0</span><span class="pun">.</span><span class="lit">0.1</span><span class="pln">_______________________________________________________________ </span><span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">│</span> <span class="pun">└──────────────────────────────────────────────────────────────────────────┘</span>
您可以使用以下命令确认安装成功,并且服务正在运行:
<span class="pln">curl http</span><span class="pun">:</span><span class="com">//127.0.0.1:5984/</span>
安装完成后,您可以通过运行以下命令来启动 CouchDB 服务:
<span class="pln">sudo systemctl enable couchdb sudo systemctl start couchdb</span>
第 4 步。访问 Apache CouchDB Web 界面。
一旦你安装并配置了Apache CouchDB,就该验证它是否正常运行了。您可以通过访问位于 的 CouchDB Web 界面来执行此操作。如果一切正常,您将看到一个登录屏幕。http://localhost:5984/_utils/
感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 Apache CouchDB 开源非关系数据库。有关其他帮助或有用信息,我们建议您查看 Apache 网站。