Mongodb Linux under Installation

Source: Internet
Author: User

: Https://www.mongodb.org/downloads

Upload to server and unzip:

$ tar zxf mongodb-linux-i686-2.0.2.tgz

Create the necessary documents at the installation:

$ cd mongodb$ mkdir data$ Touch logs

Start:

./mongod--dbpath=/usr/local/mongodb/data--fork--logpath=/usr/local/mongodb/logs

Configuration Description:

A detailed description of MongoDB configuration parameters:

#对mongo实例来说, each host allows links to the maximum number of links, which are placed in the pool when they are idle, and if the link is exhausted, any action that requests a link is blocked waiting for the link to be available, recommended configuration 10

connectionsperhost=10

#当链接空闲时, maximum number of links in the free thread pool

Minpoolssize=5

#此参数跟connectionsPerHost的乘机为一个线程变为可用的最大阻塞数, all threads that exceed this number of flights will get an exception in time. eg.connectionsperhost=10 and Threadsallowedtoblockforconnectionmultiplier=5, up to 50 thread levels a link, recommended configuration of 5

Threadsallowedtoblockforconnectionmultiplier=5

#一个线程等待链接可用的最大等待毫秒数, 0 means no wait, negative number indicates an indeterminate wait time, recommended configuration 120000

maxwaittime=120000

#链接超时的毫秒数, 0 means no time-out, this parameter is used only when creating a new link, it is recommended to configure 10,000.

connecttimeout=10000

#此参数表示socket I/O read-write timeout, recommended to not time out, i.e. 0 socket.setsotimeout (int)

Sockettimeout=0

#该标志用于控制socket保持活动的功能, stay connected through a firewall alive

Socketkeepalive=false

#true: If the link can not be established, the driver will retry the same server, there is the maximum number of retries, the default is 15, this can avoid some server because some blocking operation 0 o'clock down and the drive throws an exception, this to the smooth over to a new master, is also very useful, Note: When the cluster is a replica set, the driver will attempt to link to the old master during this time, instead of immediately linking to the new master

#false when the socket reads and writes, does not prevent the exception throws, the driver already has the automatic reconstruction destroys the link and the heavy probation operation. Recommended Configuration False

Autoconnectretry=false

#重新打开链接到相同server的最大毫秒数, the recommended configuration is 0, if autoconnectretry=true, represents a time of 15s

#com. Jd.mongodbclient2.mongo.jdclientmongo.maxautoconnectretrytime=false

#表示当没有手动关闭游标时, is there a way to automatically release the cursor object, and if you are always careful to close the cursor, you can set it to false recommended configuration true

#com. jd.mongodbclient2.mongo.jdclientmongo.cursorfinalizerenabled=true

#安全模式

Com.jd.mongodbclient2.driver.mongodbdriver.safe=true

#为true表示读写分离

Com.jd.mongodbclient2.driver.mongodbdriver.slaveok=false


Mongodb Linux under 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.