CouchDB教程:windows/linux上安装CouchDB数据库

2019-08-1808:20:05数据库教程Comments3,625 views字数 3265阅读模式

如何下载和安装 CouchDB , 由于时间和篇幅的限制,这里只介绍在 Window 10 64位和Ubuntu的CouchDB安装配置。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

1. 在Windows上安装CouchDB

下载CouchDB文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

访问CouchDB官方网站:http://couchdb.apache.org/ , 点击右上方的下载(Download)链接,就会跳到下载页面,CouchDB有各种格式的文件可供下载,这里选择 Windows (x64) 这个版本,如下图所示 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

CouchDB教程:windows/linux上安装CouchDB数据库文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

完成安装后,打开浏览器并访问以下链接:http://127.0.0.1:5984/文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

如果没有问题,应该会看到以下输出:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

可以使用以下网址与CouchDB Web界面进行交互:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

http://127.0.0.1:5984/_utils文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

现在转到验证选项卡并验证安装情况:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

验证后,您将收到一条验证信息。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

现在转到安装程序选项卡,看到两个选项:配置集群(Configure cluster)和配置单节点(configure single node)。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

群集用于多个服务器和大型设置。 对于一个简单的数据库应用程序,则选择“配置单节点(configure single node)”。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

当您单击“配置单节点(configure single node)”时,必须填写一些凭据。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

可以通过单击“管理(Admin)”选项卡来更改密码或创建其他管理员。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

2. 在Linux系统上安装CouchDB

一些Linux系统在内部有提供CouchDB数据库。 例如,要在Ubuntu和Debian上安装CouchDB,请使用以下说明:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

sudo apt install couchdb
Shell

执行结果如下 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

yiibai@ubuntu:~$ sudo apt install couchdb
[sudo] password for yiibai:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  couchdb-bin couchdb-common erlang-asn1 erlang-base-hipe erlang-crypto
  erlang-eunit erlang-inets erlang-mnesia erlang-os-mon erlang-public-key
  erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tools
  erlang-webtool erlang-xmerl libmozjs185-1.0 libsctp1 lksctp-tools
Suggested packages:
  erlang erlang-manpages erlang-doc erlang-edoc erlang-gs erlang-observer
The following NEW packages will be installed:
  couchdb couchdb-bin couchdb-common erlang-asn1 erlang-base-hipe
  erlang-crypto erlang-eunit erlang-inets erlang-mnesia erlang-os-mon
  erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl
  erlang-syntax-tools erlang-tools erlang-webtool erlang-xmerl libmozjs185-1.0
  libsctp1 lksctp-tools
0 upgraded, 21 newly installed, 0 to remove and 450 not upgraded.
Need to get 19.7 MB of archives.
After this operation, 43.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Shell

安装完成后,couchdb自动启动,现在打开浏览器并测试安装结果 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

CouchDB教程:windows/linux上安装CouchDB数据库文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

注:可以看到上面默认安装的是 couchdb 1.5.0 版本,如果有兴趣可以安装最新版本,参考接下来的步骤。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

安装最新版本(apache-couchdb-1.6.0) -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$ sudo apt-get --no-install-recommends -y install \
    build-essential pkg-config erlang \
    libicu-dev libmozjs185-dev libcurl4-openssl-dev

$ sudo apt-get update

$ sudo apt-get install software-properties-common -y

添加PPA,以从相应的存储库获取最新的CouchDB版本:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$ sudo add-apt-repository ppa:couchdb/stable -y
Shell

现在已经添加了一个新的PPA,开始更新系统,使其具有最新的包信息:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$ sudo apt-get update
Shell

如果之前在此服务器上安装了CouchDB,请先删除现有版本:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$ sudo apt-get remove couchdb couchdb-bin couchdb-common -yf
Shell

现在安装CouchDB:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$ sudo apt-get install couchdb -y
Shell

通过上面步骤,couchdb最新稳定版本就安装好了。默认情况下,CouchDB在localhost上使用端口5984运行,可以通过从命令行运行curl来检索此基本信息(验证安装结果):文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

yiibai@ubuntu:~$ curl localhost:5984
{"couchdb":"Welcome","uuid":"22d9e91e925fecdb5a3698e26a7f6815","version":"1.6.1","vendor":{"name":"Ubuntu","version":"14.04"}}
yiibai@ubuntu:~$
Shell

CouchDB是一个Web界面,可以在Web浏览器上进行验证。打开以下主页网址:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

http://localhost:5984/
Shell

将看到以下输出:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

CouchDB教程:windows/linux上安装CouchDB数据库文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

如果Linux系统没有CouchDB,则安装CouchDB及其以下依赖项:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

  • Erlang OTP
  • ICU
  • OpenSSL
  • Mozilla SpiderMonkey
  • GNU Make
  • GNU Compiler Collection
  • libcurl
  • help2man
  • Python for docs
  • Python Sphinx

要安装上述依赖项,请使用以下命令:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

$sudo yum install autoconf  
$sudo yum install autoconf-archive  
$sudo yum install automake  
$sudo yum install curl-devel  
$sudo yum install erlang-asn1  
$sudo yum install erlang-erts  
$sudo yum install erlang-eunit  
$sudo yum install erlang-os_mon  
$sudo yum install erlang-xmerl  
$sudo yum install help2man  
$sudo yum install js-devel  
$sudo yum install libicu-devel  
$sudo yum install libtool  
$sudo yum install perl-Test-Harness
Shell

然后配置并启动CouchDB。使用以下URL验证输出:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

http://127.0.0.1:5984/

原文出自【易百教程】,商业转载请联系作者获得授权,非商业转载请保留原文链接:https://www.yiibai.com/couchdb/installation.html文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html

文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/15409.html
  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/sjk/15409.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定