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