Learn how to install MongoDB 6.0 on ARM architecture

Table of contents

New features of MongoDB6.0

Environmental preparation

Download MongoDB Community Server

Start MongoDB Server

Close mongodb

mongosh use


New features of MongoDB6.0

The main features of this version include:
  • Time series collection enhancement
  • Change Stream enhancement
  • Queryable encryption
  • Enhanced aggregation & query capabilities
  • Cluster synchronization
https://www.mongodb.com/docs/v6.0/release-notes/6.0/
https://help.aliyun.com/document_detail/462614.html?spm=a2c4g.312011.0.0.75b42ab8s9Na
sS#section-hvy-d22-stk

Environmental preparation

  • System: Mac OS M1
  • Linux version: CentOS 9
  • Linux architecture: aarch64

Use the uname -m command to confirm the architecture of your system

use cat /etc/ redhat-release 查Viewlinux version

[root@10 ~]#  cat /etc/redhat-release
CentOS Stream release 9
[root@10 ~]# uname -m
aarch64

Download MongoDB Community Server

Download address: https://www.mongodb.com/try/download/community
Go to the folder you prepared for mongodb and download it
wget https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-rhel90-6.0.12.tgzpm

Unzip the tarball

tar -zxvf mongodb-linux-aarch64-rhel90-6.0.12.tgz

Start MongoDB Server

#创建dbpath和logpath
mkdir -p /mongodb/data /mongodb/log 
#进入mongodb目录,启动mongodb服务
bin/mongod  --port=27017 --dbpath=/tools/mongodb/data --logpath=/tools/mongodb/logs/mongodb.log --bind_ip=0.0.0.0 --fork
--dbpath: Specify the data file storage directory
--logpath: Specify the log file. Note that the specified file is not a directory.
--logappend: Use append mode to record logs
--port: Specify port, default is 27017
--bind_ip: only listens to the localhost network card by default
--fork: background startup
--auth: enable authentication mode
If mongodb fails to start at this time, you can try restarting the linux server.
Verify that mongodb starts successfully
ps -ef | grep mongodb

Close mongodb

bin/mongod --port=27017 --dbpath=/tools/mongodb/data --shutdown

mongosh use

mongosh is an interactive JavaScript shell interface for MongoDB that provides a powerful interface for system administrators and a way for developers to directly test database queries and operations

Note:MongoDB 6.0 removes mongo and uses mongosh

mongosh download address: https://www.mongodb.com/try/download/shell

Install

rpm -ivh mongodb-mongosh-2.1.1.aarch64.rpm

Connect to mongodb server

# 连接mongodb server端 
mongosh --host=192.168.65.206 --port=27017
mongosh 192.168.65.206:27017
# 指定uri方式连接
mongosh mongodb://192.168.65.206:27017/test

I am operating on Linux, so it is 127.0.0.1 

Simply test some commands: 

 

Okay, that’s it for now on how to install mongodb on Arm architecture. Let’s talk about security authentication and user-related things in the next article~

Guess you like

Origin blog.csdn.net/weixin_43728884/article/details/134916218