先上安裝腳本先。
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的相關(guān)軟件。
mongo:客戶端
mongod:服務(wù)端
mongos:集群相關(guān)
我們增加mongodb的配置,命名為mongo.conf,內(nèi)容如下:
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: {數(shù)據(jù)儲存路徑} 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: |
服務(wù)啟動
/web/mongodb/bin/mongod –fork –config=剛才的配置文件全路徑