Linux under MongoDB installation

Source: Internet
Author: User
Tags create directory

1> Set MongoDB Catalogue

?

Cd/home/apps attached: CentOS under Create directory command Mkdir/home/apps

?

2> Download MongoDB

?

Curl-o http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.3.tgz

?

3> Unzip the file

?

Tar xzf mongodb-linux-x86_64-1.6.3.tgz

?

4> Start the service

?

./mongodb-linux-x86_64-1.6.3/bin/mongod-dbpath=/data/mongodb/db-logpath=/data/mongodb/log

?

5> will be MongoDB service join random start

?

Vi/etc/rc.local

?

Use VI The editor opens the configuration file and adds the following line of code to it

?

/home/apps/mongodb/bin/mongod--dbpath/data/mongodb/db--port 27017--logpath/data/mongodb/log--logappend

?

6> Connection MongoDB

?

./mongodb-linux-x86_64-1.6.3/bin/mongo DBName

?

?

?

here, MongoDB in the Linux Next installation is complete, local Area Connection MongoDB has also been successful, we will have to consider another problem, how the LAN to connect MongoDB it? How do Windows machines in a local area network connect to MongoDB in a Linux machine ?

?

The practice is as simple as that: ./mongodb-linux-x86_64-1.6.3/bin/mongo 192.168.10.234/dbname can be.

?

But here we need to be aware that we need to CentOS on Open MongoDB the port number, next talk about how to CentOS Open the specified port on the

?

We open the configuration file /etc/sysconfig/iptables , add the following to the file:

?

-A rh-firewall-l-input-p tcp-m TCP--dport MongoDB Port number -j ACCEPT

?

Then restart the service

?

Service Iptables Restart

?

?

?

at this point, you can begin to access it over the LAN CentOS on the deployed MongoDB

?

?

?

By the way, add a little bit more CentOS with the Windows Exchange of knowledge, for example, we want to put the original in Windows on the machine. MongoDB The resulting files are ported to CentOS , of course, it can be copied with a mobile storage device, but I'm talking about Linux ( CentOS ) How to access Windows share the directory with the following command:

?

mount-t cifs//ip/ shared directory name /mnt/sharefile-o username=,password=

?

The above command is about to Windows the shared directory is mapped to Linux on the /mnt/sharefile Catalogue

Linux under MongoDB installation

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.