One and this we we're going to look at some cluster command related to slot's and key names.
So as I mentioned before in the previous video, we can use cluster info to get all the information
about the cluster.
And if you need all the commands related to cluster, you can do cluster and help again.
So there's a lot of good commands over here.
So very first command, I want to show you is definitely is called Cluster Slot's.
And this return to information of a large range mapping is really made of star and master of the IP
address portion.
So if I do cluster and slot's, this will give you all the slots where they are, as you did five six
five four six zero, which server they are, what is the replica here, et cetera.
So all the range and everything coming up.
OK, now the second command I want to show you is that whenever we know that when we do set K to be
to what happened over here is basically it's the reader's calculate the key hash for this this name
based on the name over here, and then move you to that particular server and then added that data in
that slot.
OK, so this is a four four nine slot.
OK, so if I do over here, we were at seven zero zero two.
But because we put a set key which should belong to seven zero zero five server, it's moved to seven
zero zero five.
And now we have a key to inside that.
OK.
So what if you want to find out what would be the typical key, the hash key had sloshed for a particular
key, then there is a command for that, which is called cluster key slot, and then you define whatever
you're looking for.
So if I talk to here, you can see that it's returning back.
That key should go to is, what, four four nine.
OK, so this should go into four four nine.
And we know that four four nine should be in which slot.
So from zero to five thousand four five four six zero.
So this should be over here, i.e. there should be in this master seven zero zero five.
And that is exactly what happened here.
So key zero on seven zero zero five shows that, yes, you should be with that.
Similarly, if I say or what name, then it should be five seven nine eight five seven nine.
It should be in the seven zero zero two.
Right.
So let's look at it over here and try to name two here and see one, two, nine, three, three.
So let's send this over here.
And one two nine nine three three should be.
So one, two nine should be somewhere I seven zero zero three.
Let's see if we do.
Name one.
Name one and one.
It sets over to our server or not.
Write is directed to seven zero zero three over here.
Right.
And all information is there.
So if you keep star, you can see that name one is added over here.
All right.
So cluster key slot giving a particular name will help you where the key will go.
OK, so if you name three, this will show you that this is the key slot for this particular key.
The slot should be there.
Now, this particular compound is pretty useful when you want to move a particular keys to different
servers and stuff like that.
So you one of the probably first checked all the nomenclature that you want to use it for the keys because
this is important.
You don't want to populate a lot of keys to a one master like resides in one master.
You probably want to distribute it at the same time, but we know that the radius by itself calculate
everything by itself is the CRC 13, which applied to this key, and then it becomes a key hash and
then it's in the key slot accordingly.
OK, but clustered key sort of key slot is very, very important, whereby you can look at information
based on a key name where it should go in, what, four slots it should go hash slot.
Now if you want to list a keys to a particular slot, then there is a key that is a help command for
that.
So if I took.
Hash, if I do Kluster to help you can see get keys in slot and then you define key slots.
What is this slot number that you looking at?
How many entries that you want to return back?
So it's basically a turn key names toward it and by the current in a slot by the coroner.
OK, so let's look at this guy over here.
Right.
So we know that we run a command recently.
Right.
That was four eight zero seven, right?
Correct.
So let's look at it over here.
So I'm going to say cluster.
Get his Inglot and let's look at this key and I'll take it and turn me one number two four four nine.
So first of all, let's see whether this particular key is inside or not.
And let's double check Kluster.
Key slot.
Name one.
OK, key slot.
Name one.
So one two nine nine asset classes.
The hash number.
Plus slot hash number.
OK.
All right.
So get these in slot.
This one and one.
And you can see that one is the name.
One is coming up.
OK, let's suppose if you have a lot of keys in that particular slots or so and you want to get like
ten records to come back, it will give you 10 ID cards, etc, etc..
OK, so this another very important in which gives you all the keys in a particular slot, but it works
on the current server.
If I do over here, let's say one to whatever.
Right.
It's going to give you an empty area.
It doesn't redirects you to one of the server, although this you might have some that come out of here
like and get keys and slot.
That's like a master Webbie.
Just tell you that, hey, this particular slot is in that particular server.
So it's a pretty useful as well.
But nevertheless, maybe than seven point zero they'll come up.
So documents three commands that I mentioned to you.
When is the cluster help?
The other one was slots.
Then you have a key slots where you can define your name or your key name and you can see what is this
slot number that goes to.
And then if you want to see all the keys in that particular slot on a current locked in server, then
the key, the command is clustered, get keys in slot, slot number and the count.
Right.
Pretty useful to look at it.