MongoDB Auto-Install shell

Source: Internet
Author: User



Installing Mogodb Script 1.0001



#!/bin/bash

Useradd mongod-s/sbin/nologin-m


Tarfile= ' Ls-l. |grep Mongodb-linux|awk ' {print $9} '


TAR-ZXVF $tarfile | | Exit 1

MV $tarfile Bakmog

MV Mongodb* MongoDB



#将文件拷贝到目的安装路径
mv./mongodb/usr/share/
MV Bakmog $tarfile


Mkdir-p/usr/share/mongodb/log
Mkdir-p/usr/share/mongodb/data
Mkdir-p/usr/share/mongodb/run

Cat >/usr/share/mongodb/mongod.conf<</

Logpath=/usr/share/mongodb/log/mongod.log
Logappend=true
Fork=true
dbpath=/usr/share/mongodb/data/
Journal=true
Directoryperdb = True
Auth = True
#replSet = Rs_test
#keyFile =/etc/mongo_main.key

/

Chown-r Mongodb:mongodb/usr/share/mongodb




MongoDB Auto-Install shell

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.