部署mongodb服务

(1)官网下载mongodb-linux-aarch64-ubuntu1804-4.2.25.tgz压缩包

(2)上传至服务器,解压

(3)设置环境变量

vi /etc/profile
export PATH=/data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/bin
source /etc/profile
echo $PATH

(4)新建data、log、config目录,用于存储数据、日志、配置文件

(5)config目录,新建mongodb.conf配置文件,如下

dbpath=/data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/data
logpath=/data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/log/mongodb.log
port=27019
bind_ip=0.0.0.0
fork=true
logappend=true
auth=fals

(6)启动服务

root@xxx:~# mongod -f /data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/config/mongodb.conf
about to fork child process, waiting until server is ready for connections.
forked process: 2532113
child process started successfully, parent exiting

(7)测试

root@xxx:~# ps aux|grep mongo
root     2532113  1.4  0.2 1491680 96156 ?       Sl   11:26   0:01 mongod -f /data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/config/mongodb.conf
root     2532410  0.0  0.0  17212   680 pts/0    S+   11:27   0:00 grep --color=auto mongo
root@xxx:~# mongo --host 127.0.0.1 --port 27019
MongoDB shell version v4.2.25
connecting to: mongodb://127.0.0.1:27019/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("c00929c6-cb3e-472e-b259-cff7d4164911") }
MongoDB server version: 4.2.25
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
        https://community.mongodb.com
Server has startup warnings: 
2024-01-30T11:30:45.692+0800 I  STORAGE  [initandlisten] 
2024-01-30T11:30:45.692+0800 I  STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2024-01-30T11:30:45.692+0800 I  STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2024-01-30T11:30:46.529+0800 I  CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2024-01-30T11:30:46.529+0800 I  CONTROL  [initandlisten] 
2024-01-30T11:30:46.532+0800 I  CONTROL  [initandlisten] 
2024-01-30T11:30:46.532+0800 I  CONTROL  [initandlisten] ** WARNING: You are running on a NUMA machine.
2024-01-30T11:30:46.532+0800 I  CONTROL  [initandlisten] **          We suggest launching mongod like this to avoid performance problems:
2024-01-30T11:30:46.532+0800 I  CONTROL  [initandlisten] **              numactl --interleave=all mongod [other options]
2024-01-30T11:30:46.532+0800 I  CONTROL  [initandlisten] 
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).

The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---

> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>

(8)关闭服务

root@xxx:~# mongod --shutdown -f /data/software/mongodb/mongodb-linux-aarch64-ubuntu1804-4.2.25/config/mongodb.conf
killing process with pid: 2532113
相关推荐
白总Server6 小时前
MongoDB解说
开发语言·数据库·后端·mongodb·golang·rust·php
码爸9 小时前
spark读mongodb
大数据·mongodb·spark
一个很帅的帅哥1 天前
实现浏览器的下拉加载功能(类似知乎)
开发语言·javascript·mysql·mongodb·node.js·vue·express
JY_H1 天前
MongoDB
数据库·mongodb
东城绝神2 天前
《Linux运维总结:基于ARM64+X86_64架构CPU使用docker-compose一键离线部署mongodb 7.0.14容器版副本集群》
linux·运维·mongodb·架构
香吧香2 天前
mongo 副本集rs 理解和使用小结
mongodb
香吧香2 天前
mongodb 中rs.stauts()命令参数解析
mongodb
青云交3 天前
大数据新视界 --大数据大厂之MongoDB与大数据:灵活文档数据库的应用场景
大数据·数据库·mongodb·非关系型数据库·文档存储·查询功能、数据处理·开发效率、应用场景、高可扩展性
香吧香4 天前
mongo集群同步数据异常,手动同步节点副本数据
mongodb
Navicat中国4 天前
Navicat 17 新特性 | 聚焦 MongoDB
数据库·sql·mongodb·信息可视化·nosql数据库·navicat