先上安装脚本先。
|
1 2 3 |
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.4.1.tgz tar -zxf mongodb-linux-x86_64-rhel70-4.4.1.tgz mv mongodb-linux-x86_64-rhel70-4.4.1/ /web/mongodb/ |
我们来看下mongodb的相关软件。
mongo:客户端
mongod:服务端
mongos:集群相关
我们增加mongodb的配置,命名为mongo.conf,内容如下:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: {数据储存路径} journal: enabled: true # directoryPerDB: true # engine:wiredTiger # mmapv1: wiredTiger: engineConfig: cacheSizeGB: 4 # where to write logging data. systemLog: destination: file logAppend: true path: {日志存储路径} # network interfaces net: port: {对外工作端口} bindIp: {对外绑定的地址,一般默认:127.0.0.1 提供安全性} #processManagement: #security: #operationProfiling: #replication: #sharding: ## Enterprise-Only Options: #auditLog: #snmp: |
服务启动
/web/mongodb/bin/mongod –fork –config=刚才的配置文件全路径