介绍
CouchDB是基于面向文档的数据库体系结构的数据库。它使用JSON来存储数据和JavaScript作为查询语言。
它是Apache Software Foundation的一个项目, 于2005年首次发布。
在本教程中, 我们将在Ubuntu操作系统中安装CouchDB。这整个过程包括以下步骤。
先决条件
- 的Ubuntu
- 在终端中以管理员用户身份登录
安装
更新apt软件包管理器的本地存储库索引。
$ apt-get update
安装
$ apt-get install couchdb

启动CouchDB服务器
$ service couchdb start
启动CouchDB之后, 我们可以使用localhost:5984从浏览器访问数据库。它将如下所示。

创建数据库
要创建项目, 请在浏览器中输入该URL localhost:5984 / _utils。它将打开以下界面, 使我们可以创建数据库。如我们所见, 在这里, 我们正在创建一个新的数据库javatoint。

以下输出显示了创建的数据库。

好了, 我们已经在操作系统中成功安装了CouchDB。现在, 我们可以执行与数据库相关的任务。
额外信息
以下是可用于管理CouchDB服务器的有用命令。
启动CouchDB
使用以下命令启动CouchDB。
$ service couchdb start
停止CouchDB
使用以下命令停止CouchDB。
$ service couchdb stop
重新启动CouchDB
使用以下命令重新启动CouchDB。
$ service couchdb restart
CouchDB运行状态
$ service couchdb status
