鲲鹏服务器源码安装mongodb4.2.3 -- 第一次在arm服务器安装软件
1.Gcc和依赖软件下载
https://gcc.gnu.org/pub/gcc/infrastructure/
gmp-6.1.0.tar.bz2
mpfr-3.1.4.tar.gz
mpc-1.0.3.tar.gz
isl-0.18.tar.bz2
https://gcc.gnu.org/pub/gcc/releases/gcc-9.2.0/
gcc-9.2.0.tar.gz
2.下载mongodb源码包
1、2的软件包上传到/opt目录下
3.安装gcc和依赖
1)检查gcc版本
gcc -version
2)安装依赖
yum install -y bzip2
3)上传gcc-9.2.0.tar.gz到/opt目录解压,将依赖包放入解压出来的gcc目录
cd /opt
tar xf gcc-9.2.0.tar.gz
cp isl-0.18.tar.bz2 mpc-1.0.3.tar.gz gmp-6.1.0.tar.bz2 mpfr-3.1.4.tar.bz2 gcc-9.2.0
cd gcc-9.2.0
./contrib/download_prerequisites
ps:出现上图结果即可开始编译安装
4)执行编译安装
mkdir gcc-build-9.2.0
cd gcc-build-9.2.0
../configure --enable-checking=release --enable-language=c,c++ --disable-multilib --prefix=/usr
make -j`cat /proc/cpuinfo| grep "processor"| wc -l` //8核大概需要40分钟
make install
5)查看gcc版本
gcc -version
4.安装系统依赖包
yum install libcurl-devel libyaml libyaml-devel python-setuptools zlib-devel libffi-devel openssl openssl-devel
5.安装python
1)升级Python至3.7版本。
Python3.7安装需要花费较长时间,请耐心等待。
yum install wget -y
yum install -y zlib* openssl*
cd /usr/local/src
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar -zxvf Python-3.7.0.tgz
cd Python-3.7.0
mkdir /usr/local/python37
./configure --prefix=/usr/local/python37 --enable-optimizations
make -j8 && make install
ps:如果出现上面的错误,再装一下依赖
yum install libffi-devel -y
2)设置Python3.7环境变量。
cp /usr/local/python37/bin/python3.7 /usr/bin
mv /usr/bin/python3.7 /usr/bin/python3
mkdir /usr/local/lib/python3.7
cp /usr/local/python37/lib/* /usr/local/lib/python3.7/ -rf
ldconfig
3)升级setuptools。
cd /usr/local/src/
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
python3 setup.py build
python3 setup.py install
4)安装python模块
/usr/local/python37/bin/pip3 install psutil pyyaml cheetah3
6.安装mongodb
useradd -d /home/mongodb -m mongodb
将/opt 安装包复制到/home/mongodb
cp /opt/mongodb-src-r4.2.3.tar.gz /home/mongodb/
su - mongodb
tar xf mongodb-src-r4.2.3.tar.gz
cd mongodb-src-r4.2.3
mkdir mongodb
cd mongodb
//指定安装路径--prefix=/home/mongodb/mongodb
python3 buildscripts/scons.py --prefix=/home/mongodb/mongodb install MONGO_VERSION=4.2.3 core CFLAGS="-march=armv8-a+crc -mtune=generic" -j8 --disable-warnings-as-errors
//8C核大概40分钟
//删除调试信息,最后也可以将/home/mongodb/mongodb-src-r4.2.3 目录删除
cd /home/mongodb/mongodb/bin/
strip mongos
strip mongod
strip mongo
7.测试
cd /home/mongodb/mongodb/
mkdir -p data/db
nohup /home/mongodb/mongodb/bin/mongod --dbpath /home/mongodb/mongodb/data/db &
/home/mongodb/mongodb/bin/mongo
show db
参考文章:
https://www.huaweicloud.com/kunpeng/software/mongodb.html
https://bbs.huaweicloud.com/forum/thread-40903-1-1.html
https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
https://www.huaweicloud.com/kunpeng/software/faust.html
第一次在arm服务器安装软件,如果有什么错误请指正,谢谢各位大佬
- 点赞
- 收藏
- 关注作者
评论(0)