- 安装地址
https://www.mongodb.com/try/download/community - 上传安装包
上传到安装目录,用上传软件
解压到当前目录下
tar -zxvf /home/mongodb-linux-x86_64-rhel70-4.4.18.tgz -C
mkdir data log conf
- 在mongodb的conf目录下创建并编辑mongo.conf文件
systemLog:
destination: file
path: /usr/local/mongodb/log/mongod.log # log path
logAppend: true
storage:
dbPath: /usr/local/mongodb/data # data directory
engine: wiredTiger #存储引擎
journal: #是否启用journal日志
enabled: true
net:
bindIp: 0.0.0.0
port: 28018 # port
processManagement:
fork: true
vim /etc/profile
export PATH=$PATH:/usr/local/mongodb/bin
source /etc/profile
mongod -f /usr/local/mongodb/conf/mongo.conf
ps -ef | grep mongo
kill -9 进程号