‫So the first thing we need to do is to spin up the darker instances for the Oscars, but in order to
‫do that, each doctor instances that we're going to spin up have to create that table, that magic table.
‫So the first thing I'm going to do is create a sequel script that creates the table, the initial table
‫that will have our stuff.
‫So let's do that.
‫So let's go to the directory here called, I don't know, sharding video, whatever.
‫And that is just swipe into this folder and then we're going to create as let's just create a neat sequel
‫file.
‫That's just a file that will have our create statement and a little bit sequel here.
‫Let's write some sequel, guys.
‫So what I want to do is like I want to create a table.
‫You are a table.
‫That's what I'm going to call it.
‫And if I still remember Sakal, we're going to do the first field goal I'd write.
‫And that's serial.
‫That means just incremental.
‫We don't really care about this field much.
‫Right.
‫It's not now.
‫Right.
‫And it's also a primary key.
‫And then the second field is Yoro, that's the long gural, and that's next, right.
‫And the third field is a moral underscore idea.
‫And that guy is just a character of five.
‫I want it to be five character.
‫Exactly.
‫All right.
‫So that's just essentially just the structure of the scheme of the table.
‫And because we want to spin up multiple answers, I want this to get executed every time it's open up
‫a new docker container.
‫Right.
‫So that's the first step.
‫Looks good.
‫This good looks good.
‫There's no errors, hopefully.
‫Right.
‫And let's just ride this thing.
‫That's the first step.
‫The second step is we need to write a docker file because our just random postscripts image won't do.
‫We need to create our own image that essentially executes that script.
‫So how do we do that?
‫So let's go ahead and create a docker file, then them here and then from the postscripts instance,
‫write the image.
‫I want to just literally add one one line of code.
‫I want to copy that.
‫And it's the sequel that just the file we wrote into a special folder called Docker Entry Point.
‫You need to be.
‫And what that does is essentially the moment you copy that and you spin up the container, that docker
‫container, the postscripts image will say, oh, there is a sequel file here, I'm going to execute
‫it.
‫That's what it does.
‫Right.
‫So anything you can write in that sequel file and it doesn't have to be called in it, by the way,
‫anything that you can call it, anything you want.
‫And that is going to execute him.
‫That's cool.
‫That's what we want.
‫Right.
‫So now we're ready.
‫So what are we going to do here is let's build the image.
‫Right?
‫And because we have to do going forward, let's build the image from which we're going to spin up the
‫containers.
‫So the next step is we want to build the image from that Docker file, because that's that's a special
‫image.
‫I don't want to run my posterous from just the vanilla Allscripts image.
‫I want to run from my this special image and let's build that image because nobody knows about it.
‫Right.
‫So why do we do it?
‫To build as many as I could do.
‫Docker build Dashty identical shard.
‫Right.
‫And that's how you named Target, this initial tag, the image Dashti.
‫I don't know what's called dash dash name, just like the container name, but people like to be confusing,
‫so I don't know.
‫And then once you do that you do a dot at the end.
‫That's very important because I want to build the current directory and then when you do that, that's
‫done.
‫So my image is called big shot.
‫Right?
‫I've always been up some container, guys.
‫Let's open up some containers.
‫Right.
‫And then finally, once we open up the container, I'm going to spin up also my PJI adamant container
‫to administrate or those things.
‫And then so let's open up Docker.
‫Ron Ashutosh name was always a good idea to give it a name.
‫I'm going to call it TKG Shahd one, OK?
‫The first chart.
‫We do this so you can see it is the first shot, the port is five, four, three, two, five, four,
‫three, two, and then the images short, remember, and that's it.
‫And how about we detach it because we don't really want like we don't want to occupy that terminal.
‫So do that.
‫And we have one short baby.
‫So let's spin up another shot on board.
‫Five, four, three, three, two.
‫Nice and for
‫sweet.
‫All right, guys, so just like that, we have three instances, database instances.
‫One is running on five, four, three two one zero four, four, three, three and three, four.
‫And by default, if I connect, I'm going to show you now all these shards.
‫Right.
‫I'm going to use PJI admin docker container.
‫I'm not going to show you how to spin up a PG admin because I already did it.
‫And all that video, go check it out.
‫I'm going to reference in here, but I already have a Docker image called PJI admin, so I'm going to
‫just use that one.
‫Right.
‫So it's essentially listening to Port Phi Phi Phi Phi.
‫Let's just check it out.
‫DG Admin.
‫That's the one.
‫I have it running for a long time now.
‫It's called DPG and it's called PJI Admin and listening aboard Phi Phi Phi Phi.
‫So I'm just going to use that to manage my my shorts.
‫How about that?
‫Let's just do that.
‫Let's show you that these shorts has been executed and spun up and then have the scheme of the table.
‫And those tables have have to be empty, obviously.
‫Right.
‫All right, guys, so I have PJI admin here.
‫I logged in and then let's go let's start adding my servers, my database server.
‫So I'm going to add a server.
‫I'm going call it short one.
‫And they database's remember, it's Hosain Mac.
‫That's my machine.
‫And it's running on Port five, four, three, two.
‫And the default users, when you don't specify anything, the problem is the password and username becomes
‫Posterous and the database also becomes Postgres.
‫Everything in the center.
‫All right.
‫So now we have Allscripts schema public tables.
‫You Ordell table.
‫Look at that.
‫That's the table we created, guys.
‫And that's all this stuff we have.
‫All right.
‫Let's add the other two.
‫Shard to its Hocine Mac, and that's three.
‫Chris was Chris, and let's just add the third one short three forseen Mac and the support for right
‫that both Chris and for Chris and we had three short guys and the same exact thing, same exact schema.
‫That's what we want.
‫So we are we're sharding set up as well.
‫How about we write some code, guys?