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

ubuntu 安装 mongodb 笔记记录

https://www.mongodb.com/try/download/community

以上是下载地址

查看系统

(base) duyicheng@duyicheng-computer:~$ cat /proc/version
Linux version 6.8.0-48-generic (buildd@lcy02-amd64-010) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024
(base) duyicheng@duyicheng-computer:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble
(base) duyicheng@duyicheng-computer:~$ ^C
(base) duyicheng@duyicheng-computer:~$ 

选择合适的

下载

打开所在文件夹,右键黑窗口

出错了

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo dpkg -i mongodb-org-server_8.0.3_amd64.deb
[sudo] password for duyicheng:
Selecting previously unselected package mongodb-org-server.
(Reading database ... 152091 files and directories currently installed.)
Preparing to unpack mongodb-org-server_8.0.3_amd64.deb ...
Unpacking mongodb-org-server (8.0.3) ...
dpkg: dependency problems prevent configuration of mongodb-org-server:
 mongodb-org-server depends on libssl1.1 (>= 1.1.1); however:
  Package libssl1.1 is not installed.

dpkg: error processing package mongodb-org-server (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
 mongodb-org-server
(base) duyicheng@duyicheng-computer:~/Downloads$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  mongodb-org-server
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 217 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 152103 files and directories currently installed.)
Removing mongodb-org-server (8.0.3) ...
Processing triggers for man-db (2.12.0-4build2) ...
(base) duyicheng@duyicheng-computer:~/Downloads$ sudo dpkg -i mongodb-org-server_8.0.3_amd64.deb
Selecting previously unselected package mongodb-org-server.
(Reading database ... 152092 files and directories currently installed.)
Preparing to unpack mongodb-org-server_8.0.3_amd64.deb ...
Unpacking mongodb-org-server (8.0.3) ...
dpkg: dependency problems prevent configuration of mongodb-org-server:
 mongodb-org-server depends on libssl1.1 (>= 1.1.1); however:
  Package libssl1.1 is not installed.

dpkg: error processing package mongodb-org-server (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
 mongodb-org-server
(base) duyicheng@duyicheng-computer:~/Downloads$ mongodb-org-server
mongodb-org-server: command not found
(base) duyicheng@duyicheng-computer:~/Downloads$

 补充 libssl1.1

先更新软件包列表:

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo apt update

再更新缺少的库:又錉了

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo apt install libssl1.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libssl1.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl1.1' has no installation candidate

打开以下网址:

Index of /ubuntu-ports/pool/main/o/opensslicon-default.png?t=O83Ahttp://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/

 我下的是如下图:

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
[sudo] password for duyicheng: 
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 152103 files and directories currently installed.)
Preparing to unpack libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...

再回头来一次

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo dpkg -i mongodb-org-server_8.0.3_amd64.deb
(Reading database ... 152113 files and directories currently installed.)
Preparing to unpack mongodb-org-server_8.0.3_amd64.deb ...
Unpacking mongodb-org-server (8.0.3) over (8.0.3) ...
Setting up mongodb-org-server (8.0.3) ...
info: Selecting UID from range 100 to 999 ...

info: Adding system user `mongodb' (UID 124) ...
info: Adding new user `mongodb' (UID 124) with group `nogroup' ...
info: Not creating `/nonexistent'.
info: Selecting GID from range 100 to 999 ...
info: Adding group `mongodb' (GID 127) ...
info: Adding user `mongodb' to group `mongodb' ...
Processing triggers for man-db (2.12.0-4build2) ...
(base) duyicheng@duyicheng-computer:~/Downloads$ 

根据你提供的输出信息,可以总结以下几点:

- **安装过程顺利**:从日志来看,`mongodb-org-server` 包已经成功解包并安装。
- **用户和组创建**:系统为 MongoDB 创建了专用的用户 `mongodb` 和组 `mongodb`。
- **触发器处理**:安装完成后,系统处理了 `man-db` 的触发器,这通常是为了更新手册页。

### 结论
安装过程没有出现错误信息,可以认为 MongoDB 服务器已经成功安装到你的系统上。你可以通过以下命令来启动 MongoDB 服务并检查其状态:

```bash
# 启动 MongoDB 服务
sudo systemctl start mongod

# 检查 MongoDB 服务状态
sudo systemctl status mongod
```


如果服务启动成功且状态正常,说明安装完全成功。

 

# 启动 MongoDB 服务
sudo systemctl start mongod

# 检查 MongoDB 服务状态
sudo systemctl status mongod


# 停止
sudo systemctl stop mongod
# 重启
sudo systemctl restart mongod

# 卸载
# 停止
sudo service mongod stop
# 删除包
sudo apt-get purge mongodb-org*
# 删除数据目录
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo systemctl start mongod
(base) duyicheng@duyicheng-computer:~/Downloads$ sudo systemctl status mongod
● mongod.service - MongoDB Database Server
     Loaded: loaded (/usr/lib/systemd/system/mongod.service; disabled; preset: >
     Active: active (running) since Wed 2024-11-06 10:50:01 HKT; 15s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 83097 (mongod)
     Memory: 88.8M (peak: 89.0M)
        CPU: 1.105s
     CGroup: /system.slice/mongod.service
             └─83097 /usr/bin/mongod --config /etc/mongod.conf

Nov 06 10:50:01 duyicheng-computer systemd[1]: Started mongod.service - MongoDB>
Nov 06 10:50:01 duyicheng-computer mongod[83097]: {"t":{"$date":"2024-11-06T02:>
lines 1-12/12 (END)

OK 

下面安装图形界面。

MongoDB Compass Download (GUI) | MongoDBMongoDB Compass, the GUI for MongoDB, is the easiest way to explore and manipulate your data. Download for free for dev environments.icon-default.png?t=O83Ahttps://www.mongodb.com/try/download/compass

安装

(base) duyicheng@duyicheng-computer:~/Downloads$ sudo dpkg -i mongodb-compass_1.44.6_amd64.deb
[sudo] password for duyicheng: 
Selecting previously unselected package mongodb-compass.
(Reading database ... 152113 files and directories currently installed.)
Preparing to unpack mongodb-compass_1.44.6_amd64.deb ...
Unpacking mongodb-compass (1.44.6) ...
Setting up mongodb-compass (1.44.6) ...
Processing triggers for gnome-menus (3.36.0-1.1ubuntu3) ...
Processing triggers for desktop-file-utils (0.27-2build1) ...
(base) duyicheng@duyicheng-computer:~/Downloads$ 

运行之。

以上OK .

初学者,我


http://www.kler.cn/a/387818.html

相关文章:

  • 实战指南:理解 ThreadLocal 原理并用于Java 多线程上下文管理
  • 由播客转向个人定制的音频频道(1)平台搭建
  • 前端web
  • 把握鸿蒙生态崛起的机遇:开发者视角的探讨
  • 软件测试学习记录 Day1
  • Vue Cli 脚手架目录文件介绍
  • LabVIEW编程基础教学(二)--数据类型
  • IEEE 1588:电信网络的精确时间协议 (PTP)
  • 【学习笔记】SAP ABAP——OPEN SQL(一)【SELECT语句】
  • linux服务器vim的四种模式
  • J2V8学习一 --- 介绍
  • 实现uniapp-微信小程序 搜索框+上拉加载+下拉刷新
  • 数学基础 -- 线性代数之线性无关
  • Django的manage.py命令用法
  • Unity 实现一个内存紧凑,高效,兼容度高,支持序列化的Map
  • 【K8S系列】Kubernetes 新创建的 Service 或 Pod 无法被发现问题【已解决】
  • 怎么禁止Ubuntu自动更新升级
  • 使用jmeter查询项目数据库信息,保存至本地txt或excel文件1108
  • Power Pivot、Power BI 和 SQL Server Analysis Services 的公式语言:DAX(数据分析表达式)
  • window11安装elasticsearch+Kibana
  • mac环境配置本地nfs服务
  • Chromium 中chrome.system.cpu扩展接口定义c++
  • 2024年下半年系统分析师论文
  • 【Linux】shell脚本:检测路径是否存在,如不存在则创建
  • Linux设置jar包开机自启
  • 闪耀CeMAT亚洲物流展,驭势科技发布第五代U-Drive®智驾系统