2 videos 📅 2025-01-29 09:00:00 Africa/Blantyre
1:23:30
2025-01-29 11:33:43
3:10:55
2025-01-30 10:51:38

Visit the Mongo DB for Administrators course recordings page

                WEBVTT

00:00:05.520 --> 00:00:12.280
Faith, please log on again into the database, so you need to do Mongo SH first, then you can run that stuff.

00:00:12.400 --> 00:00:16.380
So Mongo SH, and then you can rerun the stuff.

00:00:16.620 --> 00:00:21.460
Mongo SH, yep, so you can rerun whatever you want to run.

00:00:22.500 --> 00:00:28.920
I can learn after the delete, do I need to...

00:00:28.920 --> 00:00:29.940
Ah, yes, continue.

00:00:29.940 --> 00:00:33.220
I had Austin saying that we needed to copy something from...

00:00:33.220 --> 00:00:35.940
No, no, no, when you drop the database.

00:00:37.600 --> 00:00:40.780
So the next one, number two, the last command.

00:00:40.780 --> 00:00:41.740
Yeah, it's the DB.

00:00:42.280 --> 00:00:48.820
When you drop the database, you go to 4.1, then you copy that and piece it again.

00:00:49.760 --> 00:00:56.860
So, yeah, so for you faith, you still can be able to do 2.1 up until the dropping of the database.

00:00:57.340 --> 00:01:04.680
After the dropping of the database, then you go back to, what do you go this, you go back to number 1, 4.1.

00:01:04.680 --> 00:01:07.560
then you'll be able to read the data.

00:01:10.770 --> 00:01:11.770
Just a quick question.

00:01:13.470 --> 00:01:13.790
Yes.

00:01:15.110 --> 00:01:16.810
Is course a collection?

00:01:17.230 --> 00:01:22.690
So if I was to want to sort or find all the subjects in a course,

00:01:23.510 --> 00:01:25.050
will it be db.course.

00:01:28.110 --> 00:01:31.430
So if you log into your database and show collections,

00:01:32.310 --> 00:01:34.530
was it made part of the collections?

00:01:34.530 --> 00:01:38.530
So what you can do is just go to your terminal.

00:01:38.530 --> 00:01:43.530
Yes, what are you asking for the story?

00:01:43.530 --> 00:01:45.530
Okay, so I...

00:01:45.530 --> 00:01:48.530
Sorry, I didn't realize I'm on mute.

00:01:48.530 --> 00:01:52.530
Yeah, you were asking, you can continue?

00:01:52.530 --> 00:01:56.530
I was asking a course was a collection.

00:01:56.530 --> 00:01:59.530
Let's say I wanted to list all the courses.

00:01:59.530 --> 00:02:03.530
Will it be db.course.find and then that's what?

00:02:03.530 --> 00:02:11.990
I don't think course is a collection, but what you can do is while this year in the university

00:02:11.990 --> 00:02:17.570
DB, just do show collections and then be able to see if it is actually a collection.

00:02:17.570 --> 00:02:26.110
It would actually be a data that's an array that's in part of a document, right?

00:02:26.110 --> 00:02:28.130
So there's courses, there's students, right?

00:02:28.130 --> 00:02:33.510
So now when you want to find a specific course, you say DB.com.

00:02:33.530 --> 00:02:40.730
which is the collection name and then find whatever it is cost that you want I'm trying

00:02:40.730 --> 00:02:48.650
to list to see what courses are available before okay so just do db dot courses

00:02:48.650 --> 00:02:57.530
dot find and then your what you call this your brackets so just do your brackets

00:02:57.530 --> 00:03:03.510
and then exclamation yeah oh sorry sorry sorry not exclamation by semicolon

00:03:03.530 --> 00:03:04.530
Okay.

00:03:04.530 --> 00:03:06.910
This means this is the data that's there.

00:03:06.910 --> 00:03:16.560
So it's got a course name, it's got the credits, got the duration.

00:03:16.560 --> 00:03:18.200
What's her name, Colorfellow?

00:03:18.200 --> 00:03:23.520
You don't need to type Mongo SH again because you're already in Mongo SH anyway.

00:03:23.520 --> 00:03:26.720
So you just need to go down and recreate that script.

00:03:26.720 --> 00:03:29.480
Don't have to worry about the user.

00:03:29.480 --> 00:03:33.280
Just go and just create the collection first.

00:03:33.280 --> 00:03:33.920
Just go up a bit.

00:03:33.920 --> 00:03:38.400
You probably need to create a collection first, which is students, and then run that script.

00:03:38.400 --> 00:03:42.400
So you're already in the database, so you don't have to worry.

00:03:42.400 --> 00:03:46.400
So just create that, yeah, and then you can run that script.

00:03:46.400 --> 00:03:48.400
Yeah, you can paste.

00:03:48.400 --> 00:03:53.400
Hi Kumbuland, do you need to complete the 2.4?

00:03:53.400 --> 00:03:57.400
2.4. Yeah, you can do it if you want.

00:03:57.400 --> 00:04:01.400
It's just creating a user. So you can do it, that's not a problem.

00:04:01.400 --> 00:04:02.400
Ah, okay.

00:04:02.400 --> 00:04:07.400
Yeah, we haven't activated authentication, so it's just like adding documents that you're doing.

00:04:07.400 --> 00:04:11.560
you're doing you won't really see the effect of the user because we haven't got into the point of

00:04:11.560 --> 00:04:25.220
authenticating okay you know after running that's what are we looking at it looks like matrix

00:04:26.420 --> 00:04:32.420
what is that uh just enlarge that and then let's go to the top so it will show you different

00:04:32.420 --> 00:04:39.780
information uh just uh just up a bit so any creation strings that have happened so any access

00:04:39.780 --> 00:04:49.140
patterns, any metadata. Some of those stuff is not really important unless you have to be

00:04:49.140 --> 00:04:55.300
troubleshooting. And this is when you're troubleshooting deep, deep stuff, right? So it says

00:04:55.300 --> 00:05:02.100
here it's wired tiger, which is the type of storage that came with MongoDB. And then it also

00:05:02.100 --> 00:05:07.300
shows things like your auto commit, your backups. Did you even do any backups? Was there any

00:05:07.300 --> 00:05:12.820
increment backups that were done uh you can see where it says backup total modified incremental

00:05:12.820 --> 00:05:18.180
blocks with compressed data because you didn't do any backup you didn't do any incremental backups

00:05:18.180 --> 00:05:24.900
then it will show a zero right so it's just information related to different things in essence

00:05:24.900 --> 00:05:31.460
right um your block managers how many blocks have been allocated how many blocks are free um

00:05:31.460 --> 00:05:37.280
you know things like that file allocation unit size which is four gig so it's just statistics about

00:05:37.300 --> 00:05:43.060
a whole lot of things in relation to the university database, right?

00:05:43.060 --> 00:05:48.960
And to whatever collection you'd have put to say, I want this, I want stats about this specific

00:05:48.960 --> 00:05:50.060
collection.

00:05:50.060 --> 00:05:57.220
I go down a bit, some transaction, did you do any rollbacks, you know, any robbacks

00:05:57.220 --> 00:06:02.680
in terms of stable history store keys that would have been swept in non-dry run node?

00:06:02.680 --> 00:06:07.280
So it's, you can use it while it's troubleshooting, wanting to see.

00:06:07.300 --> 00:06:13.800
probably what could be happening with the specific collection, right, in terms of is there any

00:06:13.800 --> 00:06:19.600
backups, for example, if there was backups when last was it done, how many backups were done,

00:06:19.940 --> 00:06:25.380
when it comes to transaction, right? How many transactions were done? How many stable keys were

00:06:25.380 --> 00:06:31.140
removed? How many stable keys were restored? You know, it's that type of stats. But this would be

00:06:31.140 --> 00:06:37.020
when you're now doing advanced MongoDB, because now you want to, besides the performance level,

00:06:37.020 --> 00:06:43.020
that you're looking at you've managed to index your fields and all that stuff now you want to

00:06:43.020 --> 00:06:46.860
look deeper into the collection why is it there's always a problem with this specific collection

00:06:46.860 --> 00:06:51.100
when we're collecting data let's go have a look at that that's when you can be able to use this

00:06:51.100 --> 00:06:56.380
sharded it's not shattered we're going to get to a point where it's shattered the size in

00:06:56.380 --> 00:07:02.940
terms of um what you call the size of the file and then the count how many are they i think

00:07:02.940 --> 00:07:06.940
if you remember we're adding 2 000 students um total indexes

00:07:07.020 --> 00:07:15.580
size, as we said, what indexing does is the one that you index, we are saying that's

00:07:15.580 --> 00:07:21.640
the frequently access data or frequently create data. It takes all that information and puts it

00:07:21.640 --> 00:07:27.180
on the side. It creates a separate file where you've got the indexes so that when you need

00:07:27.180 --> 00:07:32.140
to create that information that's got the index, it doesn't really need to go and look for

00:07:32.140 --> 00:07:36.940
that information in the whole documents, right? Because when there's no index,

00:07:37.020 --> 00:07:41.740
what the database does, what MongoDB does is it goes and scans the whole collection, right?

00:07:42.060 --> 00:07:49.020
But if you've got, let's say, ID number as your index, it will just go to the indexing,

00:07:49.020 --> 00:07:54.940
look for that specific ID number, and then pull out that information from that specific ID number.

00:07:54.940 --> 00:07:59.500
It's not going to need to go into the collection and scan the whole collection

00:07:59.500 --> 00:08:03.260
to actually look for that one specific ID number, if that makes sense.

00:08:03.260 --> 00:08:04.300
Happy with that?

00:08:04.300 --> 00:08:06.540
I think I'm done on my site.

00:08:07.020 --> 00:08:14.440
all right cool um it's 12 o'clock anyway so we can take our lunch break and then we'll continue at

00:08:14.440 --> 00:08:22.080
one o'clock for those that are done okay thank um when where is done after doing

00:08:22.080 --> 00:08:32.600
number yes number two up until you get to 2.4 you'll be done okay yeah so if you're done

00:08:32.600 --> 00:08:37.180
2.4 then, yeah, you can take your lunch, then we'll be back at one.

00:08:59.930 --> 00:09:04.590
Excessively, with regard to allow those particular developments,

00:09:04.770 --> 00:09:07.730
and we have taken the decision to abandon the bail application at the stage.

00:09:08.510 --> 00:09:11.510
We will not be proceeding with the bail application anymore,

00:09:11.570 --> 00:09:17.430
I'm not quite certain with regard to the investigations,

