e = true #source = master.example.com # Slave only: specify a single database to replicate #only = master.example.com # or #master = true #source = slave.example.com ? # Address of a server to pair with. #pairwith = # Address of arbiter server. #arbiter = # Automatically resync if slave data is stale #autoresync # Custom size for replication operation log. #oplogSize = # Size limit for in-memory storage of op ids. #opIdMem =
配置好后第一次启动后会生成相应的数据文件
[root@localhost mongodb]# /etc/init.d/mongod start 正在启动 mongod:[确定] [root@localhost mongodb]# mongo#Mongodb客户端启动 MongoDB shell version v3.4.2 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.4.2 Server has startup warnings:? 2017-02-15T10:42:11.888+0800 I STORAGE? [initandlisten]? 2017-02-15T10:42:11.888+0800 I STORAGE? [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2017-02-15T10:42:11.888+0800 I STORAGE? [initandlisten] **? ? ? ? ? See http://dochub.mongodb.org/core/prodnotes-filesystem 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten]? 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] **? ? ? ? ? Read and write access to data and configuration is unrestricted. 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten]? 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten]? 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] **? ? ? ? We suggest setting it to 'never' 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten]? 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten] **? ? ? ? We suggest setting it to 'never' 2017-02-15T10:42:12.850+0800 I CONTROL? [initandlisten]? > show dbsshow dbs admin? 0.000GB local? 0.000GB #有2个默认库
如此Mongodb的初步介绍使用结束。
更多MongoDB相关教程见以下内容:
|