当前位置: 首页 > news >正文

mongodb的安装操作记录

mongodb的安装操作记录

1 上传软件包,并解压

[root@monitor local]# tar -xvf mongodb-linux-x86_64-rhel70-7.0.12.tgz 
mongodb-linux-x86_64-rhel70-7.0.12/LICENSE-Community.txt
mongodb-linux-x86_64-rhel70-7.0.12/MPL-2
mongodb-linux-x86_64-rhel70-7.0.12/README
mongodb-linux-x86_64-rhel70-7.0.12/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel70-7.0.12/bin/install_compass
mongodb-linux-x86_64-rhel70-7.0.12/bin/mongod
mongodb-linux-x86_64-rhel70-7.0.12/bin/mongos
mongodb-linux-x86_64-rhel70-7.0.12/sbom_from_silk.json
[root@monitor local]# mv mongodb-linux-x86_64-rhel70-7.0.12 mongodb
[root@monitor local]# ll
total 140056
drwxr-xr-x. 2 root root        6 Dec 14  2017 bin
drwxr-xr-x. 2 root root        6 Dec 14  2017 etc
drwxr-xr-x. 2 root root        6 Dec 14  2017 games
drwxr-xr-x. 2 root root        6 Dec 14  2017 include
drwxr-xr-x. 2 root root        6 Dec 14  2017 lib
drwxr-xr-x. 2 root root        6 Dec 14  2017 lib64
drwxr-xr-x. 2 root root        6 Dec 14  2017 libexec
drwxr-xr-x  3 root root      127 Aug  3 08:48 mongodb
-rw-r--r--  1 root root 84899620 Aug  3 08:45 mongodb-linux-x86_64-rhel70-7.0.12.tgz
-rw-r--r--  1 root root 58512548 Aug  3 08:45 mongodb-mongosh-2.2.15.x86_64.rpm
drwxr-xr-x. 2 root root        6 Dec 14  2017 sbin
drwxr-xr-x. 5 root root       49 Feb  3  2023 share
drwxr-xr-x. 2 root root        6 Dec 14  2017 src

2 创建相关目录

[root@monitor mongodb]# pwd
/usr/local/mongodb
[root@monitor mongodb]# mkdir etc
[root@monitor mongodb]# mkdir log
[root@monitor mongodb]# mkdir data

3 配置参数文件

[root@monitor etc]# pwd
/usr/local/mongodb/etc
[root@monitor etc]# cat mongodb.conf 
systemLog:destination: filepath: /usr/local/mongodb/log/mongodb.loglogAppend: true
storage:dbPath: /usr/local/mongodb/dataprocessManagement:fork: true
net:bindIp: localhost,127.0.0.1port: 27017

4 启动数据库

[root@monitor bin]# ./mongod -f /usr/local/mongodb/etc/mongodb.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 2948
child process started successfully, parent exiting
[root@monitor bin]# ps -ef |grep mongo
root       2948      1  5 08:52 ?        00:00:00 ./mongod -f /usr/local/mongodb/etc/mongodb.conf
root       3005   2377  0 08:52 pts/0    00:00:00 grep --color=auto mongo

5 安装mongosh工具

[root@monitor local]# rpm -ivh mongodb-mongosh-2.2.15.x86_64.rpm
warning: mongodb-mongosh-2.2.15.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID d361cb16: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...1:mongodb-mongosh-2.2.15-1.el8     ################################# [100%]

6 登录测试

[root@monitor ~]# mongosh 
Current Mongosh Log ID: 66ae52a7ad27f1e35a838725
Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.15
Using MongoDB:          7.0.12
Using Mongosh:          2.2.15For mongosh info see: https://docs.mongodb.com/mongodb-shell/To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
You can opt-out by running the disableTelemetry() command.------The server generated these startup warnings when booting2024-08-03T08:52:18.195-07:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted2024-08-03T08:52:18.196-07:00: You are running this process as the root user, which is not recommended2024-08-03T08:52:18.196-07:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never' in this binary version2024-08-03T08:52:18.196-07:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never' in this binary version2024-08-03T08:52:18.196-07:00: Soft rlimits for open file descriptors too low
------Deprecation warnings:- Using mongosh on the current operating system is deprecated, and support may be removed in a future release.
See https://www.mongodb.com/docs/mongodb-shell/install/#supported-operating-systems for documentation on supported platforms.
test> show dbs
admin   40.00 KiB
config  12.00 KiB
local   40.00 KiB
test>
http://www.lryc.cn/news/414446.html

相关文章:

  • C++客户端Qt开发——多线程编程(二)
  • ubuntu20复现NBV探索
  • 【51单片机仿真】基于51单片机设计的温湿度采集检测系统仿真源码文档视频——文末资料下载
  • 【Hadoop-驯化】一文学会hadoop访问hdfs中常用命令使用技巧
  • 【Spring】Bean详细解析
  • 决策树总结
  • 通俗易懂!495页看漫画学Python入门教程(全彩版)Git首发破万Star
  • websocket实现简易聊天室
  • vulhub-wordpress
  • 【机器学习算法基础】(基础机器学习课程)-10-逻辑回归-笔记
  • 自动驾驶行业知识汇总
  • C#根据反射操作对象
  • 打包python脚本(flask、jinja2)为exe文件
  • 嵌入式初学-C语言-练习三
  • 最新版Sonible Plugins Bundle v2024 winmac,简单智能,持续更新长期有效
  • J032_实现简易版的B/S架构
  • 【前端面试】五、框架
  • C语言 | Leetcode C语言题解之第316题去除重复字母
  • 本地部署 Llama-3-EvoVLM-JP-v2
  • Evaluating the Generation Capabilities of Large Chinese Language Models
  • YOLOv8添加注意力模块并测试和训练
  • 「Unity3D」自动布局LayoutElement、ContentSizeFitter、AspectRatioFitter、GridLayoutGroup
  • 【Golang 面试 - 进阶题】每日 3 题(十六)
  • Redis2
  • C语言--函数
  • Shell 编程的高级技巧和实战应用
  • VMWare虚拟机如何连接U盘
  • 【学习笔记】后缀自动机(SAM)
  • Godot的节点与场景
  • C++ 学习(2) ---- std::cout 格式化输出