ラズパイにmongoをインストールする
sudo apt update
sudo apt-get install -y mongodb-org
# daemon設定をリロード
sudo systemctl daemon-reload
# mongoのsystemctlを有効化
sudo systemctl enable mongod
# 起動
sudo systemctl start mongod
起動状態の確認
# 起動状態確認
sudo systemctl status mongod
下記のように表示されれば OK!!
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-11-24 23:49:55 UTC; 16s ago
Docs: https://docs.mongodb.org/manual
Main PID: 199747 (mongod)
Memory: 98.2M
CGroup: /system.slice/mongod.service
└─199747 /usr/bin/mongod --config /etc/mongod.conf
Nov 24 23:49:55 ubuntu systemd[1]: Started MongoDB Database Server.