00:09:17.430 --> 00:09:19.790
we've got to this method of a far away,

00:09:20.590 --> 00:09:24.250
and we would like, if possible, if all investigations,

00:09:24.250 --> 00:09:30.750
concept of reading computer, that the disclosure be given to us for the difficult

00:09:30.750 --> 00:09:32.750
ourselves of our ocean.

00:09:32.750 --> 00:09:38.750
However, we have come to the realization that for us to pursue a bit of the state,

00:09:38.750 --> 00:09:45.250
whilst there's another method ending that other side, would honestly be a futile exercise

00:09:45.250 --> 00:09:50.750
for us to attend a big application at the stage version.

00:09:50.750 --> 00:09:51.750
That is...

00:09:56.390 --> 00:11:19.040
Oops, cool.

00:11:19.040 --> 00:11:22.040
And we must see it as a...

00:11:22.040 --> 00:11:30.660
So morning, I had...

00:11:30.660 --> 00:12:36.460
...students, because what the guys who are working at Chill Us Punch are doing

00:12:36.460 --> 00:12:39.990
is absolutely insane on the market.

00:12:39.990 --> 00:12:41.990
She's succeeding only because of his huge audience.

00:12:41.990 --> 00:12:44.990
But if you think that way to just check out my Natalie video,

00:12:44.990 --> 00:12:45.990
it's one of my latest ones.

00:12:45.990 --> 00:12:48.990
But you need to understand who your biggest fans are,

00:12:48.990 --> 00:12:50.990
who your core audience is, so that you can figure out.

00:12:50.990 --> 00:12:55.470
so that you can figure out what to sell to me actually understand that his followers the people

00:12:55.470 --> 00:13:01.310
that actually engaged with his content are loyal diamond fans that are to be honest yeah so he calls

00:13:01.310 --> 00:13:07.070
him chillers after his podcast he made something for the chillers which is why the brand naming

00:13:07.070 --> 00:13:16.220
before we get into the market so you already had the fan base but the product itself anyone could say it

00:13:16.220 --> 00:13:27.120
saturated because you're already competing with these ones because they're in the same for sponge so he understood

00:13:27.120 --> 00:13:30.060
his audience he knew i'm going mass market i'm not going to

00:13:30.080 --> 00:13:34.840
luxury, I'm not selling something too expensive. That's what Granger is for. But Chilla's

00:13:34.840 --> 00:13:39.720
Punch is going to be something that my fans can't hate. And honestly, from one of the people

00:13:39.720 --> 00:13:46.200
looking at the product, he has perfected everything about marketing. The Majority Code he has

00:13:46.200 --> 00:13:56.530
is his pot. Who he's interviewing is even when people cut out clips for the podcast, they post on

00:13:56.530 --> 00:14:06.180
his videos. So he has a ton of social media reach organically. And number two, even with people

00:14:06.180 --> 00:14:18.940
the influence with Chillas Punch. When you think of Oscar MBO, we know that he's sponsored by

00:14:18.960 --> 00:14:25.980
do say, a podcast with Chiller's Punch. That video has like 40,000 likes, meaning people

00:14:25.980 --> 00:14:30.480
are viewing, liking, and seeing one of their favorite artists with this product.

00:14:30.780 --> 00:14:35.360
Another major thing he's done is that he wasn't afraid to completely remove himself or not

00:14:35.360 --> 00:14:39.500
make himself the sense of attention for Chiller's Punch, unlike some other alcohol

00:14:39.500 --> 00:15:06.550
farm. It's not just MacG. There's new flavors dropping this way to succeed on its own.

00:15:06.550 --> 00:15:25.360
And it's across the world. Watch Big Brother puts Chilers Punch in the contestants. It

00:15:25.380 --> 00:15:29.560
It gives it reach, it gives it legs, where he himself doesn't have to be a part of it.

00:15:29.560 --> 00:15:36.480
You can just search Chilas Punch and you see people tasting it, tasting the different

00:15:36.480 --> 00:15:42.120
flavors, buying six packs cases, showing that it's something that people want to try,

00:15:42.540 --> 00:15:43.880
want to make content about.

00:15:44.040 --> 00:15:46.920
Even if Maggi is not paying them, they don't even know him personally.

00:15:47.100 --> 00:15:56.160
Just because of the popularity of Chiller's Punch, it's being omnipresent without centering

00:15:56.160 --> 00:15:56.900
it around here.

00:15:56.900 --> 00:16:01.620
So being able to remove himself from the center of the brand, but have people make content

00:16:01.620 --> 00:16:06.420
about the brand. Have this podcast in every single celebrity who comes on. If people are interested

00:16:06.420 --> 00:16:10.620
in the celebrity, we see the celebrity with chill as punch. Being able to make connections with

00:16:10.620 --> 00:16:15.160
big brother, it's in huge distribution deals with places like Picking Pay, all of these things

00:16:15.160 --> 00:16:20.340
that he has done to push his brand to the point where even if he stopped talking about,

00:16:20.620 --> 00:16:24.960
the sales would still come. Because when you think about it, who is some other's main

00:16:24.960 --> 00:16:32.650
influencer? Who is the founder of black label? You don't need to know them in huge numbers. And for

00:16:32.650 --> 00:16:37.650
There was something that was lodged just in 2023 to accomplish so much in two years.

00:16:37.650 --> 00:16:39.650
Clearly, MacGee, nobody's doing nozoy...

00:16:39.650 --> 00:16:41.650
...first things to do.

00:16:41.650 --> 00:16:43.650
...theircings to do.

00:16:43.650 --> 00:16:44.650
Nobody...

00:16:44.650 --> 00:22:13.180
...and we can't see this...

00:22:13.180 --> 00:22:24.910
...and we sit in law and we should in law...

00:22:24.910 --> 00:22:35.790
...an amazing entrepreneur that I bumped into Usul Mwengue from a township called

00:22:35.790 --> 00:22:37.990
D near Barberton in Pomerton in Bumman.

00:22:37.990 --> 00:22:42.560
...he thanked me for a video I made a couple of years ago saying,

00:22:42.560 --> 00:22:44.560
please look into flying.

00:22:44.560 --> 00:22:45.360
Because sometimes flying...

00:22:45.360 --> 00:22:48.060
can cost almost the same as catching a taxi of us.

00:22:48.720 --> 00:22:54.160
And just recently I realized that some of the cheapest flights from Johannesburg taking out about

00:22:54.160 --> 00:22:59.820
$470,000, $650, what do I need you do?

00:23:17.370 --> 00:23:23.570
These ladies, if you're only in this coming Valentine, there's one thing that you're not

00:23:23.570 --> 00:23:26.210
going to leave out on the things that you buy me in.

00:23:26.670 --> 00:23:28.910
Why you buy me a car, or do you buy me whatever?

00:23:31.160 --> 00:23:31.940
What you buy me?

00:23:33.060 --> 00:23:39.700
If you feel like, you know, I'm...

00:23:39.700 --> 00:23:44.930
responsible.

00:23:44.930 --> 00:23:50.430
First of all, my community to work is not very demure because tell me why I wake up so early

00:23:50.430 --> 00:23:52.930
the money and make me to get to work very late.

00:23:52.930 --> 00:24:03.640
Well, this is my biggest problem is that I have to take an Uber to the heart.

00:24:03.640 --> 00:25:01.970
When we say, date somebody who is kind, we mean somebody who knows how to manage their emotions

00:25:01.970 --> 00:25:08.970
and is not going to like snap it to or speak to you in an ill manner because they do not

00:25:08.970 --> 00:25:09.970
to manage their emotion.

00:25:09.970 --> 00:25:14.770
who's empathetic and has compassion and is able to put themselves in other

00:25:14.770 --> 00:25:21.970
people's shoes you mean someone who is honest my friend and I went to this

00:25:21.970 --> 00:25:25.330
other meeting then after the meeting I decided that to myself or something to eat

00:25:25.330 --> 00:25:39.180
with who might treat you almost hijacked of work I'm pointed at me so

00:25:39.180 --> 00:25:45.020
instinct take over the training comes to the fore so you were in the 30s and you were just

00:25:45.020 --> 00:25:54.430
not at work I was not a work I was just traveling all that I guess I went to toilet

00:25:54.430 --> 00:26:43.460
but it's one of those guys are we back thumbs up if you're back i can see austin is back uh faith

00:26:43.460 --> 00:26:59.100
colophila are you back okay let's give them probably five minutes are we all back yes okay faith

00:26:59.100 --> 00:27:06.700
is back color fella are you back okay cool um okay anyone with questions with what we did earlier on

00:27:07.820 --> 00:27:10.220
before we went for lunch okay take silence and

00:27:10.380 --> 00:27:14.720
There's no questions, no question, that's fine.

00:27:14.720 --> 00:27:19.720
So let's continue with some theory.

00:27:20.920 --> 00:27:23.480
So now we want to get into monitoring,

00:27:23.480 --> 00:27:24.800
we want to get into the few tools

00:27:24.800 --> 00:27:27.620
that you can be able to use to monitor our database,

00:27:27.620 --> 00:27:29.660
our MongoDB.

00:27:29.660 --> 00:27:31.860
So firstly, let's talk about Mongo stat,

00:27:31.860 --> 00:27:34.540
which is a command line tool

00:27:34.540 --> 00:27:37.620
where it sort of provides statistics

00:27:37.620 --> 00:27:39.880
about the MongoDB instance, right?

00:27:39.880 --> 00:27:46.240
It's basic usage is just MongoStat and you can be able to then add some options.

00:27:46.240 --> 00:27:49.400
So for example, you can add a remote host.

00:27:49.400 --> 00:27:51.280
You want to monitor a remote host.

00:27:51.280 --> 00:27:53.400
You can add a remote host.

00:27:53.400 --> 00:27:57.280
Be mindful that when you add a host, you need to add the specific port.

00:27:57.280 --> 00:27:59.560
And then you can set refreshal intervals.

00:27:59.560 --> 00:28:02.160
How often do you want the statistics to refresh?

00:28:02.160 --> 00:28:05.320
It could be five seconds, it would be 10 seconds, you know.

00:28:05.320 --> 00:28:09.860
And in the case of this example, it's connecting to a remote host and it's

00:28:09.880 --> 00:28:18.340
It's going to display five rows of statistics, and it's going to refresh every one,

00:28:18.560 --> 00:28:24.520
let me take the pen, every one second, but it's going to showcase five rows at a time.

00:28:24.960 --> 00:28:27.220
And then you can also customize your output, right?

00:28:27.220 --> 00:28:34.740
When you customize your output, if you put the dash-dash-discover, then you can be able to specify

