下载包
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-4.4.6.tgz
tar -zxvf mongodb-linux-x86_64-rhel80-4.4.6.tgz
mv mongodb-linux-x86_64-rhel80-4.4.6.tgz /usr/local/mongodb
创建目录
cd /usr/local/mongodb
mkdir data
mkdir log
配置环境变量/etc/profile:
export MONGODB_HOME=/usr/local/mongodb
export PATH=$PATH:$MONGODB_HOME/bin
配置文件
cd bin
nano mongodb.conf
##编写以下内容:
systemLog:
destination: file
logAppend: true
path: /usr/local/mongodb/logs/mongodb.log
net:
port: 27017
bindIp: 0.0.0.0
maxIncomingConnections: 10000
storage:
dbPath: /usr/local/mongodb/data/db
journal:
enabled: true
wiredTiger:
engineConfig:
cacheSizeGB: 1
systemLog:
destination: file
logAppend: true
path: /usr/local/mongodb/logs/mongodb.log
processManagement:
fork: true
security:
authorization: enabled
net:
port: 27017
bindIp: 0.0.0.0
maxIncomingConnections: 10000
启动停止:
./mongod -f ./mongo.conf
sudo ./mongod -f ./mongodb.conf --shutdown
其他工具,如导入导出
https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel70-x86_64-100.3.1.tgz
#解压,把bin里面的全部放到mongodb/bin下边即可使用
网友评论