第1步:将CouchDB存储库添加到Ubuntu

将Apache CouchDB存储库添加到Ubuntu方面很简单。

运行以下命令以添加存储库密钥和存储库。

sudo apt install curl
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add 
echo "deb https://apache.bintray.com/couchdb-deb focal main" | sudo tee -a /etc/apt/sources.list

第3步:访问Apache CouchDB

安装CouchDB后,默认端口号是5984,
可以使用浏览器打开

http://127.0.0.1:5984/_utils/

输入管理员用户名和密码。

如何在Ubuntu 20.04上安装CouchDB

第2步:更新并安装Apache CouchDB

运行以下命令以更新并安装最新的Apache CouchDB包

sudo apt update
sudo apt-get install apache2 couchdb

在安装过程中,您应该看到一些选择选项的消息。

┌──────────────────────────┤ 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         
 │                                                                             
 │                                <Ok>                                         
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘

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

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

接下来,键入接口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_______________________________________________________________ │ 
  │                                                                          │ 
  │                           <Ok>                                           │ 
  │                                                                          │ 
  └──────────────────────────────────────────────────────────────────────────┘

之后,键入并确认管理员密码并完成安装。

安装couchdb之后,下面的命令可用于停止,启动,启用和检查其状态。

sudo systemctl stop couchdb.service
sudo systemctl start couchdb.service
sudo systemctl enable couchdb.service
sudo systemctl status couchdb.service

查看couchdb的状态

Executing /lib/systemd/systemd-sysv-install enable couchdb
jack@ubuntu1604:~$sudo systemctl status couchdb.service
● couchdb.service - Apache CouchDB
   Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: 
   Active: active (running) since Wed 2015-06-20 15:34:51 CDT; 14s ago
 Main PID: 3788 (beam)
   CGroup: /system.slice/couchdb.service
           ├─3788 /opt/couchdb/bin/../erts-7.3/bin/beam -K true -A 16 -Bd -- -ro
           ├─3800 /opt/couchdb/bin/../erts-7.3/bin/epmd -daemon
           ├─3818 sh -s disksup
           ├─3820 /opt/couchdb/bin/../lib/os_mon-2.4/priv/bin/memsup
           └─3821 /opt/couchdb/bin/../lib/os_mon-2.4/priv/bin/cpu_sup
Jun 20 15:34:51 ubuntu1604 systemd[1]: Started Apache CouchDB.
lines 1-12/12 (END)
日期:2020-07-07 20:57:21 来源:oir作者:oir