標籤:centos 安裝 mongodb
系統:centos7.2
說明所有源碼放在
1、準備mongoDB C/C++驅動依賴
yum -y install epel-release
yum install -y git gcc gcc-c++ openssl openssl-devel make texinfo patch imake wget perl-Test-Harness perl-Thread-Queue perl-Data-Dumper help2man cyrus-sasl-devel glib-devel gettext gettext-devel gnulib-devel
2、安裝cmake3.2以上版本如果有舊請卸載
yum remove cmakewget https://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz tar -xvf cmake-3.2.2.tar.gz cd cmake-3.2.2 ./bootstrap ./configure make && make install ln -s /usr/local/bin/cmake /usr/bin cd ..
3、安裝autoconf-2.69
wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.gztar -xvf autoconf-2.69.tar.gzcd autoconf-2.69./configure --prefix=/usr/localmake && make installcd ..
4、安裝automake-1.15.1
wget http://ftp.gnu.org/gnu/automake/automake-1.15.1.tar.xztar -xvf automake-1.15.1.tar.xzcd automake-1.15.1./bootstrap --force./configure --prefix=/usr/localmake && make installln -sf /usr/local/bin/automake-1.15 /usr/bin/automakecd ..
5、安裝libtool-2.4.6
wget http://mirrors.ustc.edu.cn/gnu/libtool/libtool-2.4.6.tar.gz tar -xvf libtool-2.4.6.tar.gz cd libtool-2.4.6 ./bootstrap --force ./configure make && make install cd ..
6、安裝libbson-1.6.3
wget https://github.com/mongodb/libbson/releases/download/1.6.3/libbson-1.6.3.tar.gz tar -xvf libbson-1.6.3.tar.gz cd libbson-1.6.3 ./configure -prefix=/usr --libdir=/usr/lib64 make && make install cd ..
7、安裝m4-1.4.18
wget http://mirrors.kernel.org/gnu/m4/m4-1.4.18.tar.gztar -xvf m4-1.4.18.tar.gz cd m4-1.4.18./bootstrap --force./configure --prefix=/usr/localmake && make installln -sf /usr/local/bin/m4 /usr/bin/m4cd ..
8、安裝mongo-c-driver-1.6.3
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.6.3/mongo-c-driver-1.6.3.tar.gztar -xvf mongo-c-driver-1.6.3.tar.gzcd mongo-c-driver-1.6.3./configuremake && make install cd ..
9、安裝mongo-cxx-driver-r3.1.2
wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.1.2.tar.gz tar -xvf r3.1.2.tar.gz cd mongo-cxx-driver-r3.1.2/build/ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local .. sudo make EP_mnmlstc_core sudo make && sudo make install ln -s /usr/local/lib/libmongocxx.so /usr/lib/libmongocxx.so
本文出自 “小葉寒笑” 部落格,請務必保留此出處http://juestnow.blog.51cto.com/1515305/1950039
centos7.2 安裝mongoDB C/C++驅動