【本节作业】
- MongoDB安装和简易部署。
作业提交方式:将安装部署好的界面截图发在【小打卡-小程序】里边进行打卡。
【MongoDB简易安装部署——操作演示】
【Chpater 0:环境准备——讲义分享】(点击标题可下载)
操作相关材料及链接:
下载MongoDB软件:
社区版:https://www.mongodb.com/try/download/community
企业版:https://www.mongodb.com/try/download/enterprise部署Linux版MongoDB-安装部署:
-- 1.0 创建数据和日志目录
[root@test_mongodb]# mkdir -p /mongodb/data /mongodb/log
-- 2.0 解压缩
[root@test_mongodb]# tar zxvf mongodb-linux-x86_64-rhel70-4.2.8.tgz
mongodb-linux-x86_64-rhel70-4.2.8/THIRD-PARTY-NOTICES.gotools
mongodb-linux-x86_64-rhel70-4.2.8/README
mongodb-linux-x86_64-rhel70-4.2.8/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel70-4.2.8/MPL-2
mongodb-linux-x86_64-rhel70-4.2.8/LICENSE-Community.txt
mongodb-linux-x86_64-rhel70-4.2.8/bin/mongodump
mongodb-linux-x86_64-rhel70-4.2.8/bin/mongorestore
mongodb-linux-x86_64-rhel70-4.2.8/bin/mongoexport
部署Linux版MongoDB-启动服务:
-- 1.0 启动MongoDB服务
[root@test_mongodb]# ./bin/mongod --port=27017 --dbpath=/mongodb/data --logpath=/mongodb/log/mongodb.log –fork
about to fork child process, waiting until server is ready for connections.
forked process: 64527
child process started successfully, parent exiting
-- 2.0 登录
[root@test_mongodb]# ./bin/mongo --port=27017
MongoDB server version v4.2.8
服务器组件-mongod
[root@test_mongodb]# ./bin/mongod --port=27017 --dbpath=/mongodb/data --logpath=/mongodb/log/mongodb.log –fork
about to fork child process, waiting until server is ready for connections.
forked process: 64527
child process started successfully, parent exiting
服务器组件-mongo
[root@test_mongodb]# ./bin/mongo --port=27017
MongoDB shell version v4.2.8
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8a34c563-b893-4348-b5d9-fd6286e928f0") }
MongoDB server version: 4.2.8
服务器组件-mongostat
[root@test_mongodb]# ./bin/mongostat --port 27017
insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn time
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 166b 36.9k 2 Jun 17 01:32:16.862
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 111b 36.6k 2 Jun 17 01:32:17.864
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 112b 36.8k 2 Jun 17 01:32:18.859
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 111b 36.6k 2 Jun 17 01:32:19.861
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 112b 36.7k 2 Jun 17 01:32:20.859
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 111b 36.6k 2 Jun 17 01:32:21.862
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 112b 36.7k 2 Jun 17 01:32:22.861
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 112b 36.7k 2 Jun 17 01:32:23.861
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 111b 36.6k 2 Jun 17 01:32:24.861
*0 *0 *0 *0 0 2|0 0.0% 0.0% 0 1.48G 78.0M 0|0 1|0 167b 36.9k 2 Jun 17 01:32:25.861
恭喜你完成准备工作的学习!别忘了打个卡为自己坚持助力!