00:28:34.740 --> 00:28:36.700
which fields you want to be able to do.

00:28:36.780 --> 00:28:39.860
But we're going to look at it and be able to see what is it that it's,

00:28:39.880 --> 00:28:44.620
shows us. But the key matrix is that you need to look at, the metrics that you need to look

00:28:44.620 --> 00:28:49.940
at when it comes to Mongo stats is your insert, because then it's your insert operations per

00:28:49.940 --> 00:28:55.160
second, your query operations per second, your updates operations per second, and your delete

00:28:55.160 --> 00:29:03.300
options per second. So this information in terms of your operations, right, you can be able to

00:29:03.300 --> 00:29:08.340
see if there's something that is delaying, right? Let's say it's an update. You can then be

00:29:08.340 --> 00:29:13.260
able to ask yourself why is it an update is delaying right or if it's just a normal query it's

00:29:13.260 --> 00:29:17.720
just a query that needs to pull information why is it delay is it probably it's going through

00:29:17.720 --> 00:29:25.480
a scan is it probably the query that's running doesn't really is not querying any field that's got

00:29:25.480 --> 00:29:32.100
an index to it right you can be able to see all that stuff you can be able to get a number of

00:29:32.100 --> 00:29:37.780
commands executed per second per second this is in the instance where you've got um

00:29:38.340 --> 00:30:08.320
an application that's running that's got high what you call this db quitting that's involved you can also see the percentage of dirty cash dirty in the cash which means there is information in the cash that is not really sort of used so you call that dirty cash the amount of percentage used in regards to cash and then the number of flashes to disk per second and then some network in and network out right all these metrics

00:30:08.340 --> 00:30:14.100
can be able to determine, so it can point you to a few pointers, right, of what is it

00:30:14.100 --> 00:30:19.360
that you need to look at. If it's a networking issue, then your network traffic in might not

00:30:19.360 --> 00:30:25.240
be making sense as compared to the network traffic out, for example, right? Percentage of cash

00:30:25.240 --> 00:30:30.660
that's being used if it's about to be full, which means probably it's going to be slower,

00:30:30.660 --> 00:30:36.160
you know, things like that. If your delete is taking forever to happen, why is it taking

00:30:36.160 --> 00:30:41.400
forever to happen. Is it because it's going through a whole scan or is it because the query

00:30:41.400 --> 00:30:48.020
is not sort of referencing data that's not index? So those are some of the things that you can

00:30:48.020 --> 00:30:54.840
look at. Or could it be an input or could it be a disk I.O. situation where probably the disc

00:30:54.840 --> 00:31:01.740
is failing. So now the I.O. is now bad. It's now very, very high because you also want an IW

00:31:01.740 --> 00:31:06.140
that's very low. The read and write should be very, very quick rather than taking for a

00:31:06.160 --> 00:31:14.760
So it can point you, this matrix can be able to point you to the different sort of directions that you can be able to look at.

00:31:14.860 --> 00:31:18.040
That's usually the word to use Mongo stats for, right?

00:31:18.400 --> 00:31:24.800
And then wireless on that, you know, there is memory, right, for caching data and indexes.

00:31:24.960 --> 00:31:28.100
And the key metrics to monitor there is the working set.

00:31:28.220 --> 00:31:33.800
So the working set is the portion of data and indexes actively used by the application, right?

00:31:33.800 --> 00:31:47.580
When you go to the memory usage, right, there's that part where it actually has the indexes and the data that's actively being used by the application.

00:31:47.880 --> 00:31:51.080
It's very, what you call, it needs to be ready, right?

00:31:51.160 --> 00:32:00.040
And then you've got the cash usage, right, which is percentage of memory used by the wired tiger cash.

00:32:00.040 --> 00:32:06.700
Wiretiger is more or less a storage type that is used by MongoDB.

00:32:06.700 --> 00:32:13.280
Usually when you install MongoDB it comes with wire tiger, but then in essence, when you

00:32:13.280 --> 00:32:17.480
see the percentage of memory used by that, you can be able to determine, okay, is there

00:32:17.480 --> 00:32:27.220
problems, is their blockage in regards to what you call this, in regards to what you call this,

00:32:27.220 --> 00:32:28.220
the usage, right?

00:32:28.220 --> 00:32:31.000
the percentage is it too high with the memory that's available.

00:32:31.380 --> 00:32:34.440
Now you need to look at is it that there's too much dirty cache

00:32:34.440 --> 00:32:38.700
or you need to increase the amount of memory available

00:32:38.700 --> 00:32:41.760
because probably is now failing to handle, right?

00:32:41.760 --> 00:32:46.280
You can also check memory usage by doing your DB server status

00:32:46.280 --> 00:32:50.020
and then look for the bytes, right?

00:32:50.160 --> 00:32:53.020
Currently in the cash and maximum bytes configured, right?

00:32:53.020 --> 00:33:03.880
If you configured 2,000 megabytes, right, and your cache is sitting at 1,900, then you need to worry.

00:33:04.140 --> 00:33:06.160
Then where is the dirty cache sitting?

00:33:06.280 --> 00:33:07.000
Is it sitting on?

00:33:07.240 --> 00:33:10.300
Out of that 1,900, is it 500 megabytes?

00:33:10.460 --> 00:33:13.960
You need to worry about a high level of dirty cash, right?

00:33:14.000 --> 00:33:16.420
You can also use MongoStat to monitor your cash.

00:33:16.420 --> 00:33:23.000
As I said on the previous slide, that the key metrics is that you be able to see.

00:33:23.020 --> 00:33:28.720
see things like your dirty cache, your used cache, so you can be able to use MongoStat

00:33:28.720 --> 00:33:32.280
to be able to see the dirty-induced fields, right?

00:33:32.660 --> 00:33:38.380
Then let's look at some I.O performance, which is your input output, which is your read-write,

00:33:38.540 --> 00:33:46.100
right? It's a very critical performance when it comes to MongoDB because MongoDB is meant

00:33:46.100 --> 00:33:52.380
for high read-write operations, right? So because this data is coming unstructured,

00:33:53.020 --> 00:33:59.320
are mostly applications that have unstructured data read and write a lot, right?

00:33:59.400 --> 00:34:01.780
Because it's very, very unstructured, right?

00:34:02.020 --> 00:34:08.700
So the key metrics is that you need to look at is disc latency, the time taken for any read or write operations, right?

00:34:08.820 --> 00:34:11.480
And then the input, output operations per second.

00:34:11.780 --> 00:34:15.060
So disc latency is, how long does it take to read?

00:34:15.180 --> 00:34:16.580
How long does it take to write?

00:34:16.580 --> 00:34:22.660
If it is taking long, then there might be an issue with the disk itself, right?

00:34:23.020 --> 00:34:27.820
that could be another issue. Number one, number two, it could be it's writing a whole lot of data, right?

00:34:27.820 --> 00:34:33.420
So it also these are metrics that sort of give you pointers to where to look at.

00:34:33.820 --> 00:34:40.300
Is our storage, right? Is our disk, the hardware part of it, right? Do we need to change disk and upgrade to SSDs?

00:34:40.420 --> 00:34:48.880
If they're SSDs, then what could be happening? Let's look at the out of, what do you call this, the disk in themselves, right?

00:34:48.880 --> 00:34:54.780
and how do you check I.O. performance, you can be able to run your DB status and then

00:34:54.780 --> 00:35:00.940
Wyatt Tiger.com concurrent transactions. So your concurrent transaction will be able to tell you

00:35:00.940 --> 00:35:06.700
if there's a delay in terms of the writing or the reading, right? So you look at your read

00:35:06.700 --> 00:35:12.240
and write ticket usage. That's a way that you can be able to look at. And then you've got IOS stats

00:35:12.240 --> 00:35:18.860
which you use to monitor your disk I.O. It can be used to track your disk activity.

00:35:18.880 --> 00:35:23.100
It is sure that the performance, how is it performing and whatnot.

00:35:24.800 --> 00:35:27.640
Any questions on the monitoring?

00:35:27.980 --> 00:35:31.660
We have a practical for some monitoring.

00:35:31.960 --> 00:35:33.080
So any questions on that?

00:35:33.380 --> 00:35:33.800
Okay, cool.

00:35:34.340 --> 00:35:37.260
Silen says, no questions.

00:35:37.460 --> 00:35:41.220
Now, let's talk about also monitoring with the web console, right?

00:35:41.220 --> 00:35:45.020
So MongoDB has two versions.

00:35:45.180 --> 00:35:47.920
There is the enterprise version, which is a paid one.

00:35:47.920 --> 00:35:50.600
and then there's the community one.

00:35:50.600 --> 00:35:54.600
Now the community one doesn't come with a web interface.

00:35:54.600 --> 00:36:01.360
So you have to look at open source web interfaces that are out there, right?

00:36:01.360 --> 00:36:06.840
But when it comes to the enterprise version of MongoDB, right?

00:36:06.840 --> 00:36:10.140
It comes with MongoDB ops manager, right?

00:36:10.140 --> 00:36:17.900
And MongoDB ops manager or whichever one that you'll be able to use, it comes with features like real-time

00:36:17.920 --> 00:36:23.360
monitor so you can be able to see metrics in terms of real time such as your operations your memory

00:36:23.360 --> 00:36:30.720
usage your network activity you can also set up alerts for critical metrics right your high

00:36:30.720 --> 00:36:36.800
cp usage your low memory and that it can also help in terms of analyzing query performance right

00:36:36.800 --> 00:36:42.400
you can be able to see uh the slow running queries you can identify them if they need to be

00:36:42.400 --> 00:36:47.840
improved if you need to do any indexing to be able to improve if there are any things like um

00:36:47.920 --> 00:36:50.720
any summing or any aggregation that needs to happen.

00:36:50.800 --> 00:36:51.880
How can you then improve?

00:36:52.240 --> 00:36:57.600
And then you can also be able to do your backup and restoration from the web console, right?

00:36:58.280 --> 00:37:02.360
The real-time monitoring, alerts and performance analysis,

00:37:03.000 --> 00:37:06.660
you can also be able to incorporate external tools, right?

00:37:06.660 --> 00:37:11.740
Like your Prometheus and Grafana, your Nogios, what else,

00:37:11.840 --> 00:37:13.740
your new relic off the top of my head.

00:37:14.580 --> 00:37:17.460
I think UpDynamics or Datadog actually does that.

00:37:17.920 --> 00:37:21.220
it's got that part where you can be able to install it.

00:37:21.260 --> 00:37:26.140
So those tools also can be also be incorporated to be part of monitoring,

