Slide 33
Slide 33 text
MIRACLE LINUX Meetup!! 33
構築手順・MongoDBのインストール・設定4
MongoDBの起動、サーバ起動時の自動起動設定を行います。
$ sudo systemctl enable --now mongod
mongoコマンドを使用して、レプリカセットを作成します。
$ mongo --eval "printjson(rs.initiate())"
MongoDB shell version v5.0.14
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName;=mongodb
Implicit session: session { "id" : UUID("c92f65e5-b984-4635-8471-5723b869e38c") }
MongoDB server version: 5.0.14
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "127.0.0.1:27017",
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1663482784, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1663482784, 1)
}
$ sudo systemctl enable --now mongod
$ mongo --eval "printjson(rs.initiate())"
MongoDB shell version v5.0.14
connecting to:
mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName;=mongodb
Implicit session: session { "id" : UUID("c92f65e5-b984-4635-8471-5723b869e38c") }
MongoDB server version: 5.0.14
{
"info2" : "no configuration specified. Using a default configuration for the
set",
"me" : "127.0.0.1:27017",
"ok" : 1,
(略)