WEBVTT
Faith, please log on again into the database.
So you need to do Mongo SH first.
Then you can run that stuff.
So Mongo SH and then you can rerun the stuff, Mongo SH.
Yep.
So you can rerun whatever you want to run.
Hi Kunkulani, after that delete, do I need to?
Yes, continue.
I had Austin saying that we need to copy something from the top again.
No, no, no.
When you drop the database.
So the next one, number two, the last command.
Yeah, it's the DB.
When you drop the database.
You go to the first one.
Then you go to 4.0.
Then you copy that and paste it again.
So yeah.
Yeah.
So for you, Faith, you still can be able to do 2.1 up until the dropping of the database.
After the dropping of the database, then you go back to what you call this.
You go back to number one, 4.1.
Then you'll be able to read the data.
Just a quick question for me.
Yes.
Is cause a collection?
So if I was to want to sort or find all the subjects in a course, will it be db.course.find?
So if you log into your database and show collections, was it made part of the collections?
So what you can do is just go to your terminal.
Yes.
What were you asking, Kunkulani?
Okay.
Sorry.
I didn't realize I'm on mute.
Yeah.
You were asking.
You can continue.
I was asking if cause was a collection.
Let's say I wanted to list all the courses.
Will it be db.course.find and then dot sort?
Not.
I don't think cause is a collection.
But what you can do is while you're still in the university, just do show collections
and then be able to see if it is actually a collection.
It would actually be a data that's an array that's in part of a document, right?
So there's courses, there's students, right?
So now when you want to find a specific course, you say db.course, which is the
collection name, and then find whatever it is course that you want.
I'm trying to list to see what courses are available.
Okay.
So just do db.course.find and then your, what you call this, your brackets.
So just do your brackets and then exclamation.
Yeah.
Oh, sorry.
Sorry.
Not exclamation by semicolon.
Okay.
So this means this is the data that's there.
So it's got a course name.
It's got the credits, got the duration.
What's her name?
Color fellow.
You don't need to type MongoSH again because you are already in MongoSH anyway.
So you just need to go down and recreate that script.
Don't have to worry about the user.
Just go and just create the collection first.
Just go up a bit.
You probably need to create a collection first, which is students and then run that script.
So you're already in the, in the database.
So you don't have to worry.
So just create that.
Yeah.
And then you can run the script.
Yeah.
Yeah.
You can paste.
Hi, do I need to complete the 2.4?
2.4.
Yeah.
You can do it if you want.
It's just creating a user so you can do it.
That's not a problem.
Okay.
Yeah.
We haven't activated authentication.
So it's just like editing documents that you're doing.
You won't really see the effect of the user because we haven't gotten to the point of
authenticating.
After running the stats, what are we looking at?
It just looks like metrics.
What is that?
Just enlarge that.
And then let's go to the top.
So it will show you different information.
Just, just up a bit.
So any creation strings that have happened, so any access patterns, any metadata.
Some of this stuff is not really important unless you have to be troubleshooting.
And this is when you're troubleshooting deep, deep stuff.
Right.
So it's, it says here it's wired, the wired tiger, which is the type of storage that
came with the MongoDB.
And then it also shows things like your auto commit, your backups.
Did you even do any backups?
Was there any incremental backups that were done?
You can see where it says backup, total modified incremental blocks with
compressed data.
Because you didn't do any backup.
You didn't do any incremental backups.
Then it will show zero.
Right.
So it's just information related to different things in essence.
Right.
Your block managers, how many blocks have been allocated?
How many blocks are free?
You know, things like that.
File allocation unit size, which is four gig.
So it's just statistics about a whole lot of things in relation to the
university database.
Right.
And to whatever collection you have put to say, I want this, I want stats about
this specific collection.
I'll go down a bit.
Some transaction.
Did you do any rollbacks, you know, any rollbacks in terms of stable
history store keys that would have been swept in non-dry RAM node.
So it's, you can use it while it's troubleshooting, wanting to see
probably what could be happening with the specific collection.
Right.
In terms of is there any backups, for example, if there was backups when
last was it done?
How many backups were done when it comes to transaction, right?
How many transactions were done?
How many stable keys were removed?
How many stable keys were restored?
You know, it's that type of stats, but this would be when you're now
doing advanced MongoDB because now you want to, besides the
performance level that you're looking at, you've managed to index
your fields and all that stuff.
Now you want to look deeper into the collection.
Why is it there's always a problem with this specific collection when
you're collecting data.
Let's go have a look at that.
That's when you can be able to use this.
Sharded.
It's not sharded.
We're going to get to a point where it's sharded.
The size in terms of what you call the size of the file and then
the count, how many are they?
I think if you remember, we're adding 2,000 students.
Total index size.
As we said, index, what indexing does is the one that you index,
we are saying that's the frequently accessed data or frequently
created data.
It takes all that information and puts it on the side.
It creates a separate file where you've got the indexes so that
when you need to create that information, that's got the index.
It doesn't really need to go and look for that information in the
whole documents, right?
Because when there's no index, what the database does, what
MongoDB does is it goes and scans the whole collection, right?
But if you've got, let's say, ID number as your index, it will just
go to the indexing, look for that specific ID number, and then
pull out that information from that specific ID number.
It's not going to need to go into the collection and scan the
whole collection to actually look for that one specific ID number,
if that makes sense.
Happy with that?
I think I'm done on my side.
All right, cool.
It's 12 o'clock anyway, so we can take our lunch break, and then
we'll continue at 1 o'clock for those that are done.
Thank you.
Where is done?
After doing number two?
Yes, number two up until you get to 2.4.
You'll be done.
Yeah.
All right.
So if you're done with 2.4, then yeah, you can take your
lunch, then we'll be back at 1.
Thank you.
We will not be proceeding with the application anymore.
I'm not quite certain we took up to the investigations.
We took up to this matter, and we would like, if possible,
if all investigations have already been completed, that
disclosure be given to us for the defense because of our
situation.
However, we have come to the realization that for us to
pursue the application at this stage, while there's another
meta painting on the other side, would honestly be a
futile exercise for us to attend the application at this
stage.
That is
That is
I'm not.
Yeah, you're not.
Oops.
Who is it?
And we must see it as a
f***er.
I don't know, I don't know, I don't know.
Hey lovely souls, spend the rest of my day with me.
I had such a slow morning, I had no power, no energy to do anything.
But, by the grace of the Lord, what happened then?
F***er.
F***er.
Who your core audience is, such you can figure out what to sell to them.
Makes you understand that his followers, the people that actually engage in this content, are loyal, die-hard fans that are, to be honest, yeah.
So he calls them chillers after his podcast.
He made something for the chillers, which is why the brand named me.
And the choice of the product is honestly incredible.
Before we get into the marketing.
So you already had the fan base, but the product itself, anyone can say it's saturated,
because you're already competing with these ones, because they have the same price cap.
And maybe even Black Label, but I don't think someone who drinks Black Label would care for Chilla's Punch.
So he understood his audience.
He knew I'm going mass market, I'm not going luxury, I'm not selling something too expensive.
That's what Granger's for.
But Chilla's Punch is going to be something that my fans can hate.
And honestly, from what I've seen on social media, and the way he's structuring the product, he has perfected everything about marketing.
The major secret he has is his podcast.
Chilla's Punch is there on every single table, no matter who he's interviewing.
And that helps him because even when people cut out clips for the podcast, they post them on their stories, they share them with their friends.
Chilla's Punch is always in those videos.
So he has a ton of social media reach organically.
And number two, even with people who aren't directly affiliated with Chilla's Punch, meaning he doesn't have to pay them to be influencers.
There's tons of content floating around of them with Chilla's Punch.
When you think of Oscar MBO, we know that he's sponsored by Juicy.
But here's a video of him on his podcast with Chilla's Punch.
That video has like 40,000 likes, meaning people are viewing, liking, and seeing one of their favorite artists with this product.
Another major thing he's done is that he wasn't afraid to completely remove himself or not make himself the center of attention for Chilla's Punch, unlike some other alcohol fathers.
When you look at Chilla's Punch's Instagram page, it's not just MacG.
There's new flavors dropping, there's people making fun, and I give them the activation.
Actual advertisements that you see on TV, he has an entire creative team that's working on this thing, meaning it's not just, oh, I'm MacG so I'm enough to sell this thing.
He understands where to succeed even beyond him.
I need to not be the face, but allow it to run on its own.
And it's clearly spreading like crazy.
Millions of people across the world watch Big Brother.
Him partnering up with Big Brother puts Chilla's Punch in front of people who never watch the podcast, never even see MacG, don't know who he is.
But because they follow Big Brother and they see the contestants enjoying Chilla's Punch, it gives it reach, it gives it legs, where he himself doesn't have to be a part of it.
You yourself, right now, you can just search Chilla's Punch and you'll see people making their own content, tasting it, tasting the different flavors, buying six-packs cases, showing that it's something that people want to try, want to make content about.
Even if MacG's not paying them, they don't even know him personally, just because of the popularity of the drink itself.
To summarize everything MacG has done for Chilla's Punch, it's being omnipresent without centering it around him.
So being able to remove himself from the center of the brand, but have people make content about the brand.
Have this podcast and every single celebrity who comes on, if people are interested in the celebrity, we see the celebrity with Chilla's Punch.
Being able to make connections with Big Brother, getting huge distribution deals with places like Pick and Pay, all of these things that he has done to push his brand to the point where even if he stopped talking about it, the sales would still account.
Because when you think about it, who is Samara's main influence? Who is the founder of Black Label?
You don't need to know the people behind it for it to sell in huge numbers.
And for something that was launched just in 2023 to accomplish so much in two years, clearly MacG nobody's doing.
First things to do.
And the patients wouldn't have been so surprised.
I don't know those people.
So don't come here and waste your time and space to push your own business.
Your own business is worth it.
There are thousands of years for financial interest.
I'm not saying it's a joke.
You can make the most of my work.
I would always say that if you're a celebrity, you're not in my business.
Don't come here and waste your time.
I'm not in my business.
I'm not in my business.
We are the ones who are in my business.
I'm not in my business.
My business is that because I'm in my business.
Every single one of you people are in my business.
And I can't help you.
Never mind the people who are in my business.
I'm not in my business.
I'm not in my business.
People who are taking care of the kids.
They're making a fool out of themselves
and they're all in their own business.
So don't do this.
I'm not in my business.
The men are not going to work here.
Nobody's going to get into your business.
Everybody is crying.
Kids are screaming.
Okay, bro.
And in.
So there's no point.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Now, it's gone is enforcing stricter regulation.
Okay.
Okay.
Okay.
Okay.
Okay.
Hundreds of people.
Okay.
Okay.
And, you know, we got here today at seven and we sit in line and we'll start with you.
Here we go.
Those are the hues.
I'd like to give a shout out to an amazing entrepreneur that I found in Jusloongway
One of the things he did is he thanked me for a video I made a couple of years ago saying
please look into flying because sometimes flying can cost almost the same as catching a taxi or bus.
And just recently I realized that some of the cheapest flights from Johannesburg to German or the other way,
you're looking at about 470 rand minimum, 570, 650 rand.
What do I need to do?
These ladies, if you don't mean this in a funny way, these kind of people inside,
there's one thing that you're not going to leave out on the things that you're buying in.
Will I buy my car? Will I buy my whatever?
This must be powerful to buy me.
If you feel like you know me, help me.
Let's be financially responsible.
Good bye, welcome to a day in my life of an anti-compliance auditor working from the office petition.
First of all, my commute to work is not very demure because tell me why I wake up so early in the morning
and come here for me to get to work very late.
Well, this is because I stay very far from my office,
but this is not a big deal because I only go to the office once a week.
My biggest problem is that I have to take an Uber to the train station and the traffic, oh my god.
Yeah, my office and my needs are so busy that I couldn't make it.
When we say date somebody who is kind,
we mean somebody who knows how to manage their emotions and is not going to snap at you or speak to you in an ill manner
because they do not manage their emotions.
We mean someone who is empathetic and has compassion and is able to put themselves in other people's shoes.
We mean someone who is honest.
My friend and I went to this other meeting.
Then after the meeting, I decided that I must have something to eat,
which is what my treat to get.
I think we are on a tight budget.
One was almost hijacked of work.
You know, the gun pointed at me.
So instinct take over.
The training comes to the fore.
So you were in service.
I was not at work.
I was not at work.
I was just traveling around.
How did that end?
It was a bad day at work.
No, it's one of those things.
It's one of those things.
Hello guys, are we back?
Are we all back?
Thumbs up if you're back.
I can see Austin is back.
Faith, Caula, Phil, are you back?
Okay, let's give them probably five minutes.
Are we all back?
Yes.
Okay, faith is back.
Colorful.
Are you back?
Okay, cool.
Okay.
Anyone with questions with what we did earlier on?
Before we went for lunch.
Okay, take silence as no questions.
No question.
That's fine.
So let's continue with some theory.
So now I want to get into monitoring.
We want to get into the few tools that you can be able to use to
monitor our database or mongoDB.
So firstly, let's talk about mongo stats, which is a command line
to wait sort of provides statistics about the mongoDB instance, right?
It's basic usage is just mongo stats and you can be able to then
add some options.
So for example, you can add a remote host.
You want to monitor remote host.
You can add a remote host.
Be mindful that when you add a host, you need to add the specific
part and then you can set the threshold intervals.
How often do you want the statistics to refresh?
It could be five seconds.
It will be 10 seconds, you know, and in the case of this
example, it's connecting to a remote host and it's going to
display five rows of statistics and it's going to refresh every
every one.
Let me take the pen every one second, but it's going to
showcase five rows at a time and then you can also customize
your output, right?
When you customize the output, if you put the dash, dash
discover, then you can be able to specify which foods you
want to be able to do, but we're going to look at it and be
able to see what is it that it shows us.
But the key metrics is that you need to look at the metrics
that you need to look at when it comes to mongo stats is
your insert because then it's your insert operations per
second, your query operations per second, your updates
operations per second and your delete options per second.
So this information in terms of your your operations, right?
You can be able to see if there is something that is
delaying, right?
Let's say it's an update.
You can then be able to ask yourself why is it an update
is delaying, right?
Or if it's just a normal query, it's just a query that
needs to pull information.
Why is it delay?
Is it probably it's going through a scan?
Is it probably the query that's running doesn't really
is not querying any field that's got an index to it,
right?
You can be able to see all that stuff.
You can be able to get a number of commands executed
per seconds per second.
This is in the instance where you've got an application
that's running that's got high.
What you call this DB querying 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
per second and then some network in and network out,
right?
All those metrics can be able to determine so it can
point you to a few pointers right of what is it that
you need to look at if it's a networking issue,
then your network traffic in might not be making
sense as compared to the network traffic out for
example, right?
Percentage of cash that's being used if it's about
to be full, which means probably it's going to be
slower, you know things like that.
If your delete is taking forever to happen, why is
it it's taking forever to happen?
Is it because it's going through a whole scan or is
it because the query is not sort of referencing
data that's not indexed?
So those are some of the things that you can
look at or could it be an input or could it be
a disk IO situation where probably the disk is
failing.
So now the IO is now bad.
It's now very very high because you also want an
IO that's very low the read and write should be
very very quick rather than taking forever.
So it can point to this metrics can be able to
point you to the different sort of directions
that you can be able to look at.
That's usually the what you use Mongo stats for
right and then a wireless on that, you know,
these memory right for caching data and indexes
and the key metrics to monitor there is the
working set.
So the working set is the portion of data and
indexes actively used by the application right
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.
It's very what you got the sickness to be ready
right?
And then you've got the cash you should cash
catch you say, right, which is spent percentage
of memory used by the wire.
Tiger cash wire tag is more or less a storage
type that is used by MongoDB.
Usually when you install MongoDB it comes
with wire tiger.
But then in essence when you see the percentage
of memory used by that you can be able to
determine.
Okay, is there problems there blockage in
regards to what you call this in regards to
what you call this the usage right the
percentage is it too high with the memory
that's available now you need to look at is
it that there's too much dirty cash or you
need to increase the amount of memory
available because probably is now failing to
handle right.
You can also check memory usage by doing
your DB server status and then look for
the bytes right currently indication maximum
bytes configured right if you configured
2000 megabytes right and your cash is sitting
at 1900 then you need to why then where is
the dedication sitting is it sitting on out
of that 1900 is it 500 megabytes you need
to worry about a high level of dirty cash
right.
You can also use mongo stats to monitor
your cash as I said on the previous slide
that you the key metrics is that you'll be
able to see things like your daddy cash
your used cash so you can be able to use
mongo stats to be able to see the dirty
and used fields right then let's look at
some IO performance in which is your
input output which is your right read right
right.
It's a very critical performance when it
comes to mongo DB because mongo DB is
meant for high read write operations
right so because this data is coming on
manufactured are mostly applications
that have unstructured data right read
and write a lot right because it's very
very unstructured right.
So the key metrics is that you need to
look at is disc latency the time taken
for any read or write operations right
and then the input output operations
per second.
So disc latency is how long does it
take to read how long does it take to
write if it is taking long then there
might be an issue with the disc itself
right.
That could be another issue number one
number two it could be writing a whole
lot of data right.
So it also these are metrics is that
sort of give you pointers toward where
to look at is our storage right is
our disk the hardware part of it
right.
Do we need to change disk and upgrade
to SSDs if they're SSDs then what
could be happening.
Let's look at the out of how much
brothers the disk is that the disk in
themselves right.
And how do you check IO performance
you can be able to run your DB status
and then Wyatt Tiger dot concurrent
transactions.
So your concurrent transaction will
be able to tell you if there's a
delay in terms of the writing or
the reading right.
So you look at your read and write
ticket usage.
That's a way that you can be able
to look at and then you've got
IO stats which you use to monitor
your disk IO right.
It can be used to track your disk
activities show that the performance
how is it performing and whatnot.
Any questions on the monitoring we
we have a practical for some
monitoring.
So any questions on that okay cool
silence is no questions.
Now let's talk about also monitoring
with the web console right.
So MongoDB has two versions there
is the enterprise version which is
the paid one and then there's
the community one.
Now the community one doesn't come
with a web interface.
So you have to look at open source
web interfaces that are out there
right.
But when it comes to the
enterprise version of MongoDB
right.
It comes with MongoDB Ops Manager
right.
And on the MongoDB Ops Manager
or whichever one that you be able
to use it comes with features like
real-time monitoring.
So you can be able to see metrics
in terms of real-time such as your
operations your memory usage your
network activity.
You can also set up alerts for
critical metric metrics right.
Your the high CPU usage your low
memory and that it can also help
in terms of analyzing query
performance right.
You can be able to see the
slow running queries.
You can identify them if they need
to be improved you need to do
any indexing to be able to
improve if there are any things
like any summing or any aggregation
that needs to happen.
How can you then improve and then
you can also be able to do your
backup and restoration from the
web console right.
The real-time monitoring alerts
and performance analysis.
You can also be able to incorporate
external tools right.
Like your Prometheus and Grafana
your Nagios what else your new
Lake of the top of my head.
I think up dynamics or data dog
actually does that it's got that
part where you can be able to
install it.
So those tools also can be also
be incorporated to be part of
monitoring and you also have
that web console that you can
be able to take your real-time
monitoring your alerts your
performance analysis and all
that stuff.
Any questions on monitoring.
Let's talk about indexing right
and what is in an index right?
It's basically a data structure
that helps in improving the
speed of data retrieval.
So what happens is when you
create an index using let's
say if a field let's say your
ID right.
It takes that ID food and
places it somewhere out of what
you call this out of the
whole set of data right and
what it does is it references
anything that actually that
actually what you call this that
actually is related to that
field.
So if you've got let's say ID
number for someone you work
in a bank and they index an
ID number it means it's going
to be easy doesn't really need
to go through the whole scan
of the whole collection to be
able to actually what you call
this to get that ID number it
just goes into the indexes
which is a separate sort of
file right where that data is
placed and then it's easy to
retrieve anything that's related
to that specific index, right?
So how does indexes work?
So it uses a b3 so a balanced
tree to store indexes.
So you've got a mother index
and then you've got child
right.
So you've got the mother which
is the index field and then
child child being anything that
you are going to be able to
pull in the relation to the
mother right and it contains
the value from the index
field and the pointer to the
corresponding document, right?
And then when a query is
executed, it uses the index
to quickly locate the
relevant documents.
So because you are using ID
number, right for CUMBLAN
the moment you punch in that
ID number it quickly rushes
and gets because already it
has the 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 then there's types
of indexes.
So firstly, there's the
single field index.
You're going to talk about
it, but basically that's how
you create it.
So which means there's a
single field in it, right?
And then there's the
compound index where you can
actually have what you call
this you can you can you
can actually have many
fields right multiple foods
being you where you can be
able to to index that and
then at the same time you
can also create what you
call a multi-key index a
multi-key index is there's
nested documents are in
array right for example
subjects you can index the
subject because there's things
under it.
There is a whole lot of
subjects that are in it.
I think it was color fellow
that was trying to list the
number of courses if I'm
not mistaken.
So this can be an example
where you you index right
courses right and be able
to the sort of it will be
easy for you to be able
to actually reference the
courses or it could be
subjects right where you've
got your studying it and
then the subjects below if
you index subjects, it
means that you'll be able
to index everything that's
under it, which is an
array which is a list of
subjects or a nested
documents where nested
documents is where you've
got sort of documents that
speak to each other, right?
And then you've got your
text text index.
Let's say you want it
supports search queries on
string content.
You've got the name you
want to index the name
which comes as a text,
right?
So it then becomes easy
for you to be able to
search your text.
You also have geospatial
indexes where it supports
your geospatial queries or
coordinates.
These ones are used mainly
by your Ubers and your
boats and your e-hailing
platform or anything that's
delivery related.
They store geospatial
coordinates data right
data where you can be
able to use or you can
be able to index
coordinates right to be
able to use them maybe for
delivery or for pickup or
for whatever.
Then you've got what you
call hashed index, right?
This hashed index is mainly
used for sharding when
you're doing sharding,
right?
So you hash the you index
the hash of the field,
right?
The contents of a field and
it would be in a hashed
format, right?
That's when you especially
when you're doing sharding
is very very good, but
we'll get to the point
where we actually do the
speak about the sharding
and then be able to explain
this hashed indexing and
then you've got TTL index
where automatically you
remove documents for after
a specified time, right?
To the document should
expire after 3,600
seconds or after so many
years or whatever, right?
But usually TTL index is
where you don't really need
to store the document for
too long, right?
And you don't want that
manual part of you having
to log into the database
to actually do some manual
work, then you can be
able to do your TTL
index, right?
How do you manage index?
So there's the creation
of the index, right?
So it's db dot the
collection and then the
index operation that you
want to do, right?
So in the example there
you've got db dot students
students being the
collection and then you
want to create an index
of the name, right?
Of understudents.
So when you go into the
collection student,
when you look at it
at the table on the
relational database side,
it's a table.
Then what you call this
you want to use name
as an index, right?
You can also be able
to list index which
is get indexes and then
you can also be able
to drop index, right?
You can also be able
to rebuild an index, right?
Let's say there's some
complications that
would have happened.
You had multi-key or
you had confound.
Now you have to break
them and now you want
to rebuild the
whole collection, right?
It's a matter of just
running db dot the
collection name and
then dot reindex, right?
Now some tree structure.
So tree structure is used
to store indexes
as I say, right?
Which is a balance tree
that allow efficient
insertion, deletion
and search operations, right?
And each node in the
B-tree contains multiple
keys, right?
And pointers to child nodes, right?
So your key is your index
and then your node is
the document that you
need to reference to, right?
So indexes are also stored
in a separate data file
within the db path
directory, right?
So you can set that up.
You can add to where
you want your indexes to be.
You can set that up, right?
And each index entry
contains two things.
It contains the indexed
field value, right?
Let's say you are 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?
Then there's index selectivity
where it refers to
how unique the values
in the index field are.
They are always unique, right?
They are very, very highly
selective, which means
they are unique values,
which obviously results in
better query performance.
And then there is the
low selectivity, which
has got many duplicate values.
But what it tries to do
is it avoids mostly
when it's indexing,
avoid low selectivity
where you've got
what you got is many
duplicate values, right?
Don't use that.
Rather use high selectivity
where you use unique values,
right?
Unique values could be your
user ID, for example, right?
It's going to be unique
or an email.
It's meant to be unique.
There's no way that you
find two people with the
same email and then they
receive mail differently.
I don't think there's
any of that set up.
It might differ just one part,
you know?
And then there's also what
you call index cardinality,
where it refers to the
number of unique values
in the index field, right?
So high cardinality fields
are very, very good.
Things like your email,
your ID number,
passport number,
because they are unique.
They are never the same.
You never find two people
with the same email.
You never find two people
with the same passport number.
One has to be fake.
If you find somebody,
two people with the same ID number,
one has to be fake.
So those are the high cardinal,
what you call this,
candidates for indexing, right?
Low cardinal ones are your gender.
You've got a million mail, right?
And you don't want to be using
that because if you're going
to index your gender,
then you won't benefit that much.
It will still need to scroll
through the whole,
if there's 1,000 mail, right?
It needs to scroll through
that whole 1,000 mail.
And then indexes also
consume size, right?
They also consume,
because remember,
when you create an index,
it creates a data, right?
That it separates from the main DB, right?
And when you then reference that index,
obviously it's pointing to there.
So indexes can actually
consume additional storage
because there is the issue
of the size of the index
field in itself,
and then the number
of documents in the collection.
What indexing is meant to do
is it's meant to bring
whatever data close by
so that it doesn't have to
go through a whole scan
when it needs to find a document.
So you can imagine bringing
that data close by
so it creates that file layer,
that index information,
and all that stuff, right?
Some best practices for indexing.
Frequently created fields
are very much important.
That's number one.
The ones that are frequently created
is what you need
to look at indexing, right?
And also create compound indexing, right?
Focus that need to filter
on multiple fields.
But also, do it wisely.
Don't just do it.
You can't just index a field
because probably you feel like,
what do you call this?
It will need my multiple and whatnot.
But is it frequently accessed?
That's number one.
Number two, do you really need to index it?
Because sometimes it's not wise.
It's going to impact performance
when it comes to indexing compound indexes.
And 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.
So you need to be careful about that.
The other thing is don't over-index, right?
Because over-indexing
slows down your write operations, right?
And it also consumes storage, right?
Then monitor your index, right?
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.
You need to be very, very careful of that.
And then there's a query that is covered.
The query that's covered is,
we are saying that this query
is basically based on,
it's optimized, right?
And in essence, you can be able to,
let's say, index it as a whole,
create a compound index,
but for the benefit of performance, in essence.
So you need to use covered queries
where, in essence, you can be able to use
indexes in a very wise way.
Now, single-field index, right?
Where you've got a single-field as an index
in a collection, right?
It helps speed up your queries
where you need to filter,
where you need to sort,
where you need to aggregate.
And then how does it work?
Obviously, it creates a P tree structure
from the index field
and then points to the relevant
corresponding document, right?
An example there is when you create an index
of the name in the collection students, right?
One indicates ascending order,
minus one indicates descending order, right?
And then some use cases is when you need to filter
or sort by a single field.
Finding what you call this,
all students with a specific name
or certain students by age, right?
And then you also have compound index
where it says it's a combination
of multiple fields in a collection.
It helps when you do your filter sort
and aggregate also.
And the order of the fields in the index meta, right?
Queries can use the index
if they include a prefix of the indexed fields, right?
An example being an index on name and age, right?
Can be used for queries on name or name and age,
but not just age, if that makes sense.
So in this order, you've got name and age.
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 geospatial, which is more or less for maps,
mostly for maps, used for your UBAs and whatnot.
Supports two types, which is the 2D for flat 2D coordinates,
your latitude and longitude.
And then you've got 2D sphere, right,
for your spherical geometry, right?
Geo JSON objects and all that stuff.
How it works?
It utilizes specialized data structures,
which is, for example, geoaching,
where it indexes the geospatial data.
And then queries can find documents near a point, right?
Or an intersection line, right?
And then an example is obviously creating
a 2D sphere index on a location field.
For example, the db.places being places being the collection
and then create index on location to this sphere, type to this sphere.
And then the use cases, location-based queries,
finding nearby restaurants, for example,
or finding all places within a certain distance from a point.
So when you do your Google search,
these are some of the indexing that really happens.
Some best practices.
Single-field indexes are used for queries
that you need to filter or sort by a single field, right?
Compound when you need to sort by multiple fields.
Geospatial when you use for location-based queries.
And then avoid over-indexing.
They can be very difficult to manage, right?
There is the part of it slowing down some operations.
There is the part of it consuming storage.
But also, there's the part where it can,
if you're not very careful enough, right,
it consumes storage.
It will take bigger space, right?
And then also monitor your index usage, right?
Then there's something called a query profiler, right?
A query profiler basically is used to be able to identify
suboptimal queries.
And what are these suboptimal queries?
These are queries where they take long time to execute.
They consume excess CPU, memory, or disk I.O.
They retain large amounts of data unnecessarily
and do not use indexes effectively, right?
And some common causes of this is
where a query needs to do a full scan, right?
It needs to go through a whole collection
or whole database, right?
But mainly a whole collection, right?
Where it queries an entire collection
instead of using indexes.
And then an example is where you have to create
a non-indexed field, right?
And then inefficient index usage,
where you've got queries that use indexes
but still perform poorly due to low selectivity,
the type of field that you've chosen.
There's many duplicate values, right?
It's number one.
Incorrect index order in compound indexes, right?
Where you're starting with the age and then the name,
for example, in the example that we had, right?
Now it's going to save through everybody that's got 20 years
to look for a name kumbulani on it, right?
And yet if you do vice versa,
to look for kumbulani that's indexed
and then the age is 20.
So it becomes easy, you know?
It doesn't have to go through a whole lot.
And then large results sets where you've got queries
that retain a large number of documents, right?
Where it then causes high network and memory usage.
That's also another common cause
of suboptimal queries.
And then complex aggregation pipelines
where you need to do a whole lot of summing
and this and that and that, you know?
When they are complex, usually they have,
what you call this,
they need more power to be able to run that.
So those are some of the sort of
common causes of suboptimal,
what you call this, suboptimal queries, right?
And then how to use the query profiler.
It's an inbuilt MongoDB tool, right?
So it helps you identify your slow, inefficient queries,
collect detailed information about that,
your execution time, your index usage,
the scan documents and all that stuff.
So you need to enable the profiler, right?
And enabling the profiler,
it sort of has three profiling levels.
Zero, it's off default.
One is log slow operations, right?
Which are threshold in milliseconds.
And then two, which is log operations.
So logging all operations would help
in terms of when you really need to troubleshoot,
but you can leave it to say log slow operations.
And you need to set a profiling level, right?
So for example here,
you've got DB set profiling level to one
and anything slower than a hundred milliseconds.
So you can set to say our target time
for query execution is a hundred milliseconds, right?
Then you run that and it should be able to tell you
which ones are the queries that are running slow
at the end of the day, right?
And then you can also be able to verify profiling level
by doing the DB get profiling status.
And then after that,
you can then be able to sort of change anything
that you want to change or make changes, right?
The profile data, right,
is stored in the system profile collection.
So if you want to see anything,
it would be good to go into the db.system.profile.find
and then you can be able to sort, right,
with the limit of 10 in essence.
Some key fields in profiler data.
Operation, what is the operation time?
What is the namespace?
Usually it's namespace is constituted by the database
and the collection.
There was a time that we did statistics,
I think it was Color Fellow.
If you looked at the bottom, very bottom,
there were lines, a few lines
that were not part of the brackets.
You would find that there's somewhere where it says NS
and it will have the database name
and the collection on it, right?
Then execution time in milliseconds
and then some plan summary, the query plan, you know?
Call scan for collection scan,
Ix scan for index scan.
It will show you that.
Number of keys examined, number of index keys examined
or docs examined, the number of docs examined
and then number of documents returned.
So you need to be mindful of that.
Any questions when it comes to these topics?
Okay, seems no questions.
I think we can go to our practical
and then move over to the next one,
which is early.
Where is my machine?
Okay, there it is.
Where is that?
Where is my window now?
Okay, there we are.
Cool.
So we've done one, two.
Three, as I said, is going to be optional.
And then what we need to look at is the security part.
Now to do a bit of explaining, right?
Please be mindful of this.
So this part, you don't need to do it
because it's setting up of the MongoDB from Sketch.
You've done that already, right?
And then you come to the creation of MongoSH.
You've created a user earlier on.
But also be mindful that on number two,
there's a time that you actually deleted the user
as part of it.
Are we together?
I think there's a time that you created a user,
and then it was deleted as of exercise number two, right?
So if you had deleted, then you need to recreate.
Now there's this part that I want to explain, right?
So you see it says, edit etcmongod.com, right?
So what you then do is you go to your terminal,
log out of the DB if you are logged into the DB, right?
And then what you need to do,
whether you use Vim or you use Nano, it's up to you.
I use Vim.
So now you need to go to the location,
and then mongod.com, right?
If you go into it, it's got different subcategories.
So for example, the DB part is sorted already, right?
This is where you store your data.
If you are using a specific engine,
you then can be able to put it there
and obviously add some details to it.
Then where to write the logging data, right?
The destination is the file append is equal to true,
so it doesn't need to remove some stuff.
It just needs to add on top,
and then the path to it, right,
which is your mongod.log.
Usually most applications
have got that log file sitting in var log, right?
So they'll have var log and then create a file,
a directory that will have a specific file, right?
And you also have your network interfaces
and then how the process runs, process management.
And then when you come here, when it comes to security,
for you to enable security,
you need to come and then remove that part
and then go below one space,
not one tab, one space, right?
And I think it's security, if I'm not mistaken.
Authorization, sorry.
Authorization and then equals to true, right?
This is how it should be, right?
And then you save your file,
and then you need to restart Mongo
for that to take effect, right?
You need to restart Mongo for that to take effect,
or else it would not take effect,
so you then come and then be able to then restart that,
right, which is good.
Sometimes if it fails to restart,
all you need to do is just do status,
because sometimes it will be an issue within your,
oops, it actually failed.
Okay, that's weird.
MongoDB server, let's see,
failed, control error during global initialization.
Status, restart MongoDB.
Let me have a look again.
Romango.d, so security.
Is it true or enabled?
I think it's enabled.
Yeah, it's enabled, that's fine.
Enabled, and then restart that,
and then status, okay, it's happy now.
So just be mindful of that.
Now, after you restart it,
which means now anything that you're going to need to do
is got authorization, so you need to log on.
So be mindful, I didn't create the user,
I didn't even create any user,
but in essence, when you then need to log on, right,
it's a matter of just, you don't need,
because you've already created the user admin,
you probably don't need to do this whole process.
If you just do this, right, authentication database admin,
it will be able to ask you for admin,
because that's the only user that you have.
But in the case where you have different users already
in the database admin, in the admin database,
then you need to do this and be mindful of the password
that you used earlier on to be able to create the user.
Happiness, understood?
Are we understood with that?
Sorry, no one's answering.
Mina joined later, so I am trying to catch up.
There is a recording, so it's okay.
Yeah, I'll check it out again.
It's just I'm struggling to connect to where you are now.
Oh, is it?
Yeah.
I'm sharing a screen.
I'm not sure if you'll be able to see that.
Okay, I can see that.
Oh, we're not going on this link, right?
It's only the other one that we're working on.
Which one?
The link that there's one that I sent in the chat, right?
It's for you to create your virtual machine,
like the one that I have on the screen.
And then what do you call this?
That GitHub link I'm going to share also
so that you can be able to go into it
and then be able to follow number one, two, three as you go.
Okay, then.
All right, cool.
No problem.
I actually wanted to explain number.
So when it comes to secure deployment,
this part really works when you've got three different machines.
You're not using local host.
So the part of the enabling of the SSH, the binding to local,
it's already done.
But then the enabling of SSL or TLS,
you don't really need to do it because it's just one machine
that we're using.
So it wouldn't be right.
But the rest of the stuff, I think people can be able to do it.
I'm just there when you were explaining,
I think you got quiet because you were going too fast there
when you're explaining where to authorize it.
Are those steps included as part of this?
Say that again?
No, I'm saying the part where you're issuing us now,
whereby you're including as part of security.
So you're including authorize.
Yes.
Is this part of the steps that we have here or something on the side?
It's part of the steps.
Now, the question would be on number one,
there was creation of a user.
Right.
On number two, there was a part where you create a user and delete it.
Now, if you created a user and deleted it on the number one,
where you created the user or created a second user
and you deleted it on number two,
then you still need to recreate the user here.
Right.
So you do your MongoSH, you create your user,
and then you enable your security within the mongod.conf file.
Right.
And then restart your MongoDB,
and then you'll be able to use this.
Got it?
Okay.
Now, got it.
Okay.
Got it.
So for just one thing,
for number three there, so you're not doing that, the web console.
The web console takes a bit of time to install.
That's what I'm thinking about.
I would rather you guys can do it at your spare time,
whether it's later on in the week or whatever,
because you still have access to this virtual machine, I think,
for a few weeks, if I'm not mistaken.
If it's not a month or two months, I'm not mistaken.
But you can always do it on your own, on your virtual machine.
It takes a lot of time to set up.
That's why I sort of left it on the side.
That's why I said number three, don't really do it,
because it takes a bit of time.
That's number one.
Number two, Ops Manager is easy to install, but it's enterprise,
which means there is paying that's involved.
Now, when you then go to the community edition
and you want to install the open source of it,
they are not easy to install.
That's why I'm saying it takes some time.
Oh, okay.
How can I not take that?
On number four, the only one that you need to skip is this part,
the networking part.
Why I say networking or this part is because
when you use TLS and SSL authentication,
you need to use it amongst two nodes, right?
MongoDB nodes, where you've got,
it's not one machine like this.
It's not on localhost.
It's got different other machines available.
And you want to add that machine to the cluster.
That's when you can be able to use your TLS,
because then there's that secure communication
between the nodes in the cluster.
That's why I'm saying you don't really need to do it,
because you won't be able to see the effect of it,
if that makes sense.
Okay, I know that makes sense.
Yeah.
But the rest of the stuff, you should be able to do it.
So if you do number four,
and then when you go to number five,
it's creation of what you call these indexes.
Geospatial, you might not be able to get any results,
because you are not doing any location-based,
but it's to help for information purposes,
to know how it is done.
And then you can then be able to look at the rest of the stuff,
some optimal queries,
looking at that profiling,
analyzing the profile data,
and some advanced techniques in terms of covered indexes,
running cover query,
and that should be all.
And then after you're done with number four and number five,
you can then look at exercise day one.
I'm just going to use the bathroom quickly.
I'll be back in a sec.
Quick question, guys.
Are we supposed to install,
are we supposed to set up MongoDB Ubuntu?
Because I'm getting an error here.
Yes, you're supposed to,
but did you exit the database first?
If you're still showing in the city database,
you must exit the database first.
Oh, that will explain how complete it is.
Yeah, just say exit, and then you just do that.
Should be fine.
Oh, okay.
Yeah, because that's just getting some error.
Okay, exit.
Okay, I'm back.
Anyone with a question or getting errors?
Or breaking stuff?
Faith, you don't need to set up again MongoDB.
Don't worry about that.
Because it's already set up.
Okay, should I?
Yeah, you can go from number two.
So resetting up doesn't need,
you don't need to worry about that.
Okay, so we can skip the first-
The number one, yes, and then go to number two.
Okay.
Where you've got the authentication party.
Who is it?
Asanda, didn't I say I don't want to be disturbed?
About what?
Go and sleep.
Go and sleep, your time is slow.
Anybody else trying to exit the compliance group
after adding the security organization enabled?
I'm trying to write and quit.
I'm getting an error E212.
Let's have a look.
But after the security, right?
Enter, enter, let's see something.
Let me see where it should be.
I almost said it's fine, I didn't get that error.
So you're able to quit and write?
Please, please press enter.
Wait, are we supposed to unhash security?
Yes.
Oh, okay.
And then do escape quit without saving.
I want to see something quickly.
That's you, color fella.
Use the override, so use the Q and exclamation.
They're not pseudo.
Right.
Yeah, that's why it should be good to go now.
I'm getting a notification soon when I get to after restarting.
Who is that now?
It's cool fella.
Okay.
Let's see.
Okay, go, let's see.
You've authorized that.
That's fine.
Have you been running?
Have you been running MongoSH as a student all this while?
Okay, I did pseudo.
Yeah.
Did you just go up?
Just go up again.
And the status says everything is okay, correct?
So just do a status.
Okay, everything is fine.
Control C.
And then try and log in from here.
Let's see.
MongoSH minus U, something, something.
Then enter with the authentication failed.
Okay.
Just remove minus U admin minus P secure admin.
The password in that.
Just, yeah.
Remove that.
Even the user.
Yeah.
Remove the user.
Enter.
So there's probably something with your password.
I'm assuming so.
Okay.
Yeah.
So if you created a user from number one, I think the password is actually different.
The other password should be I think admin, admin one, two, three, if I'm not mistaken, on number one.
So if that user was still there, then it would definitely want to be able to log in.
But now because you're not specifying the password, then it's just going direct and just looking for the admin user.
Just a reminder, you said we can skip the network section, right?
Yeah, you can skip the networking part.
And then go on to number four and so on.
Yeah.
And continue.
I'm sorry.
So after skipping network, we go away.
We went to four.
We go to four, right?
Yes, number four.
Yeah, because I'm at number four there.
I've run the first one and just go through it again here.
I've run the first one here whereby I go to the terminal.
Yes.
Right.
I've run this one.
This one.
Where is it?
Yeah, this one.
I think this is an output.
So but it has a set as the output there.
And that output that has been set in it.
In said squeeze update that command that he used.
No.
So look out of your database.
Look out of your database.
Exit.
Just to exit.
Yeah.
No, I'm typing.
It's not showing.
OK.
Why?
So I just read it sometime.
Refresh it.
Disconnecting.
OK.
Refresh the page and then exit from there and then run it.
So what you can also do is remove the watch.
Well, it's just run mongo stats.
And that's it.
You don't need to point it anyway.
So as a start, just run mongo stats and that's it.
Yeah.
OK.
So let me try.
Let me refresh the page.
All right.
That's right.
Colorful, you're not supposed to run that mongo stats when you're in the database.
Please exit and then run it.
What's her name again?
Zandri, let me share the link.
You don't really need to log into GitHub.
OK.
Thanks.
Are you able to type?
Are you able to tap on mine here?
OK.
OK.
Just one second.
I'll get to you just now.
If Zandri, if you can just copy that and then paste it into the web browser for the virtual machine, then you should be good to go.
And let's see interactive.
Oopsie.
Where did I go now?
OK.
There we are.
Interactive and oops.
What's going on?
You broke your machine, my friend.
Oh, but you said you can break it.
Yeah, you can break it.
So you can always restart it.
Is it?
Yeah, we can restart it.
Just one second before we restart it.
Let's see.
And then so we can close this terminal basically.
Because I also don't know why it's hanging.
OK, so I was saying this, right?
Where is that now?
So I was saying mongoose.
Mongoose.
Mongoose.
Did you reboot this machine at some point?
No.
That's weird.
OK.
Cool.
When has it been running?
Yeah, it's been from 12.
Yeah, 12 or 8.
12 or 8, yeah.
But also remember, I think these servers are two hours ahead, if I'm not mistaken.
I think they use the UK time.
Yeah, but if that's the case, then it just restarted now, yeah.
It's two hours.
Which is very weird.
Is this the password?
Is that the right password?
Yeah, OK, cool.
It's the correct password.
So what was the issue there?
Why was it like that?
Why was it hanging?
Honestly, I don't know.
I don't know.
I can't tell you anything because I didn't do any troubleshooting to it.
But yeah, so you can see number of inserts, queries, update, delete, get more commands,
dirty, used, flashes, you know, and all that stuff.
The network incoming, network outgoing.
It is constant, so you can't really say you would worry that much about it.
Yeah, but that's basically how it will show.
Or you can do this and then five rows, one second each.
Oops.
I need to see the time.
I need to set two rows.
It's doing one second.
Two, four, six.
OK, cool.
So you can beat.
Oopsie.
So creation config, path to a configuration file, host, any SSL, any authentication,
KBros, URI, stats option.
So you've got minus all, field to show, or custom that.
Row count discover.
Discover nodes and display stats for all, if there are any.
Use HTTP instead of row DB connection.
All option now fields.
Output to JSON.
It must be interactive.
So let's say if we do dash dash all.
OK.
Not unless the same thing.
And then.
Discover.
To check if there are any nodes.
You're moving a little too fast now.
Sorry, I was just told.
Longest data authorization failed.
OK, I'm coming there.
Yeah, I'm coming.
So if let's say there was many nodes.
Right.
If it was a cluster, then it would show each and every cluster information about each and every cluster, if that makes sense.
Right.
So here, because it's just local host, it's just going to show us locals.
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.
Yeah.
Who was saying they are stuck somewhere?
The Mongo stats.
The credentials are failing.
So I'm getting an authorization failed.
OK.
All right.
Cool.
I see.
Faith got it wrong.
I tried to follow what you were helping.
I'm still.
All right.
That's fine.
Yet.
OK.
What?
I tried to move in the credentials.
OK.
Just hold on.
What you can also do is because we're not sure of your credentials.
Remember.
Oh, it's on.
It's on view only.
Let me change it to interactive.
Remember, there was a time that I said just use admin.
Just OK.
Where's my scroll?
Just do it like this.
OK.
Cool.
Because the password, right?
We're not sure if you use admin one or used secure admin.
We need to check that for the purpose of continue.
OK.
Why is it failing now?
Mongo starts that authentication failed.
Let me do this.
I'm going to switch off authentication first.
Hold on.
Let me just go back.
on 2025-01-29
language: EN
WEBVTT
Okay, cool.
Say that again.
Sorry.
Okay.
That's fine.
No problem.
Yes.
Activities.
Who broke their MongoDB now?
Let's see.
Try again.
We failed to connect after that thing in Mongo.
It's U minus D.
That indication admin connection refused.
It failed.
Right.
And why is it failing?
So just do a control C.
Tail space minus F.
Actually, no, no, no.
So do apt install Lnav.
So L-N-A-V.
Apt install Lnav.
L-N-A-V.
Apt apt space install.
No, no, no.
So apt apt.
Space here.
Space install.
No, no, no.
Install.
And then space L for Lima N-A-V.
Yeah.
V for Victor.
Victor.
And then enter.
And then Lnav space and then link to your mongo.log.
So Lnav space var, forward slash var, forward slash log, then mongodb, then mongodb.log.
Forward slash log.
Var log.
So it's var log, not var mongo.
No, no, no.
So var forward slash and then log forward slash and then mongo.
Yeah.
And then mongo something.
I think it's mongo.log or something.
Yeah.
Please take it up.
So I think up arrow.
Keep going up.
There's nothing red.
Which is interesting.
Keep going up.
Up, up, up.
29.
That was yesterday.
Keep going up.
1600 hours.
70.
There's around four, right?
When you're driving a converse.
Okay.
I don't see any arrows.
Okay.
That's fine.
You can do control C. Do a status again.
Let's see if it can give us.
So it says the date that 1945, 30, or 719, sorry.
Environment variable mongodb config override.
Can you, does it go to the right?
I want to see what it says mongo variable something.
Process management is about to force mongo config override no fork.
Is equal to one.
That's the main issue.
Okay.
Do a control C.
Let me try and take over.
Let's see.
Okay.
I'm going to take over your machine, but I'll tell you what I'll be doing.
Okay.
Is it interactive?
No, it's not interactive.
So what you did was you changed the path script.
I will change my screen just now.
Just one second.
Let me share this step instead.
Okay.
And it is here.
Okay.
Okay, faith.
What's up seven point.
It's just the reading part, but now you're going to do the sharding.
So it's just an introduction to sharding.
What you're going to do is from number three, going down.
Hold on.
Insert for sales.
What are you getting?
So you say that again.
And you've got the answer in front of you.
Let's go up a bit.
Just go up a bit.
Your screen.
Just bring up the top part of your, um, no, no, no, not that.
Go on the right and bring this.
Yeah.
The screen up.
Um, go up again.
Going up.
You did not authenticate.
Yeah.
You can try and go up.
You need to go up this.
Remember it will only show you what, what you ran in the DB.
Not one to rent.
Yeah.
Just go down a bit.
Just go down a bit.
No, that's fine.
That's very fine.
Uh, authentication for your password.
Your password.
When you, when you are, when you changed it.
What did you change?
Go on.
They go and exercise.
They want exercise.
Day one.
Day one.
No, not in a day one.
So go down the third one from the last one.
Exercise day one.
Yes.
We'll do the very last part of it.
Keep going.
Keep going.
Um, just go up a bit.
Go up a bit.
Go up a bit.
Is it exercise day one?
Go up a bit.
Uh.
Um.
Go to number, go to number five.
I think it was number five.
Wait was the very last part of it.
Somewhere the last part.
I don't remember which number,
but I remember there was the very last part when we were saying, um,
to change the password.
This is what you run.
Go to consecutive monitoring.
No, no, no, no, no.
There's one that I showed you guys at the end of, um,
later.
Wait.
Sorry.
Say that again.
Go down.
Go down.
Yeah, go down.
But the, the, the way it says troubleshooting,
if you run the last one, did you not run the last one?
Yes.
So change your password to that on your command line.
Yes.
Wait says, uh, minus P right.
Put that up with, um,
so you see it says M Mongo S H minus you admin minus P.
Change that secure admin one, two, three, to the,
to the one that's on the thing.
Just copy the,
the new secure password.
One, two, three.
That way.
Yeah.
That wedding.
Yeah.
Without the courts.
Try it.
Let's see.
Your life is solved.
My friend.
All right.
Cool.
Yeah.
Did you change to sales?
But, uh,
do you sales?
Do you sell?
So,
so when you get errors,
sometimes the,
the answer is within the error in itself.
For example,
it's just,
you just needed to authenticate.
It was actually telling you that it needs authentication for you to be an inset because you've got authentication and able.
Yeah.
Thank you.
All right.
Cool.
Let's go back to,
to color fellow.
Okay.
I'm trying to look for where you put that slash DB slash something.
Um,
data.
The data.
This is not weird.
Which location did you create the DB?
The data slash DB.
Do you remember?
Where is,
No, no, no.
So where is the directory that you created?
That's the one that in the root folder or.
I don't seem to get it.
Okay.
DB is the right permissions.
Okay.
Let's do this.
Okay.
That's fine.
So Mongo should be okay.
So it's correct to storage that.
Okay.
Forgot to check what I wanted to check.
Okay.
So it doesn't return anything in there.
Let me check this command that I want to use.
Okay.
No, man.
It's not what I'm looking for.
New state configuration replicators.
They both don't stay configured.
Pre-start.
Client connection accepted.
Let's see now where it is failing.
So that it's not failing at any point.
Doesn't show the error that it's failing.
Okay.
Let's do a proof.
Yeah, that's what I want.
That's what I want to try and do.
And yeah, it's.
So I didn't stop.
Oh, but it stopped anyway.
So.
Interesting.
Yeah.
Continue with it.
Let me try it on my machine and see.
Probably the missing step.
Seven, I think.
Six, you can skip it.
It's got, I think seven, six has the programming languages.
Of which it's not really.
Something that.
Yeah, you can just.
Take over.
Let me just.
Look at this steps.
Yeah.
Mm hmm.
Okay, hold on.
Let me go to your machine.
I'm on your mission.
Mm hmm.
Yeah, it will.
It will definitely want to connect.
Go back to the instruction.
So you created the folders, but did you run.
It's not starting.
Starting off the config servers.
Because you still need to do this part to start those config servers on the specific part.
Then you can try and log into it.
I will let's.
And what I see you just created is just the directors that you created so far.
Yeah.
So you see it is started.
And now you can do that MongoSH port something, something, yes.
Then now you're connected to one of the replicas, the config servers.
And then you can now initiate the replica set now.
Yeah.
All right.
Cool.
Is that, is it faith, what did you break?
Okay.
Please make your, what do you call this?
Your terminal bigger.
Okay.
Just go up a bit.
No, no, no.
Just bring your screen up a bit.
It doesn't go up.
I want to see.
So Mongo server that, did you create the folder?
Then you didn't.
And just go back to your, just minimize and make it, make your terminal smaller
and then go back to the game.
So shards that go up a bit.
We are on number, you're doing shards now.
Did you do this?
And it's, it's all good.
Yes.
And you did number three.
That's where you are now.
Okay.
Create the directors first.
So just copy that.
Yeah.
And then, yeah, just paste that.
Enter.
Cool.
Now go back and then copy the command to create the, to start the config servers.
So the next one is creation of the config servers.
Mm-hmm.
Mm-hmm.
Now you go to the next one.
And I think you're going to log into one of the, the one that's got port 27019.
And then you initiate the replicas, replica set.
No problem.
Sorry guys, I'll be with you just now.
Okay.
Okay, I'm back.
Are you now good, Faith?
Is it now waking out?
All right, cool.
No problem.
Okay.
I know.
I know.
Mm-hmm.
Yeah.
No, you don't really need to be root or anything.
Just do Mongo SH.
Just log in.
No, no replica set to get received.
Wait, do history.
So you've done 22, 23, 24, and 33.
Okay, that's fine.
Get into 22.
Mm-hmm.
Primary date.
There's your replica set there.
You've initiated in this one.
In 22.
Okay.
Now go back to your, to the, to the, to the, to the, to the, to the, to the, to the, to the, to the, to the.
Okay.
So you did that.
You added 22, right?
Just copy the RIS, RIS.edit.
It might be, what do you call this?
An issue with how it's been written, actually.
You might be right.
Just copy the RISedit.
Don't, don't copy that.
Just the next line.
Yeah, yeah.
Go back and try it.
Mm-hmm.
Do an add.
And then do an RIS.status.
Mm-hmm.
And then in brackets.
You need to add the brackets and the thing.
Brackets and, no, no, no.
You don't need to add that.
Status and then brackets.
And then semicolon.
Mm-hmm.
Let's go up a bit.
Up the screen a bit.
Yeah.
So yeah, you're right.
Then there's a step that needs to be fixed.
Go up a bit.
I'll show you something.
Don't go too far.
Yeah.
So you see there it says primary.
Where it says members.
And then primary.
Go down.
So just close to the bottom of the screen.
Yeah.
It says primary there, right?
You see it says localhost 27022, right?
That's where you initiated the replica set.
Right?
So there is primary.
Now go down a bit again.
23 is secondary.
See that?
Go down.
24 is secondary.
And then another one.
33, I think, is secondary.
So now your cluster is good.
So you're right.
There needs to be some...
We need to remove the part where you log into 20...
Is it...
No, you logged into 22.
No, into 24.
Yeah, you need to remove that part.
I need to remove that part because you need...
Let me just...
You need to add...
So the moment you log into this one, the very first one.
Right?
You're going to initiate the cluster from the replica set from there.
Right?
All you need to do is just need to add this to this cluster that you initiated.
That's what needs to happen here.
So this part needs to go off.
This one.
It needs to go off.
I'll fix that.
Same thing.
Okay, wait.
Let's see.
Go back to your terminal.
Let's see.
27 or 10.
I could not find matching host preference.
Just go up your screen a bit.
Let's just confirm something.
Go up again.
Keep going up.
I want to see 21 is secondary.
20 is secondary.
19.
I could not find a member to sing from.
Okay, that's fine.
Okay, go down.
Go down.
Just hold on.
You exited there and then you did the Mongo S.
It's important.
2019.
And then.
2010.
Okay, cool.
Go down.
I think your biggest mistake is you're using Mongo SH.
Not Mongo S.
Keep going down.
Exit.
Okay, but you're now Mongo S.
Go back to the instructions.
Just go up.
So, configure the router.
And then fire Mongo S.
Shard replica that.
Start the Mongo S router.
And then you get into that.
And then you add the shards.
That's weird.
Okay, let me take over a bit.
Because it's supposed to auto.
You're supposed to be able to add the shards from there.
Mongo S failed to satisfy.
You could not find host read preferences.
It's mode primary two.
For set shard one replica set.
Okay.
Let's go to the setup.
Of the shard.
Shard one replica set.
Shard one, shard two, shard three.
The primary should be 2702.
Right?
And.
And.
2702.
Whose screen am I on?
Oh.
Sorry. Okay.
Wait.
I just need to.
So, when you run this.
Wait, hold on.
Hold on.
Let me just.
Okay.
It's fine.
It's fine.
Okay.
I'm in Mongo S.
And then I want to add a shard.
And we've got.
2722 running.
Okay.
Let me test the shards.
And see what's happening with the shards.
And then when.
Why is the shard not connected?
Aha.
Okay.
Your shards are not up, ma'am.
That's why it couldn't find a primary.
Right.
And then.
And we initiate that.
Right. 2222.
22 being the primary.
That's fine.
And then we add the rest.
Why would you say it failed?
It will fail?
Okay. Just hold on.
I'll come to you.
Just hold on a bit.
Secondary.
Secondary.
Secondary.
And then 22.
Okay. Primary.
Okay.
So now we've got a running cluster.
Now.
I'm going to initiate Mongo S.
And then.
Let's see what this gives us.
Okay. I think 2019 is up
and running already.
Okay.
It will fail.
Let's start.
Minus NTLP.
So I want to check.
So we've got 2010.
We've got 2019, 2021.
Okay.
And.
So Mongo S.
With our replica sets
19, 20, and 21.
Which is our config server.
Config replica set.
Right? Should be the same one
with
the config replica set.
And there's 19, 20, 21. Okay. That's fine.
Now.
Where is that command now?
Okay. There we are.
And it should use port
port 2010.
Okay. That's fine.
Now. Let's kill this one.
Which one is this one?
Let's kill this Mongo S
and rerun it again.
And then in that
we no more have a Mongo S
and now we can
rerun Mongo S.
Now.
Let's
go back.
So we've got a running instance
of Mongo S.
And then
we log into that.
We are now logged into that.
Which is fine and
let's try and add
one.
Command.
So your shots are not
up as yet. Does it make
sense?
Yeah.
I'll come to you
ColorFellow just now.
Let me just make sure that the stage is working
fine.
A member of an existing is already
a member of an existing one.
So we should be good.
We don't need to edit.
And then this one we don't need to edit also.
So I need to fix this
and remove
because it's a replica set.
So we should be
good to go.
And also this is Shard 2
replica set. Wait.
Is it supposed to be Shard 2
replica set?
And 23
23
all of them are replica set 1.
So there's a type of A.
Cool.
And then 24.
Okay cool.
And then
that should be good.
So this needs to
shape
oh there.
Please note this needs to be 1
and 1 but I'll fix that
and then let's take our Sharding
status.
So
our Sharding status.
Right.
Shard replica 1 set.
Right.
Which is okay.
Where is it?
We edit there.
And then our status is here.
So cluster ID
the Shards we've got Shard replica set 1.
So we've got
localize 22, 23,
24 and 33.
Okay. Active Mongo
SS
I'm not sure. I think it's the version.
And then auto split enabled.
Then you've got the balancer but
it's not running. So it's
not enabled which is fine.
Then shared data distribution.
You've got
Shard name 1.
Shard 1 replica set.
And then you've got
often documents none
only documents 6
only size 594
and all that stuff. And then the databases.
ID config
primary config partition
is equal to 2. And then
Shard key is 1. Unique false.
Balancing true.
And then chunk metadata.
All sitting in Shard 1 replica set.
So which should be good.
Where is color fellow?
I'm going to change the tab.
Faith you can continue.
You can go to your terminal.
Let's go to your terminal.
Let's see.
That's color fellow.
Okay you can do that.
Okay cool.
Add the first one. Let's see.
Okay the first one should be added.
I can see you've added it already.
But just run it.
Just to be sure.
Okay that's fine.
Do an app arrow.
Change the port to 23.
And then change.
Just change the port to 23.
Then enter.
Then change the port to 24. Then enter.
And then you can check the status now.
I think it's SH.
Not RS.
It's a Shard.
So the error there. Just go back to your GitHub.
To your instructions.
The error there
is this needs to change to
1.
And this needs to change to 1.
So I'm going to
fix that now.
It was this part that I need to fix.
And removing this part.
So I'll do that now on the
repo quickly.
Austin are you sorted?
Okay cool.
No problem.
Alright cool. Let's take
our lunch from 12.30 today.
I've got a meeting from 1 o'clock to 1.30.
So if you can please take lunch
from 12.30 to 1.30.
22 at those.
That's fine.
Publica one at the shards.
That's fine. Okay.
I think you should be good to go.
Oh this is going to be interesting.
This is that color filter.
The balancer.
Let's go back to your instructions
later.
Okay.
Let me just confirm
that command.
Yes.
That's it.
Balancer running.
Let's go back to the
MongoS.
Exit please.
Yes exit.
And then MongoSH
port
27 0 1 0
MongoS
Yes.
You use MongoS.
Okay.
Then copy and then
check that.
MongoS yes.
Remember, remember MongoS
is the query, right?
And it is the one that
distributes the queries according to
the shards to the different shards.
It's the router if that makes sense.
So you are currently in a shard
and you can't check the status of something
that's running in a shard. You need to be in
what you call this
in
in MongoS the router.
That's where the balancer is.
What I probably need to add
is that after you take
the monitoring of
what you call this after you do MongoStats
change to the router which is MongoS
and then
the balancer yeah.
Just take that MongoStat
and then change the port to
27 1 0 that MongoStat command
and then let's change it to
27 1 0. Let's see what it
brings. No, no, no. I'm saying
copy the command and run it on the terminal.
Yeah. So exit there.
Exit and then go up
again because it's MongoStat
not MongoSH.
MongoStat yeah.
MongoStat and then port change it to
27 1 0.
So that's your
that's your MongoS right?
Just go back to the instructions.
I want to say something. So it says
use MongoStat to monitor query routing
and performance. So that port needs
to change. That's where it sort of
confused everyone.
Yeah.
The port needs to change. Please copy that.
I want to see if there's any difference.
If you just do it direct or you
put the host there.
And then
then control C
and then
paste that
and then change it to
20 10.
0 1 0.
No.
So it's running on one of the shards.
Yeah. That's why it's
running. It will run anyway because it's one of the shards.
It's one of the replicas.
And then enter.
It will still run
but the difference is that
here
just control C
control C. Yes.
So you see here it says
replica set. It's trying to run on the
it doesn't say replica set.
Which means this is actually on
the router. On the Mongo
S. If that makes sense.
So if it's let's say
let me take over your screen quickly
and then if it's let's say we've got
a 23 correct. Yeah.
So it will still tell you that it's
part of the shard one replica
set. Right?
That you are monitoring. If it doesn't
have any replica set here
it means it's running on the
the router. Which is Mongo S. Make sense?
Because if you see here
right on the set
replica right
it's got this whenever it's a replica set
it's got this column. I don't know how you can
this part right
when it doesn't have then
it's on the Mongo S. That's number one.
Right? Number two
it will keep going one
one zero one one zero one
on the what you call this
on the router right
but on
on any replica set
it keeps changing the command
13, 16, 15 and what not
what the command numbers
mean I don't want to lie to you
I'll tell you after lunch but
that's how you can pick up that
replica set. Now
earlier on we created
a config server
let's see if we can run this
on the config server. Right?
So on the config server we used
port
19
right? For example
is it this one? No it's this one
right?
Let's see if we can monitor 19
and see what it gives us.
So you see it says config
replica set. So it's either it's a
shared replica set or a config server replica set.
Now the difference would be
when it's a Mongo S that you're monitoring
it does not give you that
it's a config replica set
or it's a shared one replica set
because the Mongo S is not
a replica set. We didn't create a replica
set for it.
I know when you're hungry even colors change
like you're probably seeing red
right now. Yeah
let's take lunch and then we continue
at 1.30. Cool
alright no worries. Bye
It's not a port.
It's not a port.
It's called a decal.
Yeah it's not a port.
It's called a decal.
It's a decal.
It's a decal.
Sorry
So me and my cousin
we woke up
and decided
we're going to care
just watch what's happening next to him.
And my cousin sister
is like
we're going to go to number 5
and basically
we're going to go to number 5
and basically
and I'm like no
no
How can you
have so many children?
So the smallest thing
will make you feel
disrespected or senseless because of ego.
Ego can hide things.
So I'm saying
let us advocate this thing
and take a step behind
back we all love Brenda
none of us know her mother.
So we're taking it from her
and we love her.
But can we not take a step back and say
well you were a bit sensitive
at the time because of
the things that you validly
going through in life.
And then umut was in there
that rubbed you the wrong way
and you overreacted. I'm just saying
Can we take a moment to think
on that?
But you see also on the
what she raised is that there's defamation
like things that have been said
towards her by her mom
claiming that she beat her up.
Afternoon Beza
who are you?
I'm alright. Thank you.
I don't think so
So, contract with ZyberFox just says client, it doesn't really say which client.
Is it because then, because they can move me to another client, if it needs be or yes,
yes, I said yeah.
Yes.
Is it four days or two days?
If I'm at ZyberFox or at Investech?
I think it's two days.
I would need to confirm that, but I think it's two days.
No, no, no, at Investech, the other days are remote, as far as I understand.
No.
So, if I understand well, it's a remote job with some days at Investech office,
not ZyberFox.
No, I am even meeting, what's her name again?
Is it Anathasia or Natasha or something?
I, yeah, the lady, yes, meeting at Investech.
So as far as I know, I'm in ZyberFox, I know remote and then two days, if I'm not
mistaken, two or three days at the office, which is Investech.
Yeah.
No.
I would need that contract.
No.
Okay.
Just one.
Let's see.
ZyberFox.
No, this is the leaked declaration compliance, and where is that contract now?
Payroll.
Sorry, it's on my laptop.
ZyberFox contract, there we go.
Okay.
So to the other words, renewal or cancellation, key information.
Do you want me to share my screen?
Let's see.
Yeah, you already know the stuff, so let me know when you can see my screen.
Okay, cool.
So the first part is the fixed-term contract.
I need to sign it by this day, renewal of cancellation.
I may choose to extend or cancel the contract.
Okay, that's fine.
This one is a fixed-term, 12 months.
Fixed-term nature is based on specific period requirement.
Okay, that's fine.
Key information.
Place you at one of the clients for a stipulated contractual period.
That's fine.
Contract renewal may choose to extend.
Placement and or movement to new client.
It is possible that.
That's fine.
I think we discussed that.
Completion.
When existing clients causes such that movement to a new client, then okay,
this is just movement, right?
Additional responsibilities.
You could work overtime.
Okay, that's fine.
Overtime needs to be approved.
Any hours worked without approval.
That's fine.
Client mandatory break period is 15.
Yes, yes, mandatory break period.
And between 15 to 13, I don't get paid in essence.
Correct.
Okay, that's fine.
And then you'd be expected to work with cyber fox.
It is portfolio client based during the period as this is a mental period.
Okay, this is for the December part.
Probation three months from the date of fixed-term contractual appointment.
Okay, that's fine.
Mayor transfer you to another location department affiliation.
That's fine.
Compensation changes in your compensation.
Compensation packet and your leave.
That's fine.
When you intend to take an annual leave, this and that responsibility.
The view of your position and office, you will be expected to perform all duties.
Okay, that's fine.
Specifically recorded that you should not arrange in activity,
engaging activities that have all have an adverse impact on the reputation
and image of the business company.
Okay, that's fine.
Engaging in conduct that could harm cyber fox,
making public statements or representation,
acting in a manner that creates that.
Okay, that's fine.
You may require.
So activity that you may require to incur travel expenses
with regards to cyber fox work and or their clients work,
which you believe best as better than cyber fox.
That the cyber fox are committed to ensure integrity in all aspects.
Okay, that's fine.
The policies will be made available to you with this agreement.
Consequently are required to understand the scope and intend.
Okay, that's fine.
Policies updated, modified on a periodic basis,
consistent with the point D,
which is committed to ensure integrity in all aspects.
They are expected to comply with the policies.
Policies updated, modified on a periodic base
and new policies consistent with point D above.
Okay.
Specifically, specifically recorded that the policies form part of the agreement.
Okay, that's fine.
Conflict of interest, which I understand,
not take up any independent or individual assignments
in any capacity whatsoever,
directly or indirectly without the express return.
You may not undertake it individually.
I can't do any other work.
But this is related to anything IT related, am I correct?
IT related, IT placed.
Okay, all right, cool.
It is agreed that you will not during your employment
that for a period of one year from session of your employment
with that any circumstances of all the reasons for the session
to not to solicit, induce or encourage an employee
to terminate their employment,
any customer or vendor to move his existing business with that.
Okay.
Any existing Zephyr Fox employee,
potential new employee to become associated with
or perform services of any type of third party.
In case of any conflict or doubt,
please discuss the matter with your business unit head.
Your acknowledge that each of the restraints and undertaking
then includes five.
Okay, that's fine.
Confidentiality and undertaking.
Okay.
Confidentiality, information may be in respect
in business, technical, commercial systems
and know-how trades.
Yeah, that's fine.
Shall not disclose to others or make direct or indirect use
of confidential information.
That's fine.
Shall not ensure that all measures necessary are taken to secure.
Reproduce, transmit or store any confidential retrieval system.
Employee shall only permit access to confidential information.
Okay.
The employee shall obtain undertakings from the employees,
professional advisors.
Failed to that if the employee is uncertain
whether any information is to be treated as confidential.
Upon termination shall retain employer
all documentation, information and equipment.
Okay, that's fine.
That he agrees to sign a separate data protection confidentiality.
Okay, that's fine.
The employee acknowledges and agrees that the employer
shall by operation of law become one of the copyrights.
That's fine.
Employee hereby codes and signs to the employer
the copyright, intellectual property.
Termination of employees' employment to the employer.
Employee shall retain all the employer's property.
Okay, that's fine.
Property ended to an employee
during the period to be protected and cared for by that.
That's fine.
Responsibility of all employers' property.
Yes, that's fine.
I understand that.
Employee agrees and authorizes the employer
to deduct from his salary any amounts owed.
Employer for losses or damage.
That's okay.
Non-compete in the course of your employment.
You'll be providing service client that, that, that.
During which process you would be handling sensitive information
including but not limited to key customers of that.
That's fine.
You acknowledge and recognize
that confidential information available if leaked
would cause imperable harm to Zerba Fox and its protection.
Confirm that for a period of six months
after separation of your employment.
You confirm that a period of six months
after separation of your employment to Zerba Fox,
you will not accept any offer of employment from your customer.
Now, doesn't it clash with the restraint of trade?
That's fine.
Yeah.
All right.
Code General, you want to have not provided us
with any false declaration.
Not that you are required to form us
if there are any agreements or written
which you have entered into
which may relate to or affect your commitments.
Your employment terms may be specific on that.
Your employment terms supersede
and replace any existing agreement.
Your and that you are not prevented by court
or any administrative judicial order.
That's fine.
Shall comply by all policies.
Okay, that's fine.
Place of work, depending on a particular project.
The employee may be expected to work at the employer's office
or at one of the employer's client's premises.
Yes.
The employee is expected to report to the above address daily
unless otherwise stated.
You know what?
I didn't read this part,
but this was not the agreement.
The employee...
Yes.
Wait.
The employee is expected to report to the above address daily
unless otherwise stated by the CyberFox HRA Department.
Please repeat your previous statement.
Yes.
Yes.
Yes.
Yes.
Wait, wait.
This physical address that's written here is CyberFox.
Not...
Yes.
Okay.
But I then was told that I would be going to Investec,
which is the client.
Yeah.
Oh, that's fine.
Investec, yes.
It's...
Yeah.
Mm-hmm.
So the very first initial agreement
was two or three days at the office,
which is the client, Investec,
and the rest is remote,
because as far as what's his name,
the Indian guy, I'm forgetting,
Devin, right?
He said to me,
the client wants somebody that comes to the office
two days, three at most,
but the other days are remote.
So literally that's been a thing.
If I had known that it's daily,
it's either at the client or at CyberFox,
I wouldn't have taken this contract.
Not because of anything bad about going to the office
or anything malicious,
but I've preferred remote working
because I'm more productive when I'm remote, right?
So it was a situation where two days I can be in the office,
no problem,
but I've got another two or three days
to be able to concentrate on my work
when it's quiet and all that.
Client, yes.
Yes, because his question was,
are you comfortable going to the office
two or three days, right?
It's been quiet.
Then I'm like, no, two or three days, it's okay.
And the rest is remote.
Yes.
Yes?
Yes, I'm okay.
So the agreement basically was,
I work based on what the client wants, right?
I get to investigate and they say,
we're increasing from two days to five days.
Then no problem.
My surprise is me reporting to CyberFox in four ways.
That's where my surprise is.
That's all.
But if client says,
I want you in the office five days, right?
I'll go five days, right?
With no problem at all.
But as for the initial conversation that we had,
it was a situation where it's remote, right?
With two days or three days based on what investor wants,
which is the client,
but the rest of the days is remote.
Initial conversation and everything, yeah.
I think the alternative, which is address of the client,
that I understand it's invested.
We spoke about two or three days about that.
The reporting to the CyberFox office,
I don't think it's an issue,
but that was never the initial chart, right?
That was not the initial chart.
And I think while I was going through, in my mind,
I need to report to Investec number of days.
The other days are remote as per the initial chart.
Place of work didn't look deep into it.
I actually looked at other things,
you understand, of trade and whatnot.
Yeah.
That's no problem.
When Investec says that or when CyberFox says,
for me to come to CyberFox for a few hours,
that's not a problem.
Look, I'm not saying I don't even want to step there.
We're on the same page, yes.
Yeah, yeah.
I overlooked.
Honestly, I overlooked this part.
But two or three days, the client, I know that.
The rest of the days, remotely.
And yes, that's my current understanding.
And if Investec says,
dude, we want you for five days,
probably because there's a lot of work
or because we've got a whole lot of meetings
and all that stuff, no problem.
Because there is also probably meetings
that need to happen in person.
And it's on a Thursday.
If the day was Monday, Wednesday,
Monday, Tuesday, Wednesday,
and the Thursday there's a meeting,
I would definitely go.
I got no problem.
But yes.
Yes.
Yes.
I need to discuss the discussion
because that was not the agreement.
That was not the conversation
that we had from the web.
My first preference would be 100% remote.
Year-end day teaching in the office, I don't mind.
So I've always wanted the flexibility
of working from remote,
but with the option of getting into the office.
It's just, I think, with the client, I understand.
But I think let me have that flexibility.
With my employer, let me have my flexibility.
Yes.
The majority of my responsibilities
is invested in my duties.
Unless they have to sit down with me
and tell me in time to say,
we've got a new client where we feel
your skill set would make a difference.
Can you please go to this client now,
hold on with Investec,
or can you assist with this project?
We'll tell Investec that you're going to assist
with this project and all that.
It's a discussion that needs to happen.
I'm okay with that.
Yeah, I'm not against it.
There just needs to be that clarity, that discussion.
Yeah.
12th notice period on standard probation,
three months, contractual appointment,
fixed-term contractual, general notice,
fixed-term contractual employment,
terminable with 30 days written notice.
That's fine.
Choose to cancel existing contract,
can't date during probation period.
Within the contract, this can be due to a variety of reasons,
including but not limited to poor performance
and desired results.
Please take additional notes,
section of one C1 and C2,
if the contract is always closed.
And that's fine.
One C1.
What does it say?
One C1.
Placement stipulated,
you are required to fulfill this placement
as part of your fixed-term contract.
You do not fulfill this.
You would choose to leave within contractual
or hold your labor breach of contract.
Okay, that's fine.
To cancel or extend the existing contract,
the decision will directly impact the current contract.
Okay, that's fine.
Understood.
Let's see.
I've got another meeting that I need to hop on into.
Yeah, let me just go through it very quickly.
So termination of contract, that's fine.
Damages.
Yeah.
Damages to the employer after we search,
calculate an amount shall be due to this contract prematurely.
Damages will be incurred.
The damages will be quantified accordingly
and calculated on the basis weight.
Contract allows that it is a fixed-term contract
and is bound to work for the duration of the contract.
The contractor acknowledges that if he terminates,
he or she terminates the contract prematurely,
what's prematurely?
Okay.
The damages will be incurred, right?
The damages will be quantified accordingly
and calculated on the basis of the financial loss
and reputational damage to the employer
after which such calculated amount shall become due
and payable by the contractor to the employer,
failing which the appropriate legal steps
shall be taken to recover the same
or legal costs shall be on for the contractor's account
and calculated on an atonic client basis.
Now, in what circumstance is it determined causing damages?
Just hold on.
Hold on one second.
Let me just say almost done.
Okay, cool.
You were saying?
Yeah, or just deciding one notice period or anything.
Yeah.
Okay.
Okay.
Now, that's fine.
Validity of contract, which will obviously be fixed-term.
Commencement that the fixed-term employee
or contractor failed on should it be revealed at any time
after commencement of employment
that the fixed-term employee or contractor failed
or neglected to inform the employer
of any circumstances or information relating to
the fixed-term employee, personal circumstances,
state of health, criminal record, credit record,
or addictions to drugs or substances,
in a way the employer's decision to employ
or not to employ the fixed-term
or to attend this employment contract shall be
immediately rendered null and void
and shall be of no force and effect.
Okay, that's fine.
Fixed-term is responsible to ensure his work permit,
identity documented, other legal documents are valid.
Okay, that's fine.
Employee checks and declaration compliance
attestation are mandatory,
must be carried out and validated by that.
If this is not validated, sorry,
must be carried out and validated by this.
So this is employee checks and declaration
compliance attestations, okay,
and must be carried out and validated by Zappa Fox
or client prior and during your employment contractual period.
If this is not accepted, verified,
or validated at any time during employment,
then your employment status must be affected
and may lead to your employment contract being terminated.
In relation to work permits upon signing of the employment contract,
the fixed-term employee needs to provide HR with these
or a updated change of employer-valid employment
within two months of the employment contract being signed.
Okay, that's fine.
That's fine, no problem.
In acceptance of separation notice,
you immediately give up the company before you're relieved.
Separation notice, you immediately give up to the company
before you're relieved.
All correspondence, specifications, formula, books,
documents, cost of data, blah, blah, blah, blah.
Okay, that's fine.
Offer to be used as a renegotiation tool.
Other companies, you know,
is it to be used as a renegotiation tool
and counteroffer that no client...
If this is okay, it will be noted back to senior management
for further action.
Please confirm that the above terms are kept.
That's fine.
I think I get that.
I'm then down to fixed during my employment
into collect, organize, process,
and store my personal information.
Use this personal information for screening,
appointments, training, and development.
Share my personal information with a third party,
such as our suppliers,
that should be relevant personal information.
So understand and accept that it's my responsibility
to keep this information up to date by notifying that.
Okay, authorizing consent.
It's executive directors, blah, blah, blah.
Okay, that's fine.
No problem.
So I think it's just a part of confirming the remote part
or the voting to Zimbabwe Fox office part, yeah.
Yeah, I would...
Even if it's the other part,
I would want Tevin to be there, please, in the meeting.
Even if...
Yeah, you are the one that I discussed the issue,
so I would prefer you being there.
If the investor says five days, that's good.
If it says three days, that's good.
If it says two days, that's good.
But as far as the conversation,
it was remote for the other days that I'm not in the office.
That's interesting.
Yeah.
Yes.
Coming to Zimbabwe Fox office,
it's not a conversation that I heard.
It's something that we can...
that we need to talk about.
Yeah.
No, that should be good.
Yeah.
Yes.
Thank you.
Okay.
All right.
Cool.
No problem.
All right.
Cheers.
How's it, guys?
I'm back.
Sorry it took longer than expected.
Okay.
Where are we?
Who is having issues?
Who is winning?
I think we're starting number seven.
Okay, cool.
So you're now going to number eight.
You can go to number eight.
Yeah.
So when we, for example, let's say for the next classes, right?
If I do the theory part and then I say, okay,
next would be number six, number seven, number eight, right?
I'm giving you the guide.
If you do it fast and you're not having any problems, no problem.
You don't really have to wait for others, right?
You can continue to the next one.
So now you're going to do eight and number nine,
and then you can do exercise day two.
There's no reason to keep holding you,
waiting for the others,
and yet your things are going on smoothly.
Probably you managed to troubleshoot and whatnot,
and life is moving good.
No problem.
Colophel, are you good?
You're not sure?
Okay.
No problem.
Yeah.
You know what?
Yes.
Yes.
Oh, now the idea behind it is you need to be in that.
So if you go into Mongo, yes, right.
And then change to use that database.
That's where you're going to do your sharding.
So you're not in Mongo S as far as I can see.
You're Mongo S.
Nope.
You're not in Mongo S.
I'll tell you why you're not in Mongo S.
I'll show you something.
So you're not in Mongo S.
I'll tell you why I say you're not in Mongo S.
Now, get that Mongo S edge, port 27, 010, whatever.
Okay.
Let me change my screen.
Now.
Yeah.
Cool.
So now get into that one.
That's got enter.
Do you see something?
Yeah.
At the end, it tells you Mongo S.
That's what it tells you that you're in Mongo S.
You're in the outer.
Now change that to whatever database it is.
I think it was, I don't remember the name.
Sorry.
Use my database.
And then you can now do the sharding.
Okay.
That's fine.
Faith, my faith.
Faith, faith is the substance of what, what and sin.
Are you winning or you are busy?
Okay, that's fine.
No problem.
Yes.
Yeah.
Yeah.
Yeah.
It's your, your answer is your face.
You're looking at your answer.
So, um, just to, um, because, uh, what you call this, let me just share your screen
because I know that, uh, the rest are going to come with that also.
Uh,
Now, remember I did say that, uh, can you see the screen?
Your screen.
I did say that sometimes now all of a sudden, I'm not sure when it started.
Sometimes you can't create a shard key without indexing, right?
You need to create an index of the same field and then you can use it as a
shard key.
So what you need to do is exit mongo s get into the, um, database that's got
that hash.
I'm not sure if you try and index it from there, if it works.
So wait, wait before do that.
Um, I think it's db dot, um, the collection name.
The collection name is books dot create index.
I think the, um, the I is capital letter.
I think index and then, uh, open bracket and then underscore ID, uh,
underscore ID, underscore ID, and then, then the two dots full colon and
then hashed in brackets.
Um, in, in code, sorry, I should be in course.
Yeah.
I meant I might be missing something I think, but yeah, let's just run it
like that and then close the bracket.
I might be missing something.
Uh, the expected token index ID that, uh, okay, hold on.
I'll tell you now.
Next.
Um, I did that.
Yeah.
Try it now.
Yeah.
So you, you, now you can try with them as edge dot something,
Uh-huh.
They are.
So you needed to create the index first.
Yeah.
Yeah.
So all of all and faith.
This command is going to be, um, it's going to be, um,
it's going to be important for you.
This one.
Well, I hope I can copy it out.
Okay.
So when it gives you that you need to use the create,
when you're creating a shard of the hash ID number ID,
it's going to ask you to create an index.
That's creating an index.
Yes.
Uh, wait.
Am I on Austin?
Yes.
Let's, we see a control that, uh,
MongoD replica set.
What's that?
Um, go down.
Screen, press enter.
I want to see what's at the bottom.
Okay.
Go up a bit.
Um, so do, um,
my issue that I'm picking up is you want to create another replica set
with ports that are being used.
27 19 is being used already.
Um,
I said,
do you remember to create those folders?
So you see, um, what I was saying earlier on that, um,
there's some times where you need to go and probably figure out
something based on something that you've done before.
Right.
So before you even run those commands to set up a replica set,
go and create those folders.
After you create those folders,
check the posts that are being used on the previous replica set.
Right.
And then come and create the replica set with different, um,
port numbers.
You can actually.
Two seven zero.
Right.
You can leave it like that.
You can even use 44 to 142 at the end.
Yeah.
Yes.
What era are you getting?
Let's start from there to your screen.
Yes.
I'm here.
Open your terminal.
Uh, wait, I want to see something here.
This is your history.
But you got this era.
This one.
Right.
Cool.
now, uh, 17, 18, 19, 17,
uh, 19 are being used already, so you can't use them.
Right.
That's number one.
Number two.
Remember when you're creating a replica set on the,
on this one where you're creating the sharding,
you needed to create this folders first.
That is one.
So you need to create data.
Is one data.
That is two data.
That is three first.
Right.
As folders are using minus P something, something,
I'm forgetting the other command.
And then after that,
please use different numbers because these numbers are used already.
This port numbers are used already.
So you just, you can just say even 41, 42, 43.
So two seven zero,
leave it as is,
and then you do a 41, 42, 43.
Then it will start.
Then you can continue the next one.
Yeah.
Yeah.
But also remember when,
when you need to do this,
you need to log into this one.
The very first one.
And then you add them there.
The same concept that we used on the sharding is the same concept with this.
It's just that this one doesn't have all the steps,
trying to get you to think about the previous steps that you did.
That makes sense.
Yeah.
Where is it? Is it color fellow?
Okay.
Go back to your terminal.
Go back to your terminal.
So where is the issue?
Where is your issue?
Let's start from there.
Your only,
your only issue there is you didn't add the relevant port for the mongo s.
So mongo sh.
mongo sh.
Oh, sorry.
All right.
Oh, 10.
Yes.
Yeah.
Dash dash port.
Sorry.
mongo s.
But no, no, no.
Exit that.
mongo sh dash dash port.
Dash dash port in space and then 2017.
Uh huh.
Now we are in mongo sh.
Yes.
Then you can enable your shards from.
Yeah, there is a part where it's going to fail to do the sharding because of creating of an index.
So you enable the sharding, right?
Yes.
Now do the, what do you call this?
The next step where it is db shard collection ID hashed.
Yes.
Let me just close my windows.
Uh huh.
Paste that.
Uh huh.
Okay.
So your indexing is right.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
I'm back guys.
Uh huh.
Yes.
Okay.
Let's see.
Let me take over the screen quickly.
Just want to check something quickly.
I'm going to share your screen.
Your mongo sh is not running.
I don't see mongo sh here.
So your mongo sh is not running.
So just go back to your github repo, the instructions.
So what you need to sort out, just hold on.
Hold on.
I'll show you.
Yeah.
So what you need to run is s1.
And then we should have running one.
And then net start minus ntlp.
Your mongo sh is now running.
Which means you can now mongo sh into that.
Cool.
Yeah.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
Okay.
I've shared it, let's go up a little bit more space with this, put, okay hold on, hold
on, hold on, hold on, hold on, wait, hold on, okay, yeah, so when is that moving
okay, so it's called my replica set, now me being me, this is what I'll do, I'll come here and do this
is it a replica set for a shard or for a thingy or for the config server, are you sure, is it a config server or a shard, you've got it, so you can create a config server but you've got a config server already, so rather create this as shards, right, and when you create them as a replica set of a shard not a config server, right,
you can always come to this and then come here, what is your DB path again, it was, it's DB path and then data and then other is one, right, and you want to change this to 41 and you want to
shard server, my replica set and we were calling it my replica set, yes, I'm not sure I understand this, yes, but you've created these directories, right, already, so then it's a matter of just changing some stuff created, after creating the directories, so the logic behind it, right, is you're still going to create a shard server, right,
the replica set of a shard, right, because replication and durability, right, and then you've got this, and then you verify this, what you call this DB what what, but now, remember, you created a database, right, you enabled sharding and whatnot on the specific database, now you need to create a replica set, what replica set are you going to create,
they're going to create a replica set for a shard, because what the config server already, right, if that makes sense, if I run one, I've run one already, where is the screen again, that's why I said some of the things need you to think back logically, right, that's where,
but you're not changing the whole thing, though, you didn't, I didn't change the whole thing, right, I changed the name, right, back to this one, and I just added the log path, and change the port number, so we can always do this, yes, now the logic thinking would be, right, what you call this, am I creating a shard or am I creating a server,
right, if you fork it, does it work, it doesn't work, right, then you come there, control Z, and then now you need to fork it, you need to give it the log path, and then the dash, dash four, right, wait, I think I've not changed,
I've not changed the port also, right, 42, yes, yes, 42, let's try it again, see if it works, it won't work, so you need that dash, dash four, you see, you need it, and then here, you can come, change it to three, and then you come, change it here to three,
and then enter, it creates that now, you now need to make the first one, 2041, the primary for this replica set, you log into that primary, you initiate the cluster from there, the replica set cluster from there,
the same way, the same way that you did it on the sharding, what you call this, the sharding exercise is more or less the same steps, now, the idea behind this was adding the elements like your fork and whatnot, that's where you would need to think through,
because remember, when it comes to into the real world, not everything is serpent stone, right, you would find that you need to set up three replicas, right, three different replicas, now when you need to define three different replicas,
one, you need to decide the config server, right, the replica for the config server, and now you need to decide, am I doing the shard, or am I doing a config server, now you've done the config server, and then you need to do the shard server,
right, the replica for the shards, that's when you now take the step to actually do the shard server, the difference, if you, if you noticed it is that, this part here, right, it's either you're telling it to be a shard server, or to be a config server,
makes sense, oh, no, no, yeah, right, the explaining is good, the, the implementation is what's going to be interesting, the explanation, the explanation, you did it right, so firstly, you need to create folders, after you create folders, which is your, your path, right, where your, your DB path, right,
where your replica set is going to be writing to, right, the second thing is, they gave you a very short command, right, which is this one, but this won't work, right, what would work is, one, you need to tell it, what is it, is it a config server, or it is a shard server, right,
config server, you already have it, so in essence, you're now creating a shard server, right, a replica set for shard server, now, that's where this command now kicks in, right, in full, because it's already there, you already have it, right, instead of you having to worry in your mind and whatnot, that one will fail, all you need to do is come and copy this command, right,
one of it, and then change the name of the replica set, because remember, it's written my replica set, if I'm not mistaken, right, change that name, change the port, because already this one is in use, even the ones that are there, they are already in use, so you change that, you change that, and then you change the path to where you want your shard to be writing to, and then you run that command, then you'll be able to create,
what's that, the command, can I use the bathroom quickly, one second,
do you see your issue, Austin, the name is actually there, the name is actually there, you don't need to go in, okay, manage to pick it up, hold on Austin, are you there, yes,
so, if you look at this, right, if you look at this, it already says, you initiate with the command line, right, initiate its name is my replica set, which is this one, you're initiating with this name, right, but command line set name is my replica set,
this one is on, it just told you that you just need to change this name, because you're initiating with this name, but command line used this name,
where are you logged into, are you in the replica, are you in the replica set, so it says Slave OK is not a function, go into MongoS and try it in MongoS,
in the secondary or you can try it while it's in the MongoS, no, no, no, still you're not, you're not, you need MongoS, not use the database, you're tired,
you're tired, you need to do MongoS and try it from MongoS, you need to log into a secondary and then try it from the secondary, it's either you log into the secondary or you log into MongoS,
no problem, okay cool, try it on a secondary one, they are not really but they are closed, so if we go back to what we learnt, right,
let me share my slides, I need you to do something, do you remember this part, can you see my screen, do you remember this part,
so instructions there, right, make you create a replica set and then ask you to check for a master slave replication, it's asking you to check for something that's not there, if that makes sense,
so you are making, so there's master slave replication and then there's a replica set replication, right, master slave has deprecated, right, it's not there anymore, right,
in the midst of you creating, what do you call this, a replica set, right, which is a new feature, right, it's asking you to check master slave, so you're very right, it shouldn't work,
so in essence it's trying to sort of test you to see, are you realising that you've created a replica set, right, which is a replica set replication and not a master slave,
that we're saying is not deprecated and we now use replica, what do you call this, replica set instead of master slave, that one command is something that's confirming what you call a master slave replication,
which is not deprecated, it's a feature that's deprecated, now the migration part, right, there's some way it says migration, this is in the case that you've got an old version that still has master slave,
right, and you now want to migrate to a new version and you've upgraded to the new version and you now want to migrate from that master slave to replica set,
so that was just to test you to pick up that you were creating a replica set, not a master slave replica, yeah, so it's not supposed to work, everyone else got it?
No, but now you need to, so you need to understand that replicas are the ones that are there now, right, master and slave they've removed that feature, it's on the old version, the new version has got replica set,
so you wanting to have master slave in the new version, it won't end well, it won't work out well, it won't even work, and you see that even on the instruction it actually continues and tells you the master slave replication,
they send that in that, testing you that the initializing the master slave, yes,
but then you can then continue and do the, what you call this, using the right concern for durability, the only other issue is it's not much of a big chunk, right, of data that you're writing in it,
so you won't really see the difference in terms of if it is to acknowledge on 10 other machines or it is to acknowledge on three other machines or two other machines, if that makes sense, right, you won't see the difference, it's a very small chunk of data such that all of them will be quick anyway, right,
they're probably all less than two milliseconds, right, but if it was a big chunk of data that needed acknowledgement on different other slaves, right, or not different other slaves, different other secondary nodes, right, because remember you've got a primary node and then you've got secondary nodes,
our replica set only have two secondary nodes, right, so if you had to write on the primary, right, the acknowledgement from the two secondary nodes is going to be quick on the basis that one, the chunk of data that's being written is very small, the query in itself is very small,
so you might not see or notice the difference in terms of the time it takes to get the acknowledgement on two or just on the primary, because then the difference is very, very, very, very minimal, it might be some point something millisecond of which when it shows you the time, it'll probably just show you that it took one millisecond,
right, concern, but you might not be able to get the, what you call this, the result that you really want to see, but you can try it.
Which master and slave?
We've just come back from confirming that this won't work, the new version.
The master slave replication, yes, so you don't really need to worry about it, as I said, they put that for you to think that, okay, I'm doing master slave replication, but before that you are creating a replica set, right, not master type of thing.
That whole block is just going to confuse you, leave it alone because it won't work, but you can start from these right concern levels if you want to try them out.
You might not pick up the difference because the difference of the time is very, very minimal, like it's very, very minimal.
Yeah, it's less than a microsecond, millisecond, even though you might see the difference. So you can do it, it's up to you, but you might not really see that much of a difference.
I would say when you do backup and restore, because you might, which is number nine, and then you might need to then incorporate everything in your mind and then going to do exercise day two.
Right, so you can go and do up your backup and restore. Very, very simple. I don't think it should be a problem. And then after that you do exercise two.
Exercise day two, yes.
No problem.
Who is lost?
The color you lost. Wait, are you lost?
Let's see. Wait, let's see. I'm going to go on your screen and I'm going to share it. Let's see where you are.
Okay, cool.
Let's see where you are.
Okay, who wants to share? Who wants to share? Who wants to share? Then we can help. Okay, cool. Okay, one second. Number eight. On which part is it failing? Yes.
It's very easy. Exit that.
And then do pseudo space.
Net stat, so NETSTAT space minus NTLP net stat.
Okay, hold on.
You guys are tired.
Okay, cool. Do you want to run as pseudo or do you want to run?
Do you want to stay as pseudo?
So these are the replicas that are running. No, it's not missing.
It's not missing. Now let me explain. It's not missing.
Now, when we did sharding, right? When we did sharding earlier on, we created directories, which is fine.
And then we used 19, 20, 21, right?
And then we went and created the replica set, right? 22, 23, 24, 33.
Sorry, the shard server. So that was the config that was the shard server.
Now 17, by default, Mongo uses 27 or 717.
That's the default when it comes to MongoDB.
No wonder why it's there. That's number one.
Number two, 19, we used port 19 when we're creating the config server.
That's why you are seeing 17 and 19 there.
Now, as we now go to explain this one, right?
When you get to this part of creating, this is where, what's his name? Austin.
Then said, now, if you run this on its own, right?
It won't run. That's number one.
And because of two things, right?
The ports are already used. That's number one, right?
17 is already used. 19 is already used. That's number one.
Number two, there's missing parameters on the command, right?
Now, this is where he then said, okay, you instead of having to run this command because it will fail,
you then come onto this one, right?
Copy the first one.
See, copy this first one, right?
Because it's a complete one and it has worked before.
This is what config server.
The difference is just this part anyway.
But wait, says config server.
And this is shared server, right?
So you come, you copy that, right?
And then are what you then need to go and do is which one am I running?
It's this one. Yeah, you've got so many terminals open.
This one, this one.
Okay, that's the one that we're using now because that other command is failing, right?
You go and copy this command that's worked before.
It's a trick that I usually use, right?
And then you change this part to 40 or 41.
You change this part to the directory that you created, right?
That you last created.
I think it was db.
Was it db path or db data?
Let's see.
db path, then something.
So I want this part, right?
You created this directory, is it correct?
Just this directory.
Okay, cool.
So we, okay.
Oh, Jesus.
So, okay, that's fine.
Let's see what it will give us.
That's fine.
Right?
And then you need to change it to the name of the replica set.
So in this case, it was my replica set.
I think I'm not mistaken.
It's case sensitive.
But anyway, let's see.
Error child dash dash fork, which means this is not there, right?
And then er, datum, that is one.
And then this data is two.
Then space, datum, that is three.
Now, this step that I'm doing, we did it, right?
We did the same very step here.
This is the step that we're doing now on number seven.
Remember we're on number eight.
So the idea behind number eight is it will give you very small scenarios, right?
That you are going to need to use the logic from number seven, right?
So we created this.
We've done this step, right?
So I'm going to be doing this for each step.
I'll go back and reference on number seven, right?
So firstly, we create the folders, right?
After we create the folders, we go and run this successful because the folders are there now, right?
And then we go to the next one, which is going to change to 41 here, right?
And then, er, that is two, right?
And then we go to the next one, which are going to change here to three.
And then our port is going to be 42.
Now we've created our nodes.
But we haven't told any of them which one is the primary one, right?
Now we want to go to step number.
So we've done this part.
We've done this part, right?
We've created the folders.
We've created.
So we're doing shards, right?
Created the ports.
We've run this command, right?
To actually start each shared instance, right?
Now we want to tell which one is the primary, right?
We come here and then we log into the one that's the first one that we created, which was which is using port 40, right?
Forty there and then come here.
It's logged in.
Now we go back.
We want to what for this initiated, right?
So you either initiate it this way, right?
We want to initiate our replica set and make sure that we've got a primary.
So it's either you do it this way or you do it this way.
Both will still work.
Where you just come here, members and whatnot.
Now, when it comes to here, right?
What you should remember to do is remember the name of the replica set, right?
And I think the name of the replica set was everything in small letters, right?
You see this part.
Everything is in small letters.
So you now need to make sure that it's what exactly you put there.
If you put it the same way as replica set, right?
The same way with the caps and whatnot, then it's OK.
It will work out or else it will give you an error, right?
OK.
Oh, yes.
Thank you.
Thank you.
And then we had to change the ports to 40, 41 and then 42.
Right.
We have created our cluster, right?
And then sh.status.
Oh, sorry.
I'm not mongo.
Yes, sorry.
Your mongo s is on port 10, right?
Correct.
Cool.
Rs.status.
And then.
Oh, sorry.
It's a shard that we're creating.
Sorry.
I need to see the shards.
Sh.status.
I'm not going to get mongo s.
It might not work.
Why is it failing now?
Oh, OK.
I don't know why it failed earlier on.
But anyway, so now you've got a primary, right?
Which is on your 40.
You've got a secondary, which is on 41.
And you should have another secondary that's sitting on 42.
Now you've got your replica set, which is in shards.
Are you with me now?
Now it's like you've got three servers that are completely the same.
What database do you have experience with?
I want to use it as an example.
Any other database?
That's not MongoDB.
Any other flavor of database?
Oracle, right?
Oracle still does the master and slave, right?
Oh, wow, replication, if I'm not mistaken.
How do you do real-time replication?
So usually there will be one.
So there will be one.
So usually, right, with any database,
there's one server that's responsible for everything that comes in.
So your application writes to it and everything, right?
And it can still be the read.
But as a way to sort of have it as a backup plan, right?
You have another separate server where the first server just writes to it.
So everything is just copied over into server number B, right?
So it's not the same setup.
But in this instance, it's three nodes.
One is the primary.
It's going to receive all the writing.
So whenever you do an insert, you delete or anything,
it goes into the primary, right?
It happens.
All those operations happen in the primary.
The secondary are just there to replicate.
And to replicate is meaning to have the same copy of data on them as the primary.
Those are the secondary ones.
That's what we have currently.
Let me try and figure out.
Okay.
Let me try something.
Let me try and explain it a bit different.
I'm going to share my screen in a bit.
Okay.
I'm going to share a blank PowerPoint.
Let me know you can see my screen.
Now, let me try and demonstrate this in a different way, right?
So the command, right?
So we first created directories, right?
We all understand that part, right?
And now we want to create a replica of shards, right?
So a replica of shards would...
The very first one that had port 41, right,
is the first one that we created.
And then we created the one that had 41.
So this one is 40, 41, and then 42, right?
The difference there in these three are just the port numbers, right?
Because you want to connect to them,
and they all can't have the same port, right?
Now, we then logged into 41, right?
When we logged... Sorry, into 40, right?
The very first one.
When we logged into 40, we made 40 the primary, the main...
What do you call this?
The main shard or the main node, which is your primary node.
And then these ones became the secondary.
So the purpose of these two now is all they do is
they just make sure that they've got the same copy of data that's here.
So if there is data that's up until here,
this one has to make sure that it's also here.
This one has to make sure that it's also here.
The same data as is, right?
And when it comes to replicas,
what usually then will happen is this here, by default, right,
the primary is where everything is being written.
And this is where everything is, where everything,
where the read is happening, by default, right?
But what you can then do is instead of you actually having
what you call this, this read up in here,
you can actually direct your read to happen from these ones here, right?
So here, you are just left with the writing.
Here, it's just the reading that's happening.
So it listens to overload on this,
and then you have the read load onto this one.
Does it make sense, right?
So this is what we currently created.
Now, what will happen is when you do an insert for any data,
it will come and sit here, right?
It will come here first, right?
After it comes here as, what you call this, as a write, right?
Before it sends back an acknowledgement to the client, right?
If we put write content, write content will say,
let this one confirm that it has returned the data.
Let this one confirm that it has returned the data.
And then it will then return the response to the client.
Now, the client could be one.
It could be your MongoSH.
Remember, you do MongoSH and then you log in,
and then you can be able to run your queries, right?
It could be that, because remember, you get the response there, right?
That's one layer of it, right?
And then if it's an application code
that's being written by someone else, right?
Let me do this.
This is your MongoSH, right?
So if it's you and you're just running your queries,
you get your response on this layer, which is MongoSH.
When it's somebody that's writing code but doesn't have access,
their application is here, right?
Their code is here.
Now, in between is where comes the drivers
that are going to translate data, the response from here.
It goes through there.
It translates it to what is understood by this one.
Still together?
That's...
That's...
No, so this is what we currently just created, right?
So anything that you're going to do an insert or a delete,
it's going to get into this number one, right?
The 40.
And then it will replicate onto 41,
and then it will replicate onto 42.
Now, let's look at the very first one that we created.
What do you call this?
Let me do this.
Now, on number seven, right?
The very first thing that we did was we created a config server, right?
A config server, which is a replica set, right?
So you've got your config server.
Config server, config server.
That's number one.
So first we created the folders,
and then we created the config servers, right?
Which is a replica.
Replica set just means a copy of the same server.
That's it.
That's what is called a replica set.
You see that when you get to Docker and Kubernetes,
replica sets are going to be talking about them a lot.
It just means the same copy of a software, right?
But being in the same host, that's a replica, right?
And then after that, we then created a...
What do you call this?
Let me use blue, right?
We created shards, right?
Replica set of shards,
which means there is four copies of the same thing, right?
And be mindful that currently we are creating it on local host, right?
So everything is in one place.
This could actually be one server.
This could actually be another physical server or virtual machine.
This is different virtual machine.
This being another machine, this being another machine,
this being another machine, this being another machine.
That is when you want to...
When you're not using local host one machine,
but you're using many machines
when you've got the money like Photocom, right?
Now, what would then happen...
What we then did after that was we then started Mongo S, right?
Mongo S, which comes here, right?
Mongo S is that singular, right?
And what is actually happening is that...
What color can I use now?
Okay, purple.
What happens is when you interact...
When you want to interact with a shard, right,
you send data to Mongo S, right?
Mongo S goes and checks there to say what is configured
and where in terms of the shard.
After it confirms that, right,
it then goes to the respective shard
that it's been directed by the config server.
The purpose of this config server is just to maintain
the configuration and the settings and the metadata,
which explain which shard is containing what.
So let's say our shards are distributed.
Our data are in chunks such that this is A to E, right,
in terms of names,
and then you've got F to something, something, right?
And then you've got T, wait, not T, P to T, right,
on this one, and then U to Z, right?
U to Z.
Which means when this goes there,
it will be told all the information that you want
is in shard number four.
That's where information about Z is.
Then it comes and then goes there
and then picks up whatever it needs to pick up
and then retain the response from there
and then obviously to then go either to you
or to the application or whatever.
Do we understand this part?
That's, at the end of the day, that's the idea.
You need to leave a training list knowing the concept
or at least understanding a bit, right?
And when you start reading this, it shouldn't be new.
It shouldn't be new, new, new, right?
So the concept behind this now, right?
So you've got all this, right, as shards, right,
and this as config servers.
Now, we want to have high availability.
We want to be able to have what you call this
performance, very good performance, right?
Now, we've got our data center sitting somewhere, right?
And we are going to be using 10 servers, right?
We need to have 10 servers
that we are going to configure our MongoDB.
Now, we need to spread our data, right,
our performance across all those 10 servers.
Now, these are physical servers now, right?
Let's take it to say physical servers, right?
And these physical servers, we are going to have
what you call a MongoDB cluster,
which will be comprised of replica sets, right?
Now, the replica sets part of it,
what we need first is we need a config server.
So it might not be three.
We can even take two, right?
We can even take two and remain with eight.
The two, we make that a config server, right,
the config server, right?
And then the seven that's remaining, right?
No, it's eight that's remaining, right?
But the seven, that's what you call that a day.
We now make them into shards,
so which means it's going to be a copy of data,
a copy of data.
Sorry, it's going to be what you call this,
some data in there, some range,
some data in there, some range,
some data in there, some range,
which would actually be physical servers, right?
And then we take the one server
and then we configure our MongoS in there.
Because when we configure our MongoS,
we point it to these servers.
Now, where is it where we did the pointing
of those servers, right?
If we go to number, where are you?
Come, come, come, come.
If you go to number, who is this?
Why is it slow now?
Now, if you come to number seven, right?
And we go here, right?
So this is our two, okay, it went up too much.
We've done our two config servers, right?
One and two.
And then after that, we went and created our shards,
where we're going to distribute our data, right?
And these shards are part of a replica set,
which means the, our, what do you call this?
Our, oh, sorry, I deleted this, right?
Our shards, right?
Our shards that have got a data.
The data, the ranges of data, right?
Are all sitting in what you call a cluster, right?
Or a replica set, which means still has the ranges,
still has the ranges, still has the ranges,
still has the ranges, but you still find that
you still have the same data copied over.
But what will happen is when our Mongo S, right,
goes to the config server,
it's told that the information that you want, right,
is sitting in range A to D, right?
To then come and find range A to D in shard number one,
for example, if that's making sense.
Are we still together here?
People are tired.
People are tired.
Are we together or are we lost?
What you just need to understand is
you create what you call a cluster.
A cluster is a number of servers
that are working for the same purpose, right?
Because trust you me, cluster,
you're going to know about it here.
You're going to talk about it in Docker.
You're going to talk about it in Kubernetes
and all that stuff.
Modern technologies are dealing a whole lot in clusters.
And then in those clusters,
you can have what you call shards,
which is going to distribute your thingy in chunks,
your data in chunks, right?
And primary node receives everything
and then replicates onto the other nodes,
which are the secondary ones.
There is high availability.
Same copy is available on the next node and all that stuff.
Do you want, what you call this, half a day again
while it's still fresh, we can redo this?
Yes.
Sorry, you're saying?
Primary and?
Yes.
Yes.
So very good.
Now that's a master slave, right?
Type of situation,
because you can't automatically fail over.
Let's say the primary goes down.
What happens?
Can it automatically fail?
You have to intervene manually
and make one slave the primary, the master.
Let's say the master rather, right?
Now, same scenario where you've got the four servers,
one master and three slaves.
Now, when it comes to replication,
it's the same setup.
The only difference is that when the primary goes down,
which is your master,
automatically it can switch into one slave, right?
In the essence of Oracle,
you don't need to intervene manually.
It happens automatically, right?
But they all have the same type of data
as you're saying there is one main one and three backups,
one primary and three backups.
Automatically master slave type of situation,
but when it comes to replica sets,
we are saying there is that fail over part that happens, right?
Automatic fail over part that happens, right?
When it's a replica set, right?
Number one.
Number two, what do you call this?
With the, what do you call this?
With the master slave, right?
The very first scenario of Oracle.
The slave only pulls from the master.
It's never vice versa, right?
Now, if one goes down, right,
then you have to manually intervene
and reconfigure to make one.
If the primary goes down,
then you have to intervene automatically.
When it comes to replica set,
automatically one kicks in
and then everyone else just runs to start pulling from that.
What do you call this?
From that specific primary.
Automatically so.
But it's the same scenario.
Trust you me, the same scenario.
Just a few differences in terms of one,
the automatic fail over, for example.
Two and probably some features that are a bit different, right?
But it's the same scenario with just added technology to it, right?
And you now don't call it master slave type of thing.
You now call it replica set because of that fail over.
And it makes sure that the data across the nodes, right?
Across the three backups is exactly the same at all times.
When you have that right concern, right?
It waits for acknowledgement of the other three.
The other three backups to say it's fine.
I've written this data.
The second one says it's fine.
I've written this data.
The third one says it's fine.
I've written this data.
And then it brings back to the primary.
Primary then sends a response.
Of which, when it comes to the Oracle original setup that you spoke about, right?
You might not get, you don't get that acknowledgement
that everything is fine so you can continue everything.
No, no.
Primary will keep reading and writing.
If these ones are left behind, they are left behind and that's it.
Yeah.
But that's the very same concept.
Just that with some added features.
No, it's OK.
No problem.
Just that with some added features.
So the added feature is the automatic fail over, right?
That's number one.
Another added feature is the acknowledgement, right?
When a delete or when a write or delete an update or a write, right?
Comes through.
That query comes through.
It goes on to the primary, right?
Which is this one, right?
So we've got in the Oracle space, this is the primary.
This is a slave backup, slave backup, slave backup.
Or this is the backup, backup, backup, right?
So in the replica set side of things, this one goes down, right?
This one or this one or this one can kick in automatically
and become the primer, right?
So life continues, right?
If this one becomes the primary, this one just connects to this one
and starts having the, what do you call this, synchronizing, right?
Now, that's the automatic fail over part.
Now, when it comes to having the same type of data across, right?
A request comes in, which is a query that's going to insert into a document or delete, right?
Then what will happen is it will come, it will do its initial writing here.
Now, it goes there, it does its writing,
and then this one confirms to primary that I am good.
I've got all the data.
It goes on to the next one.
I'm good.
I've got all the data.
Then it comes there, acknowledges that I've got all the data to the primary
and then primary gives a response back to the client,
whether it's somebody that's just running direct on the DB or it's an application.
Okay, cool.
So the last part would obviously be exercise day two.
You guys can take it at your own time.
The one thing that I need you guys to confirm you did was this, right?
Let's see.
No, I don't want this.
Can someone share their screen?
I want you to go into the account.
The desktop account, not the virtual machine,
but something that shows you your machine and my machine, if that makes sense.
Probably Austin, can you share your screen?
No, get out of the good desktop.
Go down.
So you see where it says use desktop after course.
Just go down.
Please enable that, right?
And then enable.
It's going to give you access.
I'm not sure of the period.
I think it's a month or two months, access to this virtual machine.
And you still have access to the GitHub repo, right?
To do it at whatever time, right?
And then what I'm going to do is I'm going to share my email.
If you decide you want to have another half day,
I've shared my email, get in touch.
And then you see where we can find a gap.
And then we can still redo the replica sets and what not.
If it's a bit of more explaining or a bit of more exercise that will get you to understand.
I can also try and add more chunk of data in the database
so that you can be able to see when you create ranges,
how then you then see the ranges and what not.
It's a bit more advanced, more than this course,
but it could actually help you in terms of how you can go about it.
Yeah?
Because now I can see people are frightened.
They did well.
But look, when it was time to leave, everybody was like, ah, we're leaving.
We're leaving.
Some were doing it.
I know E2 was doing it.
I know I think a lady called Winnie.
I'm not mistaken.
She was also doing the work.
Some were on and off.
I'm assuming probably there was a whole lot of work and what not.
So for the others, I'm not sure.
But E2 and Winnie, they were doing well.
They got to understand it and all that.
I'm assuming they got to understand it.
OK, that's fine.
No problem.
You also have access to that GitHub, whether in the virtual machine or not.
Let me just share it quickly.
Yeah, so I think go try to understand how replication works, right,
in general, from the way from the first in general.
How does it work?
Right.
And because replication is not only in MongoDB, it's going to come in
Docker and Kubernetes also.
So understand how replication works, right?
Separately.
And then go and understand how the sharding and the config server work together.
Right.
And in terms of creating replica sets and whatnot, go understand that and go
as deep as sort of finding out an architecture of what you call this MongoDB
cluster that's got replica sets of shards and whatnot.
It would help you a lot.
Coolies.
Coolies.
But yeah, you have access to the virtual machine.
You've got access to the GitHub repo.
I gave you guys my email.
If anything, you can just email me.
Then we can see how we can work together.
Well, can Liz stop the recording?
Cool.
Yeah.
But yes, happy to do that.
Not a problem.
The sharding when it comes to real life, interpreting it in real life is where the
problem comes in, I think.
You know, so yes, if you have a project that you were probably working on or
whatever, and you've got questions, happy to help.
I don't have a problem.
Yes.
All right.
Cool.
No problem.
No problem at all.
If anything, as I said, email me.
Yeah.
If I don't respond to an email in an hour, I am probably traveling, but I won't
be traveling up until I think it's in June.
Yeah.
In June.
That's when I'll be traveling.
But as of now, I'm around, so I have no problem.
All right.
Cool, guys.
If there's no other questions, thank you for listening.
Unfortunately, I had to fry your brains.
But yeah, a glass of wine would probably do.
A glass of beer would probably do.
Lacks.
And then you'll be good to go for tomorrow.
No worries.
No problem at all.
All right.
Cheers, guys.
Cheers.
Okay.
All right.
All right.
Okay.
No, they should get his case.
I think it's him.
Hello, Bob.
Okay.
Bye.
Bye.
Hello.
Oh, the mailing is in Mishi.
Hello.
I'm going to walk around the room.
Okay.
I will see you guys.
Hi.
So you.
Yeah, yeah.
Let me just say one thing.
I'm
but then okay.
I don't know.
I don't know what it is. So,
That's why I go.
That's why I go.
Okay.
How much is it?
We have a banana.
I don't know.
That's why we have a banana.
We have a banana.
So we need to put it here.
So we can eat it.
We need to put it here.
We have a giant banana.
A giant banana.
It's not a giant banana.
Yeah.
I don't know what it is.
Oh sgs default.
Oh sgs default.
Something like family
Something like family
thing like family or
from
my
my
I love you.
I love you.
I love you.
I love you.
I love you.
I love you.
Okay.
Okay.
Okay.
Okay.
Okay.
So,
So,
I'm
so useful that I could see
so useful that I could see
so useful that I could see you keep.
I love you.
So
Hello.
Hello.
Okay.
I'm
I'm
I'm
I love you. I miss you.
I love you. I miss you.
I love you. I miss you.
I'm pregnant.
I'm pregnant.
I'm pregnant.
How are you?
I'm fine.
After morning?
I'm fine.
I'm fine.
How are you?
I'm fine.
Come baby, I miss you.
Okay.
Okay.
Okay.
So nice.
So nice.
So nice.
Hey.
You know.
Man.
Because
Well.
I'm going to.
I'm going to.
I'm going to.
I'm going to.
I'm going to.
Three years.
Oh yeah.
Hello.
Come on.
But it did.
Oh yeah.
I'm right.
Okay.
I'm
Okay.
Okay, man.
Young shop.
Man.
Okay, it's fine.
No.
Okay.
Come on.
Excuse me.
Hi.
Hi.
I'm
I'm
I'm
He has
I'm
I'm
Okay.
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
I'm
Okay.
Okay.
So,
So,
So,
I'm
I'm
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,
So,