Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basic configuration of Mongdb startup

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you to Mongdb startup basic configuration is how, the content is very detailed, interested friends can refer to, hope to help you.

1. Parameter explanation: --dbpath database path (data file)

--logpath Log file path

--master designated as master

--slave specified as slave machine

--source Specifies the IP address of the host

--pologSize specifies that the log file size does not exceed 64M. Because resync is very laborious and time-consuming, it is best to avoid resync by setting a sufficiently large oplog Size (the default oplog size is 5% of the free disk size).

--logappend Add to end of log file

--port Enable port number

--fork runs in the background

--only Specifies which database to copy only

--slavedelay refers to the time interval from replication detection

--auth Does authentication permission need to be logged in (username and password)

-h [ --help ] show this usage information

--version show version information

-f [ --config ] arg configuration file specifying additional options

--port arg specify port number

--bind_ip arg local ip address to bind listener - all local ips

bound by default

-v [ --verbose ] be more verbose (include multiple times for more

verbosity e.g. -vvvvv)

--dbpath arg (=/data/db/) directory for datafiles

--quiet quiet output

--logpath arg file to send all output to instead of stdout

--logappend appnd to logpath instead of over-writing Specifies whether logs are written to the log file as appends or overwrites

--fork fork server process runs as a child process

--cpu periodically show cpu and iowait utilization

--noauth run without security

--auth run with security

--objcheck inspect client data for validity on receiptCheck validity of client input data

--quota enable db quota management Start database quota management

--quotaFiles arg number of files allow per db, requires --quota Specifies the number of files allowed per database

--appsrvpath arg root directory for the babble app server

--alarms diagnostic/debugging option

--nohints ignore query hints Ignore query hits

--nohttpinterface disable http interface Close http interface, default is 28017

--noscribing disable scripting engine shutdown scripting engine

--noprealloc disable data file preallocation Turn off database file size preallocation

--smallfiles use a smaller default file size

--nssize arg (=16) .ns file size (in MB) for new databases Default size of ns files for new databases

--diaglog arg 0=off 1=W 2=R 3=both 7=W+some reads The mode provided is read-only, write-only, both read-write, or mainly write-+ partial read mode.

--sysinfo print some diagnostic system information Print system diagnostic information

--upgrade db if needed Update database if needed

--repair run repair on all dbs

--notablescan do not allow table scans

--syncdelay arg (=60) seconds between disk syncs (0 for never) The time it takes for the system to synchronously refresh the disk, the default is 60s

Replication options:

--master mode master copy mode

--slave slave mode

--source arg when slave: specify master as When slave, specify master address and port

--only arg when slave: specify a single database to replicate When slave, specify a single database to replicate from master

--pairwith arg address of server to pair with

--arbiter arg address of arbiter server, used in host and pair

--autosync automatically resync if slave data is stale autosync de datos de la

--oplogSize arg size limit (in MB) for op log Specifies the size of the operation log

--opIdMem arg size limit (in bytes) for in memory storage of op ids Specifies the size of memory to store operation logs

Sharding options:

--configsvr declare this is a config db of a cluster Specify the configuration server in the shard

--shardsvr declare this is a shade db of a cluster Specify shade server

2. Enter CLI administration interface of database

cd to bin folder under mongodb directory, execute command./ mongo

Run as follows:

[root@namenode mongodb]# ./ bin/mongo

MongoDB shell version: 1.8.2

connecting to: test

> use test;

switched to db test

If the database appears such as can not be connected, it is a data directory under the mongod.lock file problem, you can use the following repair command,

mongod --repair

About Mongdb startup basic configuration is how to share here, I hope the above content can have some help for everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report