MongoDB installation (Centos 6.4 32-bit)

Source: Internet
Author: User
Tags iptables mongochef

Installing a 32-bit mongodb on a 32-bit centos, which is more troublesome than installing a 64-bit MongoDB on a 64-bit CentOS, now logs the installation process as follows:

My 32-bit Centos6.4 is newly built. The steps for installing MongoDB are as follows:

1, upload 32-bit mongodb-linux-i686-3.2.3.gz installation package, use the RZ command to upload, reported the following information:

[Email protected] yum.repos.d]# yum-y install Lrzsz

Loaded Plugins:fastestmirror, Refresh-packagekit

Workaround:

Step 1,

Vi/etc/yum/pluginconf.d/fastestmirror.conf
[Main]
Enabled=0//change 1 to 0
Verbose=0
Socket_timeout=3
Hostfilepath=/var/cache/yum/timedhosts.txt
maxhostfileage=10
Maxthreads=15
#exclude =.gov, Facebook

Step 2,

#vi/etc/yum.conf

[Main]
cachedir=/var/cache/yum/$basearch/$releasever
Keepcache=0
debuglevel=2
Logfile=/var/log/yum.log
Exactarch=1
Obsoletes=1
Gpgcheck=1
Plugins=1 #将plugins的值修改为0
Installonly_limit=5

After modifying the configuration:

Yum–y Install Lrzsz

RZ Upload MongoDB file

2, create a MongoDB folder in the/usr/local directory, and then extract the MongoDB installation package into the MongoDB file

3. In the MongoDB directory created in the second step:

Create a folder in which data and log files are stored logs
Cd/usr/local/mongodb
mkdir data
Touch logs

4. Start MongoDB

/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/logs--logappend-- port=27017--fork

Some errors occurred during the installation process, as follows:

When the first step is completed, follow the 4th step to start the MongoDB operation, prompting for the error as shown:

The first reaction is that the user does not have permission to view the current user information:

No exception was found, the response is not the file does not execute the permissions:

To view 64-bit or 32-bit:

Getconf Long_bit

This means that the number of mongodb bits and the number of system bits downloaded is incorrect

To download the 32-bit MongoDB, repeat steps 1 through 4 again, when you proceed to step 4th, the error appears as shown:

Adjust the start command as follows:

Adjust the start command again, as follows:

/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--journal--storageengine=mmapv1--logpath=/usr/ Local/mongodb/logs--logappend--port=27017--fork

Common Startup parameters:
--dbpath means to specify the folder where the data is stored
--logpath means to specify the log storage file
--logappend means that logs are generated in an incremental manner.
--PORT Specifies the port, if not written, the default is 27017
--fork to run on behalf of the background

To view the process of MongoDB in the system:

Execute the MONGO executable file in the/usr/local/mongodb/bin directory, such as:

At this point, the MongoDB installation started successfully.

5. Using Mongochef to connect to MongoDB on the virtual machine, the following error occurred:

27017-Port connectivity is not a solution when connecting to MongoDB remotely

1, the BIND_IP in the configuration file of MongoDB default is 127.0.0.1, the default is only native can connect.

At this point, you need to configure BIND_IP to 0.0.0.0, which is the key to accepting any IP connections.

2, the firewall blocked 27017 ports.

This step depends on the operating system to determine how to operate, I am using CentOS 6.4:

To turn off the virtual machine firewall:
Shutdown command: Service iptables stop
Permanently shut down the firewall: chkconfig iptables off
Two commands run at the same time, after the run is complete, view the firewall status
Service Iptables Status

Try using Mongochef to connect to MongoDB on the virtual machine again:

6. Configure the MongoDB startup script in the/bin directory

#!/bin/bash
Pid= ' ps-ef|grep/usr/local/mongodb/bin/mongod|grep-v ' grep | awk ' {print $} '
if [$pid]
Then
echo "MongoDB is running ..."
Else
/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--journal--storageengine=mmapv1--logpath=/usr/ Local/mongodb/logs--logappend--port=27017--fork
Echo ' MongoDB started! '
Fi

Reference Documentation:

Http://blog.sina.com.cn/s/blog_7e513d7e01015j9b.html

Http://coderschool.cn/1709.html

MongoDB installation (Centos 6.4 32-bit)

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.