⼿动安装couchdb并且指定版本详细教程
安装必要的依赖库
yum install build-essential
yum install libncurses5-dev
yum install libssl-dev
yum install m4
yum install unixodbc unixodbc-dev
yum install freeglut3-dev libwxgtk2.8-dev
yum install xsltproc
yum install fop
yum install tk8.5
yum install ncurses-devel
yum install zip
yum install libicu-devel
yum install openssl-devel
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum -y groupinstall "Development Tools" "Development Libraries"
rpm -Uvh /pub/arch.rpm
yum install autoconf automake curl-devel help2man libicu-devel libtool perl-Test-Harness wget libicu-devel curl-devel ncurses-devel libtool libxslt fop java-1.7.0-op
源码安装erlang
yum install erlang-asn1 erlang-erts erlang-eunit erlang erlang-os_mon erlang-xmerlwget /download/otp_src_19. #满⾜依赖的最新版erlan tar -xvf otp_src_19.
cd otp_src_19.3
./configure && make
make install
源码安装 js-devel
wget //js/js185-1.0.
cd js-1.8.5/js/src
./configure && make
sudo make install
安装autoconf-archive
vim /pos.po
[PUIAS_6_computational]
name=PUIAS computational Base $releasever - $basearch
mirrorlist=puias.math.ias.edu/data/puias/computational/$releasever/$basearch/mirrorlist gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias
yum install autoconf-archive -y
源码安装CouchDB
wget mirror.bit.edu/apache/couchdb/source/2.0.0/apache-couchdb-2.0.
tar zxvf apache-couchdb-2.0.
cd apache-couchdb-2.0.0
./configure
make release # 这⾥有报错,根据解决⽅法修改完成之后重新make release,在⽂章末尾
添加⽤户启动couchdb
adduser --system --no-create-home --shell /bin/bash -c "CouchDB Administrator" couchdb # 使⽤此条命令mv /usr/local/src/apache-couchdb-2.0.0/rel/couchdb /usr/local/
chown -R couchdb:couchdb /usr/local/couchdb
配置couchdb,特别重要
vim /usr/local/couchdb/etc/vm.args
-name 1.example #意思是 couchdb@ +hostname
#修改hosts
vim /etc/hosts 添加
0.0.0.0 localhost localhost.1.example
vim /etc/sysconfig/network
#添加,没发现有啥效果
localhost.localdomain
> 上⾯⼏步操作是修改hostname,⽅便识别,为后⾯配置couchdb集⽅便
# -kernel inet_dist_listen_min 9100
# -kernel inet_dist_listen_max 9200
> 上⾯两个参数暂时不⽤,配置集的时候在使⽤
# 修改couchdb启动时默认监听的ip,默认127.0.0.1,不能通过浏览器进⾏初始化设置,改为0.0.0.0
sed -i 's/127.0.0.1/0.0.0.0/g' /usr/local/couchdb/etc/default.ini
配置完成之后使⽤couchdb⽤户启动couchdb
cd /usr/local/couchdb
./bin/couchdb
启动成功之后访问出现这个画⾯代表启动成功
访问浏览器
172.17.0.84:5986/_utils/
安装过程中报错修复
ERROR: compile failed while processing /usr/local/src/apache-couchdb-2.0.0/src/couch: rebar_abort
解决报错:perl下载安装教程
cd /usr/local/src/apache-couchdb-2.0.0
egrep -r js-1.8.5 *
vim +106 src/fig.script
{"linux", CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ " -DXP_UNIX -I/usr/include/js"}, {"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]},
改为:
{"linux", CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ " -DXP_UNIX -I/usr/local/include/js"}, {"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]}, # 根本原因就是couchdb编译的时候到默认的js
# 还有种⽅式就是做软链接
ln -s /usr/local/include/js /usr/include/j # 这种⽅法尚未尝试,修改完成就可以继续编译啦
安装依赖缺失报错
[root@localhost apache-couchdb-2.0.0]# make release
Uncaught error in rebar_core: {'EXIT',
{undef,
[{crypto,start,[],[]},
{rebar,run_aux,2,
[{file,"l"},{line,212}]},
{rebar,main,1,
[{file,"l"},{line,58}]},
{escript,run,2,
[{file,"l"},{line,760}]},
{escript,start,1,
[{file,"l"},{line,277}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]}}
make: *** [couch] Error 1
报错是编译erlang前没安装openssl-devel,安装openssl-devel重新编译erlang,上边步骤再来⼀遍
安装完成
WARN: 'generate' command does not apply to directory /usr/local/src/apache-couchdb-2.0.0
... done
You can now copy the rel/couchdb directory anywhere on your system.
Start CouchDB with ./bin/couchdb from within that directory.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论