00:37:26.420 --> 00:37:31.340
and you also have that web console that you can be able to take your real-time monitoring,

00:37:31.540 --> 00:37:35.240
your alerts, your performance analysis, and all that stuff.

00:37:36.580 --> 00:37:38.000
Any questions on monitoring?

00:37:38.500 --> 00:37:40.220
Let's talk about indexing, right?

00:37:40.220 --> 00:37:43.380
And what is in an index, right?

00:37:43.480 --> 00:37:47.900
It's basically a data structure that helps in improving the

00:37:47.920 --> 00:37:55.440
speed of data retrieval so what happens is when you create an index using let's say if a field let's say

00:37:55.440 --> 00:38:03.440
your ID right it takes that ID field and places it somewhere out of uh what you call this out of

00:38:03.440 --> 00:38:12.640
the whole set of data right and what it does is it references anything that actually that actually

00:38:12.640 --> 00:38:17.900
uh what you call this that actually is related to that field so if you've got let's say

00:38:17.920 --> 00:38:24.100
ID number for someone. You work in a bank and they index an ID number. It means it's going to be

00:38:24.100 --> 00:38:30.280
easy. It doesn't really need to go through the whole scan of the whole collection to be able to

00:38:30.280 --> 00:38:36.940
actually, what you call this, to get that ID number. It just goes into the indexes, which is

00:38:36.940 --> 00:38:46.220
a separate sort of file, right, where that data is placed and then it's easy to retrieve anything

00:38:46.220 --> 00:38:50.060
that's related to that specific index, right?

00:38:50.340 --> 00:38:53.100
So how does indexes work?

00:38:53.200 --> 00:38:57.700
So it uses a B3, so a balanced tree to store indexes.

00:38:57.760 --> 00:39:02.200
So you've got a mother index and then you've got child, right?

00:39:02.200 --> 00:39:06.220
So you've got the mother, which is the index field and then child, child being anything

00:39:06.220 --> 00:39:10.240
that you're going to be able to pull in relation to the mother, right?

00:39:10.620 --> 00:39:16.040
And it contains a value from the index field and a pointer to the corresponding document.

00:39:16.220 --> 00:39:45.720
right and then when a query is executed it uses the index to quickly locate the relevant documents so because you're using ID number right for kumblan the moment you punch in that ID number it quickly rushes and gets because already it has references that lead to that document as compared if you don't index the ID number then it means it needs to come through the whole collection to look for the ID number amongst all the documents that are in there right and

00:39:45.720 --> 00:39:48.060
And then there's types of indexes.

00:39:48.180 --> 00:39:50.260
So firstly, there's the single field index.

00:39:50.760 --> 00:39:52.120
You're going to talk about it.

00:39:52.460 --> 00:39:54.300
But basically, that's how you create it.

00:39:54.380 --> 00:39:56.160
So which means there's a single field in it.

00:39:56.560 --> 00:39:56.740
Right.

00:39:57.060 --> 00:40:01.680
And then there's the compound index where you can actually have what you got this.

00:40:02.680 --> 00:40:07.320
You can actually have many fields, right?

00:40:07.520 --> 00:40:13.640
Multiple foods being where you can be able to index that.

00:40:13.640 --> 00:40:18.040
And then at the same time, you can also create what you call a multi-key index.

00:40:18.140 --> 00:40:22.480
A multi-key index is there's nested documents or an array, right?

00:40:22.600 --> 00:40:28.720
For example, subjects, you can index a subject because there's, under it, there's a whole lot of subjects that are in it.

00:40:29.060 --> 00:40:34.100
I think it was Coloferlo that was trying to list the number of courses, if I'm not mistaken.

00:40:34.260 --> 00:40:42.640
So this can be an example where you index courses, right, and be able to, you know,

00:40:43.640 --> 00:40:48.760
sort of it will be easy for you to be able to actually reference the courses or it could be

00:40:48.760 --> 00:40:55.560
subjects right where you've got um you're studying IT and then the subjects below if you index

00:40:55.560 --> 00:41:00.760
subjects it means that you'll be able to index everything that's under it which is an array

00:41:00.760 --> 00:41:07.080
which is a list of subjects or a nested um documents where nested documents is where you've got

00:41:07.880 --> 00:41:12.440
sort of documents that speak to each other all right and then you've got your text text index

00:41:12.440 --> 00:41:17.080
Let's say you want, it supports search queries on string content.

00:41:17.080 --> 00:41:23.120
You've got the name, you want to index the name, which comes as a text, right?

00:41:23.200 --> 00:41:28.580
So it then becomes easy for you to be able to search your text.

00:41:28.740 --> 00:41:34.960
You also have geospatial indexes where it supports your geospatial crease or coordinates.

00:41:35.320 --> 00:41:41.720
These ones are used mainly by your Uber's and your boats, your e-healing platform,

00:41:41.720 --> 00:41:49.780
or anything that's delivery related, they store geospital coordinates, data, right?

00:41:50.860 --> 00:41:58.500
Data where you can be able to use or you can be able to index coordinates, right, to be

00:41:58.500 --> 00:42:01.780
able to use them maybe for delivery or for pickup or for whatever.

00:42:02.360 --> 00:42:04.560
Then you've got what you call hashed index, right?

00:42:06.000 --> 00:42:09.960
This hashed index is mainly used for sharding when you're doing sharding, right?

00:42:09.960 --> 00:42:19.080
so you hash the um you index the hash of the field right the contents of a field and it would be in a hushed format

00:42:19.080 --> 00:42:25.480
right that's when you especially when you're doing sharding it's very very good but we'll get to

00:42:25.480 --> 00:42:30.760
the point where we actually do the speak about the sharding and then be able to explain this

00:42:31.560 --> 00:42:38.760
hashed indexing and then you've got ttl index where automatically you remove documents for um

00:42:38.760 --> 00:42:46.380
after a specified time, right, the document should expire after 3,600 seconds or after so many

00:42:46.380 --> 00:42:51.680
years or whatever, right? But usually TTR index is where you don't really need to store the

00:42:51.680 --> 00:42:58.700
document for too long, right? And you don't want that manual part of you having to log into

00:42:58.700 --> 00:43:06.000
the database to actually do some manual work. Then you can be able to do your TTR index, right?

00:43:06.000 --> 00:43:13.620
how do you manage index so there's the creation of the index right so it's db dot the collection

00:43:13.620 --> 00:43:20.920
and then the index operation that you want to do right so in the example there you've got db

00:43:20.920 --> 00:43:27.760
dot students students being the collection and then you want to create an index of the name right

00:43:27.760 --> 00:43:35.180
of understudent so when you go into the collection student when you look at it at the table on the

00:43:35.180 --> 00:43:42.980
relational database side it's a table then what you call this you want to use name as an index right

00:43:42.980 --> 00:43:49.420
you can also be able to list index which is get indexes and then you can also be able to drop index right

00:43:49.420 --> 00:43:54.940
you can also be able to rebuild an index right let's say there's some complications that would have

00:43:54.940 --> 00:44:03.820
happened you had multi-key or you had confound now you have to break them and now you want to rebuild the whole

00:44:03.820 --> 00:44:12.700
collection right it's a matter of just running db dot the collection name and then dot re-index right now

00:44:12.700 --> 00:44:20.860
some tree structure so tree structure is used to store indexes as i say right um which is a balanced

00:44:20.860 --> 00:44:26.540
trees that allow efficient in session division and search operations right and each node in the

00:44:26.540 --> 00:44:35.100
B3 contains multiple keys right and pointers to child nodes right so your key is your

00:44:35.100 --> 00:44:41.020
index and then your node is the document that you need to reference to right so indexes are

00:44:41.020 --> 00:44:46.380
also stored in a separate data file within the DB path directory right so you can set that

00:44:46.380 --> 00:44:51.660
up you can actually where you want your indexes to be you can set that up right and and each

00:44:51.660 --> 00:44:56.520
index entry contains two things contains the index filled value right

00:44:56.540 --> 00:45:11.600
Let's say your indexing ID, right, and then a point to the corresponding document, which means to whatever document it is that it sort of the index value is connected to, right?

00:45:12.000 --> 00:45:17.880
Then there's index selectivity where it refers to how unique the values in the index field are.

00:45:18.040 --> 00:45:19.460
They are always unique, right?

00:45:19.460 --> 00:45:26.520
They are very, very highly selective, which means they are unique values, which obviously results in better query performance.

00:45:26.540 --> 00:45:32.940
and then there's the low selectivity which has got many duplicate values but what

00:45:32.940 --> 00:45:40.460
tries to do is it avoids mostly when it's indexing avoid low selectivity where you've got

00:45:40.460 --> 00:45:47.580
what you got those many duplicate values right don't use that rather use high

00:45:47.580 --> 00:45:52.540
selectivity where there's you use unique values right unique values could be your

00:45:52.540 --> 00:45:56.520
user ID for example right it's going to be unique or

00:45:56.540 --> 00:46:01.920
email it's meant to be unique there's no way that you find two people with the same email

00:46:01.920 --> 00:46:07.620
and then they receive mail differently I don't think there's any of that setup it might

00:46:07.620 --> 00:46:14.160
differ just one part you know and then there's also what you call index cardinality where

00:46:14.160 --> 00:46:19.380
it refers to the number of unique value in the indexed field right so high cardinality

00:46:19.380 --> 00:46:26.460
fields are very very good things like your email your ID number passport

00:46:26.540 --> 00:46:31.100
number because they are unique they are never the same you never find two people with the

00:46:31.100 --> 00:46:36.540
same email you never find two people with the same passport number one has to be fake if you find

00:46:36.540 --> 00:46:41.500
somebody two people with the same ID number one has to be fake so those are the high card

00:46:41.500 --> 00:46:50.300
high cardinal um what you call this uh candidates for indexing right law cardinal ones

00:46:50.300 --> 00:46:56.140
are your gender you've got a million male right and you don't want to be using that because if you're

00:46:56.140 --> 00:47:02.360
going to index your gender, then you won't benefit that much. It will still need to scroll

00:47:02.360 --> 00:47:08.380
through the whole, if there's 1,000 male, right, it needs to scroll through that whole 1,000

00:47:08.380 --> 00:47:14.460
may. And then indexes also consume size, right? They also consume, because remember,

00:47:15.140 --> 00:47:23.760
when you create an index, it creates a data, right, that it separates from the main DB, right?

00:47:23.760 --> 00:47:30.980
and when you then reference that index obviously it's pointing to date so indexes can actually consume

