|
|
|
@ -12,8 +12,8 @@ serverPath=$(dirname "$rootPath") |
|
|
|
|
|
|
|
|
|
install_tmp=${rootPath}/tmp/mw_install.pl |
|
|
|
|
VERSION=$2 |
|
|
|
|
sysName=`uname` |
|
|
|
|
|
|
|
|
|
sysName=`uname` |
|
|
|
|
echo "use system: ${sysName}" |
|
|
|
|
|
|
|
|
|
if [ ${sysName} == "Darwin" ]; then |
|
|
|
@ -47,18 +47,14 @@ Install_app_mac() |
|
|
|
|
|
|
|
|
|
# https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-5.0.4-1.el7.x86_64.rpm |
|
|
|
|
Install_app_linux(){ |
|
|
|
|
if [ ! -f $serverPath/source/mongodb-src-r${VERSION}.tar.gz ];then |
|
|
|
|
wget -O $serverPath/source/mongodb-src-r${VERSION}.tar.gz https://fastdl.mongodb.org/src/mongodb-src-r${VERSION}.tar.gz |
|
|
|
|
if [ ! -f $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm ];then |
|
|
|
|
wget -O $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
cd $serverPath/source && tar -zxvf mongodb-src-r${VERSION}.tar.gz |
|
|
|
|
cd $serverPath/source/mongodb-src-r${VERSION} |
|
|
|
|
cd build && ./configure --prefix=$serverPath/mongodb && make -j4 && make install |
|
|
|
|
|
|
|
|
|
rpm -ivh $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Install_app() |
|
|
|
|
{ |
|
|
|
|
pip3 install pymongo |
|
|
|
@ -68,8 +64,10 @@ Install_app() |
|
|
|
|
mkdir -p $serverPath/source |
|
|
|
|
mkdir -p $serverPath/mongodb |
|
|
|
|
# echo $sysName |
|
|
|
|
if [ "macos" == "$OSNAME" ]; then |
|
|
|
|
if [ "macos" == "$OSNAME" ];then |
|
|
|
|
Install_app_mac |
|
|
|
|
if [ "ubuntu" == "$OSNAME" ] || [ "ubuntu" == "$OSNAME" ] ;then |
|
|
|
|
apt install -y mongodb |
|
|
|
|
else |
|
|
|
|
Install_app_linux |
|
|
|
|
fi |
|
|
|
|