1 软件环境
使用的软件分别为:
VirtualBox 5.2
Oracle Linux 6.7
MongoDB 4.2.0
2 软件安装
2.1 创建用户和组
[root@strong ~]# groupadd mongod
[root@strong ~]# useradd -g mongod mongod
[root@strong ~]# passwd mongod
Changing password for user mongod.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
2.2 上传并解压MongoDB软件
[root@strong ~]# tar zxvf mongodb-linux-x86_64-rhel62-4.2.0.tgz
[root@strong ~]# mv mongodb-linux-x86_64-rhel62-4.2.0 mongodb
[root@strong ~]# mv mongodb /usr/local/
[root@strong ~]# cd /usr/local/
[root@strong local]# chown -R mongod.mongod mongodb/
2.3 创建数据目录
[root@strong ~]# mkdir -