knaka Tech-Blog

AI, IoT, DIYエレクトロニクス, データサイエンスについて投稿予定です。

mongoDB 4を、Ubuntuにインストールする



mongodb 4.2を、Ubuntu16 にインストールして使用メモとなります


mongo DB 4.2



wget -qO - | sudo apt-key add -

echo "deb [ arch=amd64 ] xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

sudo apt-get update

sudo apt-get install -y mongodb-org

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


sudo service mongod start

sudo service mongod stop

mongo のログ

v4.2 で、起動してますね。

app4$ mongo
MongoDB shell version v4.2.0
connecting to: mongodb://
Implicit session: session { "id" : UUID("e0cc8937-6984-47a1-9661-81a6e05f7320") }
MongoDB server version: 4.2.0
Server has startup warnings:
2019-09-14T11:10:13.216+0900 I  STORAGE  [initandlisten]
2019-09-14T11:10:13.216+0900 I  STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-09-14T11:10:13.216+0900 I  STORAGE  [initandlisten] **          See
2019-09-14T11:10:14.426+0900 I  CONTROL  [initandlisten]
2019-09-14T11:10:14.426+0900 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-09-14T11:10:14.426+0900 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-09-14T11:10:14.426+0900 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()