menu

Running a MongoDB Database in Kubernetes with StatefulSets

Go to Lab

192 Reviews

504e66b3815c7f6c6af8d0983d1e7d6b

Training T. · Reviewed about 1 month ago

B82deff2063f309a71a16fa092b8d920

Swayangjit P. · Reviewed about 1 month ago

E78fe42f416dd38d91f78f37518714f7

not quite

Ganesh R. · Reviewed about 1 month ago

A072af58b633640be9b8826e0052563a

Kong M. · Reviewed about 1 month ago

89457f0e6d0eee2370c8e129e75e8083

Gabriel L. · Reviewed about 1 month ago

53efb83075fce44c1b586c896d2437e2

Geoff H. · Reviewed about 1 month ago

E3ce3b160ea1661c5c1da93cf14d72b3

Devashish S. · Reviewed about 1 month ago

880a345b74851c9b086ae0b0bd8c173c

Hariprasad B. · Reviewed about 1 month ago

A9d1ca8e02afc5e7b7e20ca19757bffb

I followed all the steps, but when I connect to mongo-0 and initiate the replica set, the config only shows one member. It complains that there is no configuration. I tried this lab twice and the same thing happened. NAME READY STATUS RESTARTS AGE mongo-0 2/2 Running 0 2m mongo-1 2/2 Running 0 1m mongo-2 2/2 Running 0 1m ^C google194169_student@qwiklabs-gcp-55ab6bc9339981a6:~/mongo-k8s-sidecar/example/StatefulSet$ kubectl exec -ti mongo-0 mongo Defaulting container name to mongo. Use 'kubectl describe pod/mongo-0' to see all of the containers in this pod. MongoDB shell version v3.6.2 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.2 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2018-01-21T22:51:40.475+0000 I STORAGE [initandlisten] 2018-01-21T22:51:40.475+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2018-01-21T22:51:40.475+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server. 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the 2018-01-21T22:51:40.554+0000 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning. 2018-01-21T22:51:40.555+0000 I CONTROL [initandlisten] 2018-01-21T22:51:40.555+0000 I CONTROL [initandlisten] 2018-01-21T22:51:40.555+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2018-01-21T22:51:40.555+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2018-01-21T22:51:40.555+0000 I CONTROL [initandlisten] 2018-01-21T22:53:51.735+0000 E - [main] Error loading history file: FileOpenFailed: Unable to fopen() file /root/.dbshell: No such file or directory > rs.initiate() { "info2" : "no configuration specified. Using a default configuration for the set", "me" : "localhost:27017", "ok" : 1, "operationTime" : Timestamp(1516575253, 1), "$clusterTime" : { "clusterTime" : Timestamp(1516575253, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } } rs0:OTHER> rs.conf() { "_id" : "rs0", "version" : 1, "protocolVersion" : NumberLong(1), "members" : [ { "_id" : 0, "host" : "localhost:27017", Questions? Try the support group "arbiterOnly" : false, "buildIndexes" : true, "hidden" : false, "priority" : 1, "tags" : { }, "slaveDelay" : NumberLong(0), "votes" : 1 } ], "settings" : { "chainingAllowed" : true, "heartbeatIntervalMillis" : 2000, "heartbeatTimeoutSecs" : 10, "electionTimeoutMillis" : 10000, "catchUpTimeoutMillis" : -1, "catchUpTakeoverDelayMillis" : 30000, "getLastErrorModes" : { }, "getLastErrorDefaults" : { "w" : 1, "wtimeout" : 0 }, "replicaSetId" : ObjectId("5a651a150a90a676d7940383") } }

Ronald L. · Reviewed about 1 month ago

A9d1ca8e02afc5e7b7e20ca19757bffb

I followed all the steps, but when I connect to mongo-0 and initiate the replica set, the config only shows one member. It complains that there is no configuration. I'm going to try this lab again.

Ronald L. · Reviewed about 1 month ago

96072afd56b83502f520364a162e1d46

Atikom J. · Reviewed about 1 month ago

Fcd27b584673aed2e83249a518ba60e0

Would have loved an example of connecting to the MongoDB

Frank Z. · Reviewed about 1 month ago

137ca4829a61dba3ac49419765887c88

Steven U. · Reviewed about 1 month ago

08756c5b9e4760785bfd8fdfda89d3fd

Laurent V. · Reviewed about 1 month ago

08756c5b9e4760785bfd8fdfda89d3fd

Laurent V. · Reviewed about 1 month ago

D07d3bf10060e122c6ec645492239c6f

explanation was too light for the relationship between statefulset pvc and service and how the mongoDB works with everything. There is also no sample application that connects to mongoDB

Vince L. · Reviewed about 1 month ago

Be1d3e287556ca14fcd25c0b4b8b689d

This was a really weak lab. 1) It needs a physical architectural diagram so that you can quickly understand how everything is laid out. 2) I was really confused about the network configuration and how IP addresses get assigned to the headless thingy. 3) what is the point of setting up a database and then not actually using it. I had 30 minutes left in the lab. Add content to do something with the database!

Louis H. · Reviewed about 1 month ago

91e2d20bdd2e711e2ca61a938d93654e

Leonardo S. · Reviewed about 1 month ago

7d8e7d051bb02cd4049914d526d611a1

Ankitkumar P. · Reviewed about 1 month ago

E5c5d0d2d88e43d7ff4bf4caa959f115

Scott M. · Reviewed about 1 month ago

0f49da751d0e95dcfba3d3e788325228

Carla P. · Reviewed about 1 month ago

F16cffdd2f2296044fe52335162ab8ec

Guilherme S. · Reviewed about 1 month ago

B80ee293f2086fda133ab7c5ea39cd2d

Sergio D. · Reviewed about 1 month ago

2d550e1655276b17226a526a8831f60b

Too easy.

Tommy N. · Reviewed about 1 month ago