00:47:30.980 --> 00:47:37.680
additional storage because there is the issue of the size of the index filled in itself and then the

00:47:37.680 --> 00:47:44.400
number of documents in the collection what indexing is meant to do is it's meant to bring whatever

00:47:44.400 --> 00:47:51.360
data close by so that it doesn't have to go through a whole scan when it needs to find a document

00:47:51.360 --> 00:47:53.940
So you can imagine bringing that data close by it.

00:47:54.000 --> 00:47:58.880
So it creates that file layers, that index information, and all that stuff, right?

00:47:59.100 --> 00:48:01.220
Some best practices for indexing.

00:48:04.160 --> 00:48:06.680
Frequently create fields are very much important.

00:48:07.380 --> 00:48:08.100
That's number one.

00:48:08.960 --> 00:48:14.240
The ones that are frequently created is what you need to look at indexing, right?

00:48:14.460 --> 00:48:18.120
And also create compound indexing, right?

00:48:18.420 --> 00:48:22.040
For queries that need to filter on multiple fields, but also

00:48:22.040 --> 00:48:31.460
do it wisely don't just do it you can't just index a field because just because probably you feel

00:48:31.460 --> 00:48:38.420
like what you call this it will need in my multiple and whatnot but is it frequently

00:48:38.420 --> 00:48:44.000
accessed that's number one number two do you really need to index it because sometimes it's

00:48:44.000 --> 00:48:52.020
not wise it's going to impact performance when it comes to indexing compound indexes and

00:48:52.040 --> 00:48:56.300
there's a whole lot of documents that it needs to go through or a whole lot of fields that it needs to go through.

00:48:56.380 --> 00:48:57.880
So you need to be careful about that.

00:48:58.420 --> 00:49:00.520
The other thing is don't over index, right?

00:49:00.600 --> 00:49:04.760
Because over indexing slows down your right operations, right?

00:49:04.840 --> 00:49:07.340
And it also consumes storage, right?

00:49:07.660 --> 00:49:09.480
Then monitor your index, right?

00:49:09.480 --> 00:49:21.420
It's very, very much important to monitor index, whether you're going to run your index stats or you're going to be having a tool that is going to be doing the real-time monitoring.

00:49:22.040 --> 00:49:24.720
you need to be very, very careful of that.

00:49:24.840 --> 00:49:27.700
And then there's a query that is covered, you know.

00:49:27.940 --> 00:49:35.660
The query that's covered is, you are saying that this query is basically based on, it's optimized, right?

00:49:35.660 --> 00:49:43.720
And in essence, you can be able to, let's say, index it as a whole, create a compound index,

00:49:43.880 --> 00:49:47.020
but for the benefit of performance in essence.

00:49:47.260 --> 00:49:51.960
So you need to use covered queries where, in essence, you can be able to use.

00:49:52.040 --> 00:49:55.400
indexes in a very wise way.

00:49:57.680 --> 00:50:05.280
Now, single field index, where you've got a single field as an index in a collection, right?

00:50:05.440 --> 00:50:11.480
It helps speed up your queries where you need to filter or you need to sort, where you need

00:50:11.480 --> 00:50:17.180
to aggregate, and then how does it, obviously, it creates a B-3 structure from the index field

00:50:17.180 --> 00:50:21.020
and then points to the relevant corresponding document, right?

00:50:21.020 --> 00:50:27.040
An example there is when you create an index of the name in the collection students, right?

00:50:27.480 --> 00:50:32.580
One indicates ascending order, minus one indicates descending order, right?

00:50:32.980 --> 00:50:37.240
And then some use cases is when you need to filter or sort by a single field,

00:50:38.380 --> 00:50:45.080
finding what you got is, all students is a specific name or sorting students by age.

00:50:46.660 --> 00:50:47.180
Right?

00:50:47.180 --> 00:50:51.000
And then you also have compound index where it says it's a combination of,

00:50:51.020 --> 00:50:52.300
multiple fields in a collection.

00:50:52.900 --> 00:50:55.540
It helps when you do your filter sort and aggregate also.

00:50:56.140 --> 00:51:00.880
And the order of the fields in the index matter, right?

00:51:01.080 --> 00:51:06.060
Queries can use the index if they include a prefix of the indexed films, right?

00:51:06.780 --> 00:51:10.500
An example being an index on name and age, right?

00:51:10.500 --> 00:51:17.440
It can be used for queries on name or name and edge, but not just age, if that makes sense.

00:51:17.760 --> 00:51:20.200
So in this order, you've got name and age.

00:51:20.200 --> 00:51:50.180
so you can use a query to look using the name or using the name and the age right as your condition but you can't just use the age right and then use cases when you need to filter or sort by multiple fields obviously for example finding all students with a specific name and age range and then geospital which is more or less for maps mostly for

00:51:50.200 --> 00:51:54.200
used for your Uber's and whatnot.

00:51:54.200 --> 00:51:58.200
Supposed two types, which is the 2D for flat 2D coordinates,

00:51:58.200 --> 00:52:02.200
your latitude and longitude, and then you've got two-d sphere, right,

00:52:02.200 --> 00:52:04.200
for your spherical geometry, right?

00:52:04.200 --> 00:52:08.200
Your geo-jason objects and all that stuff.

00:52:08.200 --> 00:52:14.200
How it works, it uses, it utilizes specialized data structures,

00:52:14.200 --> 00:52:16.200
which is, for example, geishing,

00:52:16.200 --> 00:52:19.200
where it indexes the geospatial data,

00:52:19.200 --> 00:52:23.200
and then queries can find documents near a point, right,

00:52:23.200 --> 00:52:25.880
or an intersection line, right?

00:52:25.880 --> 00:52:27.740
And then an example is obviously creating

00:52:27.740 --> 00:52:31.100
a two-disphere index on a location field.

00:52:31.100 --> 00:52:36.960
For example, the DB dot places being,

00:52:36.960 --> 00:52:38.860
places being the collection and then create

00:52:38.860 --> 00:52:40.760
index on location two-dispheres,

00:52:40.760 --> 00:52:43.960
type to this fear, and then the use case is

00:52:43.960 --> 00:52:46.580
location-based queries, finding nearby restaurants,

00:52:46.580 --> 00:52:49.180
for example, or finding all

00:52:49.200 --> 00:52:52.160
places within a certain distance from a point.

00:52:52.160 --> 00:52:57.040
So when you do your Google search, these are some of the indexing that really happens.

00:52:57.040 --> 00:53:03.840
Some best practices, single field indexes use for queries that you need to filter or sort by

00:53:03.840 --> 00:53:10.800
a single field, right? Compound when you need to sort by multiple fields, just better when you

00:53:10.800 --> 00:53:16.080
use for location-based queries, and then avoid over-indexing.

00:53:16.080 --> 00:53:21.840
can be very difficult to manage right there is the part of it slowing down some operations

00:53:21.840 --> 00:53:27.760
there's the part of it consuming storage but also there's the part where it can if you're not

00:53:27.760 --> 00:53:35.440
very careful enough right um it consumes storage it will take bigger space right and then also

00:53:35.440 --> 00:53:44.800
monitor your your index usage right then there's something called equity profiler right

00:53:44.800 --> 00:53:52.560
a query profiler basically is used to be able to identify suboptimal queries and what are

00:53:52.560 --> 00:53:57.760
these suboptimal queries these are queries where they take long time to execute they consume

00:53:57.760 --> 00:54:04.560
access CPU memory or disk i.o they retain large amounts of data unnecessarily and do not use

00:54:04.560 --> 00:54:10.800
indexes effectively right and some common causes of this is where a query needs to do a full

00:54:10.800 --> 00:54:14.640
scan right it needs to go through a whole collection or whole database

00:54:14.800 --> 00:54:21.040
right but mainly a whole collection right weight quiz an entire collection instead of using

00:54:21.040 --> 00:54:28.080
indexes and then an example is where you have to create non-index field right and then inefficient

00:54:28.080 --> 00:54:35.200
index usage where you've got queries that use indexes but still perform poor due to low selectivity

00:54:35.200 --> 00:54:41.120
the type of field that you've chosen there's many duplicate values right it's number one incorrect

00:54:41.120 --> 00:54:44.780
index order in compound indexes right where you're starting with the

00:54:44.800 --> 00:54:50.480
age and then the name for example in the example that we had right now it's going to save through

00:54:50.480 --> 00:54:57.760
everybody that's got 20 years to look for a name um kumbulani on it right and yet if you do vice

00:54:57.760 --> 00:55:03.840
versa to look for kumblani that's index and then the age is 20 so it's it becomes easy you know

00:55:03.840 --> 00:55:09.120
it doesn't have to go through a whole lot and then large results says where you've got quiz that

00:55:09.120 --> 00:55:14.720
written a large number of documents right where then causes high network and memory usage

00:55:14.800 --> 00:55:20.840
That's also another common cause of suboptimal queries and then complex aggregation

00:55:20.840 --> 00:55:26.160
pipelines where you need to do a whole lot of summing and this and that and that, you know,

00:55:26.460 --> 00:55:35.760
when they are complex, usually they have what you call this, they need more power to be able to run that.

00:55:35.840 --> 00:55:44.540
So those are some of the sort of common causes of suboptimal, what you call those?

00:55:44.800 --> 00:55:54.360
sub-optimal queries right and then how to use the query profiler it's it's an inbuilt mongo db tool right

00:55:54.360 --> 00:56:00.560
so it helps you identify your slow inefficient queries collect detailed information about that

00:56:00.560 --> 00:56:06.720
your execution time your index usage the scan documents and all that stuff so you need to enable

00:56:06.720 --> 00:56:14.640
the profiler right and enabling the profiler it it sort of has three profiling levels zero it's

00:56:14.800 --> 00:56:21.920
of default one is log slow operations right which are threshold in milliseconds and then two

00:56:21.920 --> 00:56:28.960
which is log operation so logging all operations would help in terms of when you really need to

00:56:28.960 --> 00:56:36.000
troubleshoot but you can leave it to say log slow uh operations and you need to set a profiling

00:56:36.000 --> 00:56:43.920
level right so for example here you've got db set profiling level to one and anything slower than a

00:56:43.920 --> 00:56:51.360
100 milliseconds. So you can set to say our target's time for query execution is 100 milliseconds,

00:56:51.360 --> 00:56:57.920
right? Then you run that and it should be able to tell you which ones are the queries that are

00:56:57.920 --> 00:57:04.340
running slow at the end of the day. And then you can also be able to verify profiling level

00:57:04.340 --> 00:57:13.060
by doing the DB get profiling status and then after that you can then be able to sort of change

