Vernacular MongoDB (2)

Source: Internet
Author: User
Tags expression engine

Source Address http://www.ningoo.net/html/2011/mongodb_in_a_nutshell_2.html by ningoo

I have talked about a bunch of things before. The best way is to let him run it, and then verify its implementation with the help of documents and tests, and understand its shortcomings and advantages.

MongoDB provides compilation versions for some systems. However, we recommend that you useSource codeCompilation and installation method. MongoDB SourceCodeIt depends on some basic components, such as JS engine spider monkey, Regular Expression Engine PCRE, installation and construction tool scons, and C ++ boost libraries. Therefore, compilation is still troublesome, this article of realzyy has explained in detail the compilation steps, mainly based on the RedHat system. To install it on Ubuntu, pay attention to the following points:

1. PCRE it is best to explicitly specify support for UTF-8 at compilation

 
$ Configure -- enable-Unicode-properties $ sudo make-J 2 & make install

If PCRE does not support UTF-8, MongoDB cannot start

Thu Mar 31 17:27:16 assertion: 10342: PCRE not compiled with utf8 supp0x0x8169528 0x81e704e 0x8450212 0xb73b6ce7 0x80f5b11. /d (_ zn511611msgassertedeipkc + 0x208) [0x8169528]. /mongod (_ zn5rj6rxtest3runev + 0x3fe) [0x81e704e]. /mongod (main + 0x3832) [0x8450212]/lib/libc. so.6 (_ libc_start_main + 0xe7) [0xb73b6ce7]. /mongod () [0x80f5b11]

2. Ubuntu comes with a spider monkey, but the version is somewhat old. Some features required by MongoDB are not supported and need to be uninstalled first.

 
$ Dpkg-L | grep xulrunner $ sudo apt-Get remove xulrunner-1.9.2-dev xulrunner-1.9.2 $ export cflags = "-djs_c_strings_are_utf8" $ sudo make-F makefile. ref $ sudo js_dist =/usr make-F makefile. ref Export

3. Support for libraries such as boost must be installed.

$ Sudo apt-get-y install tcsh Git-core scons g ++ $ sudo apt-get-y install libpcre ++-dev libboost-dev libreadline-dev xulrunner-dev $ sudo apt-get-y install libboost-Program-options-dev \ libboost-thread-dev libboost-filesystem-dev libboost-date-time-Dev

4. We recommend that you download the source code from GitHub and compile the corresponding version as needed.

 
$ Git clone git: // github.com/mongodb/mongo.gitmongocd Mongo $ git tag-L $ git checkout r1.8.0

5. At last, it is recommended that the header file be associated with the library file when compiling and installing MongoDB.

 
$ Scons-J 2 all $ scons -- prefix =/opt/Mongo -- Full Install

In addition, MongoDB can also use Google V8 as the JS engine. In terms of performance, V8 may be a better choice. From the perspective of Jira, MongoDB may switch to V8 as the default engine in the future.

Compile V8 first, and then use the userv8 parameter when compiling MongoDB:

$ SVN checkout http://v8.googlecode.com/svn/trunk/ V8 $ CD V8 $ scons $ sudo CP libv8.a/usr/lib $ sudo CP libv8preparser. a/usr/lib $ sudo CP-r include/*/usr/include/$ CD MongoDB-Src $ scons all -- usev8 $ scons -- prefix =/opt/Mongo -- Full Install

MongoDB has many limitations in a 32-bit environment and can only be used for learning and research purposes. A 64-bit system must be used in an online environment.

 
Thu Mar 31 17:24:58 -- oplogsize of 1024 MB is too big for 32 bit version. Use 64 bit build instead.

Refer:

Http://www.mongodb.org/display/DOCS/Building+Spider+Monkey
Http://www.mongodb.org/display/DOCS/Building+for+Linux
Http://www.howsthe.com/blog/2010/feb/22/mongodb-and-v8/
Http://jira.mongodb.org/browse/SERVER-446

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.