Raspberry Pi 3 B 및 Ubuntu Server 23.04에서 MongoDB를 실행하려고 할 때 오류가 발생했습니다.

Raspberry Pi 3 B 및 Ubuntu Server 23.04에서 MongoDB를 실행하려고 할 때 오류가 발생했습니다.

Ubuntu를 실행하는 Raspberry Pi 3 B에 MongoDB를 설치하고 실행하려고 합니다.

설치하고 시작하려고 하면 다음과 같은 상태가 나타납니다.

srv_user@raspserver:~$ sudo systemctl start mongod
srv_user@raspserver:~$ sudo systemctl status mongod
× mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; preset: enabled)
     Active: failed (Result: core-dump) since Sat 2023-07-08 01:23:51 CEST; 3s ago
   Duration: 1.448s
       Docs: https://docs.mongodb.org/manual
    Process: 36515 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
   Main PID: 36515 (code=dumped, signal=ILL)
        CPU: 120ms
srv_user@raspserver:~$ mongo
Illegal instruction (core dumped)

OS 정보는 다음과 같습니다.

srv_user@raspserver:~$ uname -a
Linux raspserver 6.2.0-1007-raspi #9-Ubuntu SMP PREEMPT Wed Jun 21 18:54:19 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

srv_user@raspserver:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:        23.04
Codename:       lunar

MongoDB를 설치하는 데 사용한 명령은 다음과 같습니다.

#####Removing old files#####
sudo rm /etc/apt/sources.list.d/mongodb*.list

sudo service mongod stop

sudo apt-get purge mongodb-org*

sudo apt autoremove

sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
############################

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get update --allow-insecure-repositories

sudo apt-get install -y mongodb-org

sudo systemctl start mongod

sudo systemctl status mongod

다음과 같은 결과가 나타납니다.

srv_user@raspserver:~$ sudo rm /etc/apt/sources.list.d/mongodb*.list
rm: cannot remove '/etc/apt/sources.list.d/mongodb*.list': No such file or directory
srv_user@raspserver:~$ sudo service mongod stop
srv_user@raspserver:~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'mongodb-org-database-tools-extra' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools-unstable' for glob 'mongodb-org*'
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-tools-unstable' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-org-database-tools-extra' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  mongodb-database-tools mongodb-mongosh
Use 'sudo apt autoremove' to remove them.
(Reading database ... 140652 files and directories currently installed.)
Removing mongodb-org-mongos (4.4.22) ...
Removing mongodb-org-server (4.4.22) ...
Removing mongodb-org-shell (4.4.22) ...
Processing triggers for man-db (2.11.2-1) ...
(Reading database ... 140629 files and directories currently installed.)
Purging configuration files for mongodb-org-server (4.4.22) ...
Purging configuration files for mongodb-org (4.4.22) ...
srv_user@raspserver:~$ sudo apt autoremove
[sudo] password for srv_user:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  mongodb-database-tools mongodb-mongosh
0 upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
After this operation, 180 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 140628 files and directories currently installed.)
Removing mongodb-database-tools (100.7.3) ...
Removing mongodb-mongosh (1.10.1) ...
Processing triggers for man-db (2.11.2-1) ...
srv_user@raspserver:~$ sudo rm -r /var/log/mongodb
srv_user@raspserver:~$ sudo rm -r /var/lib/mongodb
srv_user@raspserver:~$ wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
srv_user@raspserver:~$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse
srv_user@raspserver:~$ sudo apt-get update --allow-insecure-repositories
Hit:1 http://ports.ubuntu.com/ubuntu-ports lunar InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports lunar-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports lunar-backports InRelease
Ign:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports lunar-security InRelease
Get:6 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release [3094 B]
Get:7 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release.gpg [866 B]
Get:8 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 Packages [49.5 kB]
Get:9 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 Packages [40.5 kB]
Fetched 93.9 kB in 6s (16.8 kB/s)
Reading package lists... Done
W: https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.4/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
srv_user@raspserver:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  mongodb-database-tools mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server mongodb-org-shell
  mongodb-org-tools
The following NEW packages will be installed:
  mongodb-database-tools mongodb-org mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server
  mongodb-org-shell mongodb-org-tools
0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
Need to get 95.4 MB/95.4 MB of archives.
After this operation, 194 MB of additional disk space will be used.
Get:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-database-tools arm64 100.7.3 [49.1 MB]
Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-shell arm64 4.4.22 [12.3 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-server arm64 4.4.22 [18.9 MB]
Get:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-mongos arm64 4.4.22 [15.1 MB]
Fetched 95.4 MB in 13s (7393 kB/s)
Selecting previously unselected package mongodb-database-tools.
(Reading database ... 140607 files and directories currently installed.)
Preparing to unpack .../0-mongodb-database-tools_100.7.3_arm64.deb ...
Unpacking mongodb-database-tools (100.7.3) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../1-mongodb-org-shell_4.4.22_arm64.deb ...
Unpacking mongodb-org-shell (4.4.22) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../2-mongodb-org-server_4.4.22_arm64.deb ...
Unpacking mongodb-org-server (4.4.22) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../3-mongodb-org-mongos_4.4.22_arm64.deb ...
Unpacking mongodb-org-mongos (4.4.22) ...
Preparing to unpack .../4-mongodb-org-database-tools-extra_4.4.22_arm64.deb ...
Unpacking mongodb-org-database-tools-extra (4.4.22) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../5-mongodb-org-tools_4.4.22_arm64.deb ...
Unpacking mongodb-org-tools (4.4.22) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../6-mongodb-org_4.4.22_arm64.deb ...
Unpacking mongodb-org (4.4.22) ...
Setting up mongodb-org-server (4.4.22) ...
Setting up mongodb-org-shell (4.4.22) ...
Setting up mongodb-database-tools (100.7.3) ...
Setting up mongodb-org-mongos (4.4.22) ...
Setting up mongodb-org-database-tools-extra (4.4.22) ...
Setting up mongodb-org-tools (4.4.22) ...
Setting up mongodb-org (4.4.22) ...
Processing triggers for man-db (2.11.2-1) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

나는 현재 문제가 될 수 있는 Ubuntu 릴리스라고 추측하고 있지만 이전 버전을 새로 설치하기 전에 누군가 비슷한 경험을 했는지 물어보고 싶었습니다.

답변1

@natiiiix 덕분에 mongodb를 성공적으로 설치하고 시작할 수 있었습니다. 이전에 사용했던 특정 버전인 4.4.22와 관련이 있습니다.

3.2, 2.4 등 다른 버전도 시도해 보았지만 전혀 작동하지 않았습니다. 버전 4.4.1만 작동합니다.

내가 사용한 명령은 다음과 같습니다.

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
    
echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get update --allow-insecure-repositories

sudo apt-get install -y mongodb-org=4.4.1  mongodb-org-server=4.4.1  mongodb-org-shell=4.4.1 mongodb-org-mongos=4.4.1 mongodb-org-tools=4.4.1 

echo "mongodb-org hold" | sudo dpkg --set-selections &&
echo "mongodb-org-server hold" | sudo dpkg --set-selections &&
echo "mongodb-org-shell hold" | sudo dpkg --set-selections &&
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections &&
echo "mongodb-org-tools hold" | sudo dpkg --set-selections

답변2

MongoDB는 현재 Pi 플랫폼을 지원하지 않습니다. 최신 버전의 MongoDB를 실행하려면 다음을 참조하세요.여기최선의 노력을 바탕으로 제공되는 비공식 바이너리용입니다.

관련 정보