00:57:13.060 --> 00:57:20.000
anything that you want to change or make changes, right? The profile data, right, is stored in

00:57:20.000 --> 00:57:26.300
the system profile collection. So if you want to see anything to be good to go into the DB.System.com

00:57:26.300 --> 00:57:34.260
profile. Find, and then you can be able to sort, right, with the limit of 10, in essence.

00:57:34.260 --> 00:57:40.760
Some key fields in profiler data, operation, what is the operation type?

00:57:41.300 --> 00:57:42.240
What is the namespace?

00:57:42.340 --> 00:57:47.900
Usually, its name space is constituted by the database and the collection.

00:57:48.460 --> 00:57:51.140
There was a time that we did statistics, I think it was Colorfellow.

00:57:51.520 --> 00:57:56.680
If you looked at the bottom, very bottom, there were lines, a few lines that were not

00:57:56.680 --> 00:58:00.640
part of the brackets.

00:58:01.280 --> 00:58:04.240
You would find that there is somewhere where it says NS, and it's.

00:58:04.260 --> 00:58:08.320
It will have the database name and the collection on it, right?

00:58:08.720 --> 00:58:15.080
Then execution time in milliseconds, and then some plan summary, the query plan, you know,

00:58:16.000 --> 00:58:21.280
call scan for collection scan, I-X scan for index scan.

00:58:21.420 --> 00:58:28.180
It will show you that keys examined, number of index keys examined or docs examined, the number of docs examined,

00:58:28.180 --> 00:58:31.180
and then number of documents retain.

00:58:31.180 --> 00:58:35.000
So you need to be mindful of that.

00:58:35.560 --> 00:58:39.320
Any questions when it comes to these topics?

00:58:43.010 --> 00:58:44.550
Okay, there's no questions.

00:58:45.010 --> 00:58:53.690
I think we can go to our practical and then move over to the next one,

00:58:54.610 --> 00:58:56.870
which is early.

00:58:56.870 --> 00:58:57.970
Where is my machine?

00:58:57.970 --> 00:59:00.290
Okay, there it is

00:59:00.290 --> 00:59:06.360
where is my window now?

00:59:15.760 --> 00:59:15.980
Cool.

00:59:16.580 --> 00:59:18.040
So we've done

00:59:18.040 --> 00:59:20.940
one, two, three

00:59:20.940 --> 00:59:22.780
as I said, it's going to be optional

00:59:22.780 --> 00:59:25.860
and then what we need to look at

00:59:25.860 --> 00:59:28.740
is the security part.

00:59:28.740 --> 00:59:30.740
Now, to do a bit of explaining,

00:59:31.540 --> 00:59:34.500
right, please be mindful of this.

00:59:35.000 --> 00:59:37.260
So this part, you don't need to do it

00:59:37.260 --> 00:59:38.800
because it's setting up of the Mongo

00:59:38.800 --> 00:59:46.000
db from sketch you've done that already right and then you come to the creation of mongo s h you've

00:59:46.000 --> 00:59:51.920
created a user earlier on but be also be mindful that on number two there's a time that you

00:59:51.920 --> 00:59:59.520
actually deleted the user as part of it are we together i think there's a time that you created

00:59:59.520 --> 01:00:08.780
the user and then it was deleted as of um exercise number two right so if you

01:00:08.800 --> 01:00:13.760
had deleted then you need to recreate now there's this part that I want to

01:00:13.760 --> 01:00:21.760
explain right so you see it says edit ETC mongo d.com right so what you then do

01:00:21.760 --> 01:00:27.580
is you go to your terminal log out of the DB if you are locked into the DB right

01:00:27.580 --> 01:00:34.100
and then what you need to do whether you use VIM or you use nano it's up to you

01:00:34.100 --> 01:00:38.780
I use VIM so now you need to go to the location ETC and then

01:00:38.800 --> 01:00:48.640
mongo dot mongo d.com right if you go into it it's got different subcategories so for example the db

01:00:48.640 --> 01:00:53.520
part is sorted already right this is where you store your data if you are using a specific

01:00:53.520 --> 01:00:59.120
engine you then can be able to put it there and obviously some details to it then where to write

01:00:59.120 --> 01:01:05.120
the logging data right the destination is the file append is equal to true so it doesn't need to

01:01:05.120 --> 01:01:10.980
remove some stuff, just needs to add on top. And then the path to it, right, which is your MongoD.

01:01:10.980 --> 01:01:17.260
log, usually most applications have got that log file sitting in VA log, right? So they'll

01:01:17.260 --> 01:01:24.460
have VA log and then create a file, a directory that will have a specific file, right? And you

01:01:24.460 --> 01:01:29.680
also have your network interfaces, and then how the process runs, process management. And then when

01:01:29.680 --> 01:01:35.100
you come here, when it comes to security, for you to enable security, you need to come and

01:01:35.120 --> 01:01:45.040
then move that part and then go below one space not one tab one space right and i think it's

01:01:46.480 --> 01:02:00.640
security if i'm not mistaken um authorization sorry authorization and then equals to two right this is how

01:02:00.640 --> 01:02:06.380
it should be right and then you save your file and then you need to

01:02:06.400 --> 01:02:13.440
to restart mongo for that to take effect right you need to restart mongo for that to take effect

01:02:13.440 --> 01:02:25.840
or else it would not take effect so you then come and then um be able to then restart that right which is

01:02:25.840 --> 01:02:32.160
good sometimes if it fails to restart all you need to do is just to do status because sometimes

01:02:32.160 --> 01:02:38.160
it would be an issue within your oops it actually failed okay that's weird

01:02:38.160 --> 01:02:47.600
MongoDB server let's see failed control error during global initialization

01:02:47.600 --> 01:03:05.340
okay status restart MongoDB let me have a look again

01:03:05.340 --> 01:03:24.930
Mongo.D so security is it true or enabled I think it's enabled yeah it's enabled that's why

01:03:24.930 --> 01:03:37.090
enabled and then restart that and then status okay it's happy now so just be mindful of that now

01:03:37.090 --> 01:03:46.430
after you restart it which means now anything that you're going to need to do is um is

01:03:46.510 --> 01:03:52.350
it's got authorization so you need to log on so be mindful i didn't create the user i didn't even

01:03:52.990 --> 01:04:00.430
create any user but in essence when you then need to log on right it's a matter of just um

01:04:01.710 --> 01:04:06.990
you don't need because you've already created the user admin you probably don't need to do this whole

01:04:06.990 --> 01:04:16.350
process um it's if you just do um this right authentication database admin it would be able to

01:04:16.510 --> 01:04:22.350
to ask you for admin because that's the only user that you have. But in the case where you

01:04:22.350 --> 01:04:28.830
have different users already in the database admin, in the admin database, then you need to do this

01:04:28.830 --> 01:04:35.390
and be mindful of the password that you used earlier on to be able to create the user. Happiness,

01:04:37.820 --> 01:04:43.060
understood. Are we understood with that? Are you?

01:04:43.060 --> 01:04:43.860
Hi, Kumbolani.

01:04:43.860 --> 01:04:48.420
Hi. Sorry. Well, no one's answering.

01:04:49.780 --> 01:04:58.020
You know, I joined later, so I'm trying to catch up, but there is a recording, so it's okay.

01:04:58.820 --> 01:04:59.900
Yeah, I'll check it out again.

01:04:59.980 --> 01:05:02.420
It's just I'm struggling to connect to where you are now.

01:05:03.120 --> 01:05:03.560
Oh, is it?

01:05:04.480 --> 01:05:04.920
Yeah.

01:05:05.080 --> 01:05:06.400
I'm sharing a screen.

01:05:06.660 --> 01:05:08.720
I'm not sure if you'll be able to see that.

01:05:08.800 --> 01:05:09.860
Okay, I can see that.

01:05:09.940 --> 01:05:11.780
Oh, we're not going on this link, eh?

01:05:11.980 --> 01:05:13.720
Only the other one that we're working on.

01:05:14.420 --> 01:05:15.020
Which one?

01:05:15.120 --> 01:05:18.460
The link that there's one that I sent in the chat, right?

01:05:18.460 --> 01:05:24.880
it's for you to create your virtual machine like the one that I have on the screen and then

01:05:24.880 --> 01:05:31.260
what you call this that GitHub link I'm going to share also so that you can be able to go

01:05:31.260 --> 01:05:36.900
and do it and then be able to follow number one two three as you go yeah okay okay then

01:05:36.900 --> 01:05:45.020
thanks all right no problem I actually wanted to explain number so when it comes to

01:05:45.020 --> 01:05:48.440
secure deployment this part really works when

01:05:48.460 --> 01:05:51.700
you've got three different machines.

01:05:51.700 --> 01:05:52.940
You're not using local.

01:05:52.940 --> 01:05:57.220
So the part of the enabling of the SS is the binding to local.

01:05:57.220 --> 01:05:58.580
It's already done.

01:05:58.580 --> 01:06:02.100
But then the enabling of SSL or TLS,

01:06:02.100 --> 01:06:05.580
you don't really need to do it because it's just one machine that we're using.

01:06:05.580 --> 01:06:07.380
So it wouldn't be right.

01:06:07.380 --> 01:06:16.860
But the rest of the stuff, I think people can be able to do it.

01:06:16.860 --> 01:06:19.260
Just there when you were explaining,

01:06:19.260 --> 01:06:22.940
I think you got quiet because of you're going too fast.

01:06:22.940 --> 01:06:28.460
when you're explaining where to authorize it, are those steps included as part of this?

01:06:29.900 --> 01:06:30.860
Say that again?

01:06:31.980 --> 01:06:35.820
No, I'm saying the part where you're showing us now whereby you're including,

01:06:35.820 --> 01:06:41.260
as part of the situation, you're including authorize, is this part of the steps that we have here?

01:06:41.260 --> 01:06:44.620
Yes, it's part of the steps.

01:06:44.620 --> 01:06:50.380
Now, the question would be on number one, there was creation of a user, right?

01:06:50.380 --> 01:06:55.660
on number two there was a part where you create a user and deleted it now if you created the

01:06:55.660 --> 01:07:01.260
user and deleted it on either number one where you created the user or created the second user and

01:07:01.260 --> 01:07:07.020
you deleted it on number two then you still need to recreate the user here right so you do your

01:07:07.020 --> 01:07:13.180
mongo sage you create your user and then you enable your security within the mongodd.com

01:07:13.180 --> 01:07:19.740
file right and then restart your mongo db and then you'll be able to use this

01:07:20.380 --> 01:07:29.880
got it okay now got it okay got it so for sorry just one thing for number three days so you're

