ubuntu 安装 mongodb 笔记记录

server/2024/11/14 2:15:29/
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 sourceE: 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.ppmy.cn/server/141245.html

相关文章

ZABBIX API获取监控服务器OS层信息

Zabbix 是一款强大的开源监控解决方案,能够通过其 API 接口自动化管理和获取监控数据。在这篇文章中,详细讲解如何通过 Zabbix API 批量获取服务器的系统名称、IP 地址及操作系统版本信息,并将数据保存到 CSV 文件中。本文适合对 Python 编程和 Zabbix 监控系统有一定基础的…

CelebV-Text——从文本生成人脸视频的数据集

概述 近年来,生成模型在根据文本生成和编辑视频方面受到了广泛关注。然而,由于缺乏合适的数据集,生成人脸视频领域仍然是一个挑战。特别是,生成的视频帧质量较低,与输入文本的相关性较弱。在本文中,我们通…

《Python使用sqlite3数据库》

《Python使用sqlite3数据库》 1、连接数据库2、创建游标3、执行SQL语句4、提交更改5、查询数据6、关闭连接 Python可以使用多种数据库,以下是一般步骤和示例: 1、连接数据库 首先要安装对应的数据库驱动。如使用MySQL数据库,要安装pymysql库…

如何安装和配置JDK17

教程目录 零、引言1、新特性概览2、性能优化3、安全性增强4、其他改进5、总结 一、下载安装二、环境配置三、测试验证 零、引言 JDK 17(Java Development Kit 17)是Java平台的一个重要版本,它带来了许多新特性和改进,进一步提升了…

大数据新视界 -- 大数据大厂之 Impala 性能优化:应对海量复杂数据的挑战(上)(7/30)

💖💖💖亲爱的朋友们,热烈欢迎你们来到 青云交的博客!能与你们在此邂逅,我满心欢喜,深感无比荣幸。在这个瞬息万变的时代,我们每个人都在苦苦追寻一处能让心灵安然栖息的港湾。而 我的…

Alibaba/Canal 使用

alibaba/canal 的实际使用场景 Alibaba的Canal是一款用于MySQL数据库增量订阅和消费的工具,主要用于解决数据库的实时数据同步问题。以下是一些实际使用场景: 数据同步:在分布式系统中,将一个MySQL数据库的数据实时同步到另一个M…

Spring系统框架

Spring Framework系统架构 1.Spring核心概念 代码书写现状 耦合度偏高 解决方案 使用对象时,在程序中不要主动使用new产生对象,转换为外部提供对象 IOC(Inversion of Control)控制反转 对象的创建控制权由程序移到外部,这种思想称为控制…

【进阶】Stable Diffusion 插件 Controlnet 安装使用教程(图像精准控制)

Stable Diffusion WebUI 的绘画插件 Controlnet 最近更新了 V1.1 版本,发布了 14 个优化模型,并新增了多个预处理器,让它的功能比之前更加好用了,最近几天又连续更新了 3 个新 Reference 预处理器,可以直接根据图像生产…