So 1
we're gonna go fast. 2
All right. 3
And then we're going to end the show because we're past our hour. 4
But I want to get you guys some feedback. 5
All right. 6
So the first one up is Jacob. 7
And there's a whole lot documentation here and I love documentation Doctor files by the way. 8
It's totally fine to put as much as you want. 9
This is actually a demo file so now we're talking about compose but documentation in Doctor files or 10
compose files either way. 11
Always a good thing. 12
All right. 13
So he's using a version 3.0 7 which means it's probably for swarm or something in production like 14
Kubernetes using the compose on Kubernetes feature set. 15
He's using the official elastic images from the elastic there. 16
Let's see you've got your health check. 17
Fantastic. 18
You've got health checks it's great you've got configs. 19
That's great. 20
You're setting in on a specific network and you're doing host mode on the port. 21
So you're giving us direct access to the Knick instead of going through the overlay networks and the 22
routing mesh. 23
That's good. 24
And then let's see. 25
We've got to deploy down here. 26
Oh and you're doing endpoint mode DNS round robin. 27
So kudos to you. 28
This is something that a lot of people don't realize. 29
But whenever you're running something in swarm and you want to disable the virtual IP that sits in front 30
of every overlay service you want to do that for databases where you only have one node right which 31
is a lot of times even if you're doing a mirror of a database you're usually running each one of those 32
in their own service. 33
And so there's one instance in a service and that that task of that instance of a container you don't 34
usually want that virtual IP in front of it because it's now an extra hop it's another Nat translation 35
it's more potential problems. 36
So if you set endpoint mode DNS round robin here that effectively turns off the Veep and has direct 37
access to that container. 38
So kudos to you. 39
I don't see that very often because people don't catch that one and then you're also using replicas 40
too. 41
And resource limits of 4G for a gig that's great. 42
Always I recommend always setting resource limits and reservations if you can because that's going to 43
help things all get along inside your cluster. 44
Yeah. 45
Looks like it's running on docker swarm suite and 46
coordination 47
M. 48
All right. 49
More more of the same. 50
More the same. 51
Good stuff good stuff. 52
You're buying mounting a volume or you're not by management by Manning you're using a named volume and 53
you've got placement constraints here so you're putting this on a node that is hardcoded to a specific 54
name so you know you want this one to run that node only. 55
And of course the weakness here is that that if that node goes down it won't be able to place it anywhere 56
else. 57
But hopefully you've taken that into consideration. 58
All right. 59
Master 2 so that's how you're doing this. 60
It looks like you have master one master to hardcoded in as separate services and master three and a 61
lot of people have to do it this way that when you have a multi no database cluster it's usually easier 62
to put each one of these as their own service. 63
And so you've done that and it would be nice if we could just make one service with three replicas and 64
you can find that with some examples using the autopilot pattern if you look up auto pilot pattern Io 65
or if you just google your database technology with the word autopilot sometimes you can find configurations 66
and automation scripts that will help you do it all in one service. 67
There's pros and cons to each. 68
I personally tend to just do it the way you're doing it. 69
I feel like it's simpler even though it's more Jamel and so a little bit more verbose. 70
One thing you could do here. 71
One huge improvement is if these are all all the same parts here. 72
Right. 73
All the same stuff you can template that shorten this file significantly by only putting that in a template 74
block. 75
And I talk more about that in this. 76
This right here Jacob I'll put this in chat. 77
This is three different advanced Docker composed features that a lot people don't use. 78
And one of them is on templating. 79
And so if you see the example here you can you can throw the templating right there. 80
Basic what you're saying is this is what I want in the template. 81
And this is where I want you to put it over and over in each image or in each service rather. 82
And so a lot of that boilerplate stuff like you could template the whole thing or you could just template 83
parts of them and have multiple templates and docker has documentation on that. 84
So that would help make your file smaller and we call it dry. 85
Right. 86
Doing it doing things once you don't repeat yourself. 87
These are why. 88
And you could do that. 89
So that would help you alleviate a lot of this repetitive stuff especially around the health checks 90
and the deployment stuff. 91
So then you've got your data nodes everything's looking good there you're using your health checks you've 92
got your network set your volumes and let me go down pass some of this your hard coding stuff to each 93
node and I and I really wish 94
that we had a way to tell it don't run like here's a placement constraint. 95
Run don't run it on one. 96
That is where the other ones run. 97
So there's some hope for you there's two things you can do here you can look at placement preferences 98
and if you have your different nodes in availability zones and you simply want your database to make 99
sure that it has one copy in each availability zone like an of us or something then you can add labels 100
to each node and then you just go in here and say I would prefer you to spread these out over my label 101
and you just give it a label and a placement preference instead of a constraint will allow it to put 102
those on the different different servers in the different zones. 103
But the cool thing here is if one zone or one server goes down it will still be able to reassign that 104
somewhere else. 105
Now the worst case here is that two of these are running on the same server but that's probably not 106
so bad if you're able to I mean one thing might be the data getting the data from one zone over the 107
other but once you've saw some of those problems. 108
Yeah. 109
Yeah you're saying so I can use constraint and allowed to lose one of the physical nodes. 110
Yeah. 111
So the thing is you're you're making it a little bit more brittle by assigning it to Node late host 112
names and you have to those specific host up and ideally like if you're an eighth of U.S. or something 113
where you can have your servers auto create. 114
So if a server dies it all creates a new one. 115
Yeah. 116
So if you've accounted for all that great there's nothing wrong with placement constraints in this way. 117
It just means that those nodes have to be there or those containers die. 118
The other thing is there is a new feature coming in 1983 and the way you learn about these new features 119
is if you go to Docker on github and you go to Docker C releases and I will post this in chat and you 120
can look up new swarm features and there is a new swarm feature version version that will allow you 121
to run replicas but tell it never run more than X of these replicas on the same node super cool feature 122
and helps people ensure that their databases don't all get assigned the same node so you might want 123
to check that out as a more flexible way to ensure they're not on the same note. 124
I think if I scrolled down down the swarm. 125
Yeah added support for maximum replicas per node So that's a new feature in the forthcoming 19 0 3 release 126
that's already in prerelease now so we should be seeing this within the next few weeks or months and 127
then you can check that out. 128
That might help you with the constraints. 129
All right. 130
I want to move ahead a little bit. 131
Sorry I can't review all this I moved it down at the bottom. 132
You got your networks detachable true and proxy. 133
All looks good there. 134
You got volume so you're using the default volume driver so that that way that means that all of this 135
data is stuck on the node that it's on. 136
If you have any shared storage you might consider Rex Ray or another volume driver so that you can get 137
that storage off that disk and that way when one of the notes fails and it wants to create that somewhere 138
else it will reattach that database volume. 139
On the other note. 140
All right. 141
So you may be aware we looked at that and you got traffic certificates so I could talk about that for 142
a while but we're gonna run out of time so I'll I'll leave the traffic certificate stuff for another 143
day and then you've got can figs and other files. 144
This is great all use and all the can figs. 145
As you should. 146
And then I don't see secrets in here but I'm assuming at some point you need secrets and you might need 147
to store those in secret somewhere so other than that great UML definitely one of the better ones I've 148
seen. 149
I think there's very little to do here. 150
I think in terms of making it sort of using all the perfect features the templating is a thing considering 151
different volume drivers and considering the new feature if not placement preferences the new feature 152
for Max replicas per No. 153
Thanks for watching. 154
You can click SUBSCRIBE AND the notification bell to get an alert when I go live so you can join and 155
ask your dev ops and darker questions. 156
You can watch some of my other videos over there and you can do what I'm about to do and just go take 157
a nap.