MongoDB database maintenance operations: Connection amp; User Management amp; backup, mongodb DatabaseStart/Close the mongodb ServiceStart the serviceThe mongodb service can be started directly by specifying the startup paramete
configuration file is created in the directory. The configuration file creates an instance as follows:
# "#": Its annotation Function
Dbpath = E: \ DB \ mongodb \ data
Port = 27017
Fork = true
Logpath = mongdb. log
Logappend = true
// By default, logs are cleared from the previous logs. If you want to append logs, you can use logappend = true.
Start the process after Configuration:
6. Disable the service:
verification.-- Because the root user we just added is added to the admin database, the admin database and the super user of the whole site. We need to verify the login under admin.8->./mongo-uroot-p123456 localhost: 27017/admin -- that's all.Add a user to test (the same applies to other databases used for creation)* Note: The user added to the test can only have operation permissions on the test data, but cannot operate other databases. The super administrator in the admin canUse testDb. addUs
Mongodb database adding System Service tutorial, mongodb System Service 1. Create the mongod file in the/etc/init. d directory and grant the correct permissions:
root@ubuntu:/etc/init.d# touch mongodroot@ubuntu:/etc/init.d# chmod 755 mongod
2. Edit the mongod File
#!/bin/sh### BEGIN INIT INFO# Provides: mongod# Req
Tags: style http color ar using strong SP div on, you can refer to my workaround when you use the net START command when you add a service with the following code.D:\mongodb>mongod- -dbpath D:\mongodb\data --logpath d:\ Mongodb\log\mongodb. Log --logappend --serviceName
Tags: index XA requires action set x86 read and Write permissions God BPAinstallation :1 Download Linux installation package 2 on the official website in Linux decompression 3 will unzip the directory MV to the specified installation directoryMV mongodb-linux-x86_64-rhel70-3.6. 5//usr/local/mongodb4 CD to the bin directory, execute the following command to add the environment variable:Export path= $PATH:/usr/local/
(table) to other servers for distributed storage. This reduces the amount of data in a single table and balances the load of write operations.
Status Monitoring
HTTP Console
Mongo shell diagnostic commands
Backup and Replication
Backup/restore
Master-slave
Replica sets
Automatic sharding
Auto sharding
1. Status Monitoring
First, create data, data
MongoDB concept understanding, MongoDB shell connection to Mongodb service, mongodbshellMongoDB concept understanding
MongoDB shell connection to Mongodb Service
Standard URI connectio
Label:MongoDB database maintenance is inseparable from the necessary backup, recovery operations, and generally does not go wrong, so we use the most of the time using backup and recovery operations.
The principle of mongodump.exe backup is to get the current server snapshot through a single query and write the snapshot to disk, so this method is not saved in re
Tags: http io os using SP data on CTI ADMongoDB data dumpTo create a backup database in MongoDB, you should use the Mongodump command. This command dumps all data from the server to the dump directory. There are many options available through which you can limit the amount of data or create a backup of your remote server.Grammar:The basic syntax for the Mongodump
collection must know the addresses of all other nodes, but when a container is rearranged, its IP address changes. For example, all containers within a kubernetes share an IP address that changes after the pod is rearranged. In kubernetes, this problem can be resolved by contacting the Kubernetes service with the MongoDB node, which uses the Kubernetes DNS service
A brief introduction: Today happened to write a backup script about MongoDB, share the nextTwo-Frontier: This script applies to single-instance and replica sets, not for Shard clustersThree contents:#!/bin/shUser=password=port=ip= '/sbin/ifconfig eth0 | grep ' inet addr ' | Cut-d:-f2 | awk ' {print '} ' | Cut-d '. '-f ' 3,4 'date1= ' Date +%y%m%d%h 'date2= ' Date +%y%m 'Backupdir1= "/
As a result of the recent learning Nodejs, when used to the database, the feeling MongoDB and Nodejs very well, all installation MongoDB try, by the way, more than the pressure on the body. about how to install MongoDB, I saw a lot of blog on the Internet have introduced, I have skipped here. OK, get to the point.
To add a Mo
Mongodump--dbpath/data/db/--out/data/backup/
Mongodump--collection Collection--db db_name
The command backs up a collection of the specified databases.
Mongodump--collection mycol--db test
Note:1. Before the backup, the Mongod service process is started2. If it is initiated with the authentication--auth, the account
database file to E:\Work _app\mongodb\data\db directory Note: 1, note is Mongod.exe 2, this time the interface will stop at 2015-03-26t15:19:17.135+0800i network[initandlisten]waitingforconnectionsonport27017 (the database is now started)
4First knowledge of MongoDB:New Open [ Note is new ] after a cmd window, then run the Mongo.exe program (note that there is no d), at this time the previous window is displayed: 2015-03-26t15:31:10.14
Install mongoDB in windows (decompress version) to close the service tutorial. Decompress mongodb
I am going to put the database on disk D, so I created a mongoDB folder under disk D, and created the mongoDB folder and mongoDBdata folder respectively under it, which are use
Tags: mongodbMongoDB Data BackupIn MongoDB we use the Mongodump command to back up MongoDB data. The command can export all data to the specified directory. The Mongodump command allows you to specify the server to which the exported data can be dumped by parameter.GrammarThe mongodump command script syntax is as follows: >---o dbdirectory
- H:MONGDB the server address, for example: 127.0.0.1, yo
MongoDB backup and recovery (mongorerstore)MongoDB Data Backup
In Mongodb, we use the mongodump command to back up MongoDB data. This command can export all data to a specified directory.
The mongodump command can be used to speci
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.