Automatic installation of MongoDB shell script under Ubuntu 14.04

Source: Internet
Author: User

Vim mongodb_install.sh

#!/bin/bashcd /opt/echo  "Download mongdb software ..." wget https://fastdl.mongodb.org/ linux/mongodb-linux-x86_64-ubuntu1404-3.0.4.tgzecho  " mongdb software ..." tar -zxf  mongodb-linux*.tgzmkdir softwaremv mongodb-linux-*.tgz softwaremv mongodb-linux*  mongodbcd mongodb/echo  "Create log,data,conf dir and create mongodb.log  , mongod.conf "MKDIR LOG DATA CONFCD LOG/TOUCH MONGODB.LOG CD  cd confecho  "Port = 12345dbpath = datalogpath = log/mongod.logfork  = true    #在linux中fork为启动后台命令 " >> MONGOD.CONFCD  echo  "Create mongod.conf and transfer to /usr/bin" echo  "#!/bin/bashcd  /opt/mongodb/./bin/mongod -f conf/mongod.conf cd -  " >> MONGOD.SHMV  mongod.sh /usr/bin/chmod a+x /usr/bin/mongod.shecho  "MODIFY /ETC/BASH.BASHRC" echo  "alias mongod="/usr/bin/ Mongod.sh ' " >> /etc/bash.bashrcsource /etc/bash.bashrccd -

chmod a+x mongodb_install.sh

The root user is running this step./mongodb_install.sh

After the script runs, enter Mongod to start the MONGO service.


Start the client

Cd/opt/mongodb

[Email protected]:/opt/mongodb#./bin/mongo 127.0.0.1:12345/test


Accessing http://192.168.56.163:12345/in the browser

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/73/wKioL1WdCVOgg7SXAACdNU19Et4924.jpg "title=" Qq20150708191935.png "alt=" Wkiol1wdcvogg7sxaacdnu19et4924.jpg "/>

For manual Installation Please refer to: http://adelazhu.blog.51cto.com/9455045/1625360

This article from "Adela" blog, declined reprint!

Automatic installation of MongoDB shell script under Ubuntu 14.04

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.