标签:logging 连接 release 后台运行 replica 文件内容 指定 list oca
记录一下,MongoDB的角色创建及配置,以便以后使用
环境信息:
Linux:CentOS release 6.5 (Final) MongoDB:3.2.7 MongoDB下载地址: http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel62-3.2.7.tgz
tar -zxvf mongodb-linux-x86_64-enterprise-rhel62-3.2.7.tgz
mv mongodb-linux-x86_64-enterprise-rhel62-3.2.7 /home/dd/mongodb/
新建MongoDB数据文件存放目录
mkdir -p /home/dd/mongodb/db
新建log文件存放目录
mkdir -p /home/dd/mongodb/logs
MongoDB支持把参数写进配置文件,mongod.conf配置文件内容如下
# mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # where to write logging data. systemLog: destination: file logAppend: true path: /home/dd/mongodb/logs/mongod.log #日志文件存放目录 # Where and how to store data. storage: dbPath: /home/dd/mongodb/db #数据文件存放目录 journal: enabled: true # engine: # mmapv1: # wiredTiger: # how the process runs processManagement: fork: true #以守护程序的方式启用,即在后台运行 pidFilePath: /home/dd/mongodb/mongod.pid # location of pidfile # network interfaces net: port: 27017 #端口 bindIp: 0.0.0.0 # Listen to local interface only, comment to listen on all interfaces. #security: #authorization: enabled #operationProfiling: #replication: #sharding: ## Enterprise-Only Options #auditLog: #snmp:
vi /etc/rc.d/rc.local /home/dd/mongodb/mongodb-linux-x86_64-enterprise-rhel62-3.2.7/bin/mongod --config /home/dd/mongodb/mongodb-linux-x86_64-enterprise-rhel62-3.2.7/bin/mongod.conf
1、通过xshell连接对应linux服务器,到MongoDB安装的bin目录运行./mongo命令
2、telnet ip 27017
标签:logging 连接 release 后台运行 replica 文件内容 指定 list oca
原文地址:http://www.cnblogs.com/out-of-memory/p/6810349.html