01:07:29.880 --> 01:07:35.620
not doing that the web console the the web console takes a bit of time to install that's one thing

01:07:35.620 --> 01:07:41.760
yeah I would rather you guys can do it at your spare time whether it's later on in the week or

01:07:41.760 --> 01:07:46.920
whatever because you still have access to this virtual machine I think for a few weeks if I'm not

01:07:46.920 --> 01:07:52.480
mistaken. If it's not a month or two months, I'm not mistaken, but you can always do it on your

01:07:52.480 --> 01:07:58.160
own, on your virtual machine. It takes a lot of time to set up. That's why I sort of left it on the

01:07:58.160 --> 01:08:02.700
side. Yeah, that's why I said number three, don't really do it because it takes a bit of time. That's

01:08:02.700 --> 01:08:09.020
number one. Number two, ops manager is easy to install, but it's enterprise, which means

01:08:09.020 --> 01:08:13.920
there is pain that's involved. Now, when you then go to the community edition and you want

01:08:13.920 --> 01:08:18.720
install the open source of it they are not easy to install that's why i'm saying it takes take some

01:08:18.720 --> 01:08:27.360
time on number four the only one that you need to skip is this part the networking part why i say

01:08:27.360 --> 01:08:34.880
networking or this part is because when you use tls and ssl authentication you need to use it amongst

01:08:34.880 --> 01:08:42.400
two uh nodes right mongo db nodes where you've got it's it's not one machine like this it's not on local

01:08:42.400 --> 01:08:48.420
host it's got different other machines available and you want to add that machine to the cluster

01:08:48.420 --> 01:08:54.260
that's when you can be able to use your TLS because then there's that secure communication

01:08:54.260 --> 01:08:59.600
between the nodes in the cluster that's why I'm saying you don't really need to do it because

01:08:59.600 --> 01:09:04.480
you won't be able to see the effect of it if that makes sense okay I know that makes sense

01:09:04.480 --> 01:09:10.720
yeah but the rest of the stuff you should be able to do it so if you do number four and then

01:09:10.720 --> 01:09:15.960
When you go to number five, it's creation of what you call this indexes.

01:09:17.160 --> 01:09:21.840
Geospatal, you might not be able to get any results because we are not doing any location-based,

01:09:22.340 --> 01:09:27.080
but it's to help for information purposes to know how it is done.

01:09:27.080 --> 01:09:35.040
And then you can then be able to look at the rest of the staff, sub-optimal queries, looking at that, profiling,

01:09:35.640 --> 01:09:40.140
analyzing the profile data and some advanced techniques in terms of,

01:09:40.720 --> 01:09:47.440
covered indexes running cover query uh and that should be all and then after you're done with

01:09:47.440 --> 01:09:53.840
number four and number five you can then look at exercise day one i'm just going to use the bathroom

01:09:53.840 --> 01:10:05.850
quickly i'll be back in a sec uh quick question guys are we supposed to install um we're supposed

01:10:05.850 --> 01:10:12.170
to set up uh mongo dpubuntu because i'm getting an area yes you're supposed to

01:10:12.170 --> 01:10:17.050
but did you exit the database first if you're still showing you

01:10:17.050 --> 01:10:23.770
the city database you must exit the database first oh that will explain there how

01:10:23.770 --> 01:10:30.890
it yeah just say exit and you just do that should be fine oh okay yeah because i was just

01:10:30.890 --> 01:10:58.410
getting some error okay exit anyone with a question or getting errors or breaking stuff

01:10:58.410 --> 01:11:00.810
Faith, you don't need to set up again, MongoDB.

01:11:01.610 --> 01:11:02.650
Don't worry about that.

01:11:04.170 --> 01:11:05.450
Because it's already set up.

01:11:07.050 --> 01:11:07.450
So you can...

01:11:07.450 --> 01:11:08.170
Okay, should I...

01:11:08.170 --> 01:11:10.570
Yeah, you can go from the end, from number two.

01:11:10.570 --> 01:11:12.410
So he's setting up doesn't need...

01:11:12.410 --> 01:11:13.610
You don't need to worry about that.

01:11:15.050 --> 01:11:17.050
Okay, so we can skip the first...

01:11:17.050 --> 01:11:19.130
The number one, yes, and then go to number two.

01:11:21.020 --> 01:11:22.780
Where you've got the authentication part here.

01:11:25.180 --> 01:11:25.580
Who is it?

01:11:27.100 --> 01:11:27.580
Asanda?

01:11:28.220 --> 01:11:29.660
Dylendai said, don't be disturbed.

01:11:29.660 --> 01:11:30.300
About what?

01:11:30.300 --> 01:11:31.260
Go and sleep.

01:11:33.180 --> 01:11:34.380
Go and sleep, your time is slow.

01:11:45.660 --> 01:11:53.160
I'm getting an error D-212.

01:11:54.900 --> 01:11:55.920
Let's have a look.

01:11:57.760 --> 01:11:59.120
But after the security, right?

01:12:00.200 --> 01:12:00.460
Yeah.

01:12:01.600 --> 01:12:03.260
Enter, let's see something.

01:12:03.560 --> 01:12:04.400
Let me see where it's true.

01:12:04.840 --> 01:12:05.500
You press enter.

01:12:05.500 --> 01:12:06.620
I almost like it's fine.

01:12:06.720 --> 01:12:07.580
I didn't get that error.

01:12:08.440 --> 01:12:11.020
So you're able to quit and write?

01:12:11.460 --> 01:12:12.540
Why did you?

01:12:12.680 --> 01:12:13.620
Please press enter.

01:12:15.020 --> 01:12:17.300
Wait, are we supposed to unhash the security there?

01:12:17.540 --> 01:12:17.900
Yes.

01:12:18.220 --> 01:12:20.220
Oh, okay.

01:12:20.220 --> 01:12:25.220
And then do escape, quit without saving.

01:12:25.220 --> 01:12:27.220
I want to see something quickly.

01:12:27.220 --> 01:12:29.220
That's you, Colophila.

01:12:29.220 --> 01:12:33.220
Use the overwrite, so use the cue and exclamation.

01:12:33.220 --> 01:12:35.220
They are not pseudo.

01:12:35.220 --> 01:12:36.220
Yeah, that's why.

01:12:36.220 --> 01:12:37.220
It should be good to go now.

01:12:37.220 --> 01:12:46.180
When I get to, after starting.

01:12:46.180 --> 01:12:48.180
Who is that now?

01:12:48.180 --> 01:12:50.180
It's cool fellow.

01:12:50.180 --> 01:12:51.180
Okay.

01:12:51.180 --> 01:12:52.180
Let's see.

01:12:52.180 --> 01:13:09.810
see. Okay, go let's see. You've authorized that, that's fine. Have you been running, have

01:13:09.810 --> 01:13:19.410
you been running Mongo SH as student? All this while. Okay, I did sue our menacea, yeah.

01:13:21.410 --> 01:13:28.290
Did you, and I restarted it, right? Just go up, just go up again. Uh-huh, and the status

01:13:28.290 --> 01:13:29.650
says everything is okay, correct?

01:13:30.530 --> 01:13:32.690
So just do a status.

01:13:33.530 --> 01:13:34.890
Okay, everything is fine.

01:13:35.050 --> 01:13:35.730
Control C.

01:13:36.030 --> 01:13:37.750
And then try and log in from here.

01:13:38.210 --> 01:13:38.610
Let's see.

01:13:39.550 --> 01:13:41.470
Mongo S.H minus U something, something.

01:13:41.770 --> 01:13:42.330
Then enter.

01:13:42.790 --> 01:13:45.070
Authentication failed.

01:13:45.850 --> 01:13:52.730
Okay, just remove minus U admin minus P, secure admin.

01:13:53.350 --> 01:13:54.710
The password and that.

01:13:54.910 --> 01:13:56.930
Just, yeah, remove that.

01:13:57.050 --> 01:13:57.910
Even the user, yeah.

01:13:58.070 --> 01:13:58.730
Remove the user.

01:13:59.490 --> 01:14:00.030
Enter.

01:14:00.490 --> 01:14:01.790
So there's probably something.

01:14:01.810 --> 01:14:02.450
with your password?

01:14:03.850 --> 01:14:05.090
I'm assuming so.

01:14:05.210 --> 01:14:06.090
Good. Okay.

01:14:06.450 --> 01:14:11.130
Yeah. So if you created a user from number one, I think the password is actually different.

01:14:11.830 --> 01:14:18.610
The other password should be, I think, admin 1, 2, 3, if I'm not mistaken, on number 1.

01:14:18.970 --> 01:14:23.410
So if that user was still there, then it would definitely won't be able to log in.

01:14:24.910 --> 01:14:31.730
But now, because you're not specifying the password, then it's just going direct and just looking for the

01:14:31.810 --> 01:14:32.810
admin user.

01:14:32.810 --> 01:14:42.120
Just a reminder, Lisa, we can skip the network straight and right?

01:14:42.120 --> 01:14:44.120
Yeah, you can skip the networking part.

01:14:44.120 --> 01:14:46.120
And then go on to number one, so on.

01:14:46.120 --> 01:14:48.120
Yeah, and continue.

01:14:48.120 --> 01:14:49.120
I'm sorry.

01:14:49.120 --> 01:14:53.120
So after skipping network, we go away, we went to four, we go to four, right?

01:14:53.120 --> 01:14:54.120
Yes, number four.

01:14:54.120 --> 01:15:00.120
Yeah, because I'm by number four, then I've run the first one and

01:15:00.120 --> 01:15:02.120
let me just go through it again here.

01:15:02.120 --> 01:15:04.120
I've run the first one here whereby, uh,

01:15:04.120 --> 01:15:07.120
by the terminal.

01:15:07.120 --> 01:15:08.120
Yes.

01:15:08.120 --> 01:15:10.120
Right, open.

01:15:10.120 --> 01:15:12.120
Okay, I've run this one.

01:15:12.120 --> 01:15:14.120
The first one, where is it?

01:15:14.120 --> 01:15:15.120
Yeah, this one.

01:15:15.120 --> 01:15:19.120
I think this is an output, so, but it has a set

01:15:19.120 --> 01:15:21.120
as the output there.

01:15:21.120 --> 01:15:24.120
Are we supposed to run that output that has an inset in it?

01:15:24.120 --> 01:15:29.400
Inset screen is a date that command date used.

01:15:29.400 --> 01:15:30.400
No.

01:15:30.400 --> 01:15:32.400
So log out of your database.

01:15:32.400 --> 01:15:33.400
Look out of your database.

01:15:33.400 --> 01:15:34.400
Exit, just do exit.

01:15:34.400 --> 01:15:35.400
just to exit?

01:15:35.400 --> 01:15:36.400
Yeah.

01:15:36.400 --> 01:15:37.400
No, I'm typing.

01:15:37.400 --> 01:15:38.400
It's not showing.

01:15:38.400 --> 01:15:39.400
Okay.

01:15:39.400 --> 01:15:41.400
So just read it sometime.

01:15:41.400 --> 01:15:42.400
Refresh it.

01:15:42.400 --> 01:15:43.400
Disconnecting.

01:15:43.400 --> 01:15:44.400
Okay.

01:15:44.400 --> 01:15:49.400
Refresh the page and then exit from there and then run it.

01:15:49.400 --> 01:15:59.400
So what you can also do is remove the, what you call this, just run Mongo stats and that's it.

01:15:59.400 --> 01:16:01.400
You don't need to point it anyway.

01:16:01.400 --> 01:16:03.400
So as a start, just run Mongo stats and that's it.

01:16:03.400 --> 01:16:04.400
Stats and that's it.

01:16:04.400 --> 01:16:05.400
Okay.

01:16:05.400 --> 01:16:06.400
Yeah.

01:16:06.400 --> 01:16:07.400
Okay.

01:16:07.400 --> 01:16:08.400
So let me try.

01:16:08.400 --> 01:16:10.400
Let me refresh the piece.

01:16:10.400 --> 01:16:12.400
All right, that's fine.

01:16:12.400 --> 01:16:16.400
Colophila, you're not supposed to run that Mongo stats when you're in the database.

01:16:16.400 --> 01:16:18.400
Please exit and then run it.

01:16:18.400 --> 01:16:20.400
What's her name again?

01:16:20.400 --> 01:16:24.400
Zandri, let me share the link.

01:16:24.400 --> 01:16:29.400
You don't really need to log into GitHub.

01:16:29.400 --> 01:16:37.480
Okay, thanks.

01:16:37.480 --> 01:16:38.480
Are you able to type?

01:16:38.480 --> 01:16:42.280
So are you able to tap on mine here because I'm trying again.

01:16:42.280 --> 01:16:43.280
I just reset it.

01:16:43.280 --> 01:16:44.920
It's not doing anything.

01:16:44.920 --> 01:16:47.520
Okay, just one second.

01:16:47.520 --> 01:16:51.330
I'll get to you just now.

01:16:51.330 --> 01:17:00.770
If, Zandra, if you can just copy that and then paste it into the web browser for the virtual machine.

01:17:00.770 --> 01:17:03.070
Then you should be good to go.

01:17:03.070 --> 01:17:07.650
And let's see, interactive.

01:17:07.650 --> 01:17:09.650
Oopsie, where did I go now?

01:17:09.650 --> 01:17:11.650
Okay, there we are.

01:17:11.650 --> 01:17:14.650
Interactive and...

01:17:14.650 --> 01:17:17.650
Oops, what's going on?

01:17:17.650 --> 01:17:21.250
You broke a machine, my friend.

01:17:21.250 --> 01:17:25.250
Oh, but you said you can break it, eh?

01:17:25.250 --> 01:17:26.250
Yeah, you can break it.

01:17:26.250 --> 01:17:27.250
So...

01:17:27.250 --> 01:17:29.250
You can always restart it.

01:17:29.250 --> 01:17:30.250
Is it?

01:17:30.250 --> 01:17:32.250
Yeah, we can restart it.

01:17:32.250 --> 01:17:35.250
Just one second before we restart it.

01:17:35.250 --> 01:17:41.710
Let's see.

01:17:41.710 --> 01:17:54.910
you and then so we can close this terminal basically because I also don't know

01:17:54.910 --> 01:18:13.150
why it's hanging so I was saying this right here okay so I was saying this right

01:18:13.630 --> 01:18:15.630
Where is that now?

01:18:15.630 --> 01:18:18.630
So I was saying mongo stack.

01:18:18.630 --> 01:18:23.070
Why?

01:18:23.070 --> 01:18:26.070
Mongo stent.

01:18:30.070 --> 01:18:40.860
Wait.

01:18:40.860 --> 01:18:42.860
Did you reboot this machine at some point?

01:18:42.860 --> 01:18:44.860
No.

01:18:44.860 --> 01:18:45.860
That's weird.

01:18:45.860 --> 01:18:54.860
When has it been running?

01:18:54.860 --> 01:18:56.860
Yeah, it's been from 12.

01:18:56.860 --> 01:18:58.860
Yeah, 12 or 8?

01:18:58.860 --> 01:18:59.860
Yeah.

01:18:59.860 --> 01:19:01.860
But also remember, I think this servers are.

01:19:01.860 --> 01:19:05.400
These servers are two hours ahead, if I'm not mistaken.

01:19:06.700 --> 01:19:08.700
I think they use the UK time.

01:19:10.040 --> 01:19:12.760
Yeah, but if that's key that news, then it's just started now, yeah.

01:19:13.580 --> 01:19:14.520
It's two hours.

01:19:14.720 --> 01:19:15.720
Which is very weird.

01:19:16.520 --> 01:19:17.240
Is this the password?

01:19:17.360 --> 01:19:18.280
Is that the right password?

01:19:19.440 --> 01:19:19.680
Yeah.

01:19:19.920 --> 01:19:20.520
Okay, cool.

01:19:21.220 --> 01:19:22.480
It's the correct password.

01:19:23.980 --> 01:19:25.400
So what was the issue there?

01:19:25.480 --> 01:19:26.580
Why was it like that?

01:19:26.860 --> 01:19:27.860
Why was it hanging?

01:19:28.120 --> 01:19:29.120
Honestly, I don't know.

01:19:30.620 --> 01:19:31.700
I don't know.

01:19:31.860 --> 01:19:35.360
I can't tell you anything because I didn't do any troubleshooting to it.

01:19:36.120 --> 01:19:48.240
But yeah, so you can see number of insets, queries, update, delete, get more commands, dirty, used, flashes, you know, and all that stuff.

01:19:48.540 --> 01:19:50.900
Network, incoming, network outgoing.

01:19:51.520 --> 01:19:55.560
There is constant, so you can't really say you would worry that much about it.

01:19:55.720 --> 01:19:55.860
Yeah.

01:19:56.540 --> 01:20:01.840
But that's basically how it will show or you can do this and then.

01:20:01.860 --> 01:20:04.860
five rows, one second each.

01:20:04.860 --> 01:20:08.320
Oops.

01:20:08.320 --> 01:20:10.320
I need to see the time.

01:20:10.320 --> 01:20:12.320
I need to set two rows.

01:20:12.320 --> 01:20:16.320
It's doing one second, two, four, six.

01:20:20.320 --> 01:20:26.370
So you can be, oopsie.

01:20:26.370 --> 01:20:30.370
So version config, path to a configuration file, host,

01:20:30.370 --> 01:20:33.370
any SSO, any authentication,

01:20:33.370 --> 01:20:34.370
KBOROS, URI,

01:20:34.370 --> 01:20:35.370
starts option.

01:20:35.370 --> 01:20:41.370
So you've got minus O, field to show, or custom that.

01:20:41.370 --> 01:20:47.370
Row count, discover, discover nodes and display stats for all, if there are any.

01:20:47.370 --> 01:20:50.370
Use HTTP instead of raw DB connection.

01:20:50.370 --> 01:20:53.370
All option now fields.

01:20:53.370 --> 01:20:56.370
Output to JSON, it must be interactive.

01:20:56.370 --> 01:21:01.370
So let's say, if we do dash dash all.

01:21:01.370 --> 01:21:04.370
Okay, no release the same thing.

01:21:04.370 --> 01:21:14.200
to check if they're

01:21:14.200 --> 01:21:17.380
you're moving a little too fast now

01:21:17.380 --> 01:21:24.200
if I was a story. Okay, I'm coming there.

01:21:24.980 --> 01:21:26.620
Okay, I'm coming.

01:21:27.620 --> 01:21:31.680
So if let's say there was

01:21:31.680 --> 01:21:35.680
many nodes, right? If it was a cluster, then it would

01:21:35.680 --> 01:21:39.220
show each and every cluster, information about each and every

01:21:39.220 --> 01:21:41.120
cluster, if that makes sense, right?

01:21:41.120 --> 01:21:44.500
So here, because it's just local host, it's just going to show us local host.

01:21:44.920 --> 01:21:55.520
But let's say if there was three other servers, then it would list all those and be able to tell the stats of each of them, if that makes sense.

01:21:57.120 --> 01:21:57.360
Yeah.

01:21:58.240 --> 01:22:00.640
Who are saying they are stuck somewhere?

01:22:01.840 --> 01:22:06.120
The Mongo stats, the creation was a failing.

01:22:06.880 --> 01:22:08.800
So I'm getting an authorization failed.

01:22:09.800 --> 01:22:10.120
Okay.

01:22:10.360 --> 01:22:10.800
All right.

01:22:11.120 --> 01:22:13.280
I see faith got it wrong

01:22:13.280 --> 01:22:16.260
I tried to follow what you were helping

01:22:16.260 --> 01:22:18.020
Austin with I'm still

01:22:18.020 --> 01:22:21.020
sued all right that's fine

01:22:21.020 --> 01:22:22.080
I didn't really start yet

01:22:22.080 --> 01:22:23.460
okay but what

01:22:23.460 --> 01:22:25.040
I tried removing the credentials

01:22:25.040 --> 01:22:27.560
okay just hold on

01:22:27.560 --> 01:22:29.580
what you can also do is because

01:22:29.580 --> 01:22:31.520
we're not sure of your credentials

01:22:31.520 --> 01:22:32.120
remember

01:22:32.120 --> 01:22:33.520
oh it's on

01:22:33.520 --> 01:22:35.600
it's on view only

01:22:35.600 --> 01:22:37.000
let me change you to interactive

01:22:37.000 --> 01:22:38.160
remember

01:22:38.160 --> 01:22:40.600
there was a time that I said

01:22:40.600 --> 01:22:50.920
just use admin, just, okay, where is my scroller, just do it like this, okay, cool.

01:22:53.040 --> 01:22:59.460
Because the password, right, we're not sure if you use admin 1 or you used secure admin,

01:22:59.760 --> 01:23:07.040
we need to check that for the purpose of continue, okay, why is it failing now?

01:23:07.040 --> 01:23:29.690
mongo starts that authentication failed okay let me do this um i'm gonna switch off authentication first let me just go back