OK, so now let's install a second node exporter on another server and read the information using the
Prometheus service.
This is the node exporter or Prometheus dashboard has been running for a few days now, and it's very
impressive full of information, but it's only looking at one instance.
That's my local hostname of 100.
What I'll do is configure the Prometheus service here to query and not export on another server.
So in this video will install a node exporter on another server being the Moscow server because we already
have it from early on in the course and then we'll see statistics about that server in this dashboard
as well.
OK, so log on to your other server, your mask.
Your server is a good choice for that.
So I've logged on.
I'm now going to install the Prometheus node exporter, so I don't need to install Prometheus this time.
It's just a node exporter component.
I want so copy that Abe to install Prometheus node exporter.
Yes.
OK, we can check its status because it would have already started it, I got active running.
Excellent.
It's also created a user called Prometheus so we can inspect.
So I'm just going to copy the whole lot.
And the video ID Prometheus Prometheus in the group's Prometheus is using one service called Prometheus
Node, and if I just press into the Prometheus node, is listening on Port 9100.
OK, so right away, that service is accessible via Port 9100 myself.
OK, so that address the IP address of your server.
My My SQL server was that ago matrix?
That's the matrix coming for myself and my master.
Your server doesn't have a dedicated firewall, but I do have IP tables installed on it, and I'm using
that to block the SQL port three three zero six two only microphone a server.
So if you want to continue using IP tables, you can create some rules to only allow your Gravano server
or Prometheus server to access Port nine one hundred and drop everything else.
Or I'm going to set up the dedicated firewall in teacher location this time.
OK, some of my digital ocean networking tab firewalls I encouraged did a kind of firewall yet digitalisation
for my MySchool service, and I do that now.
If you're using I was, you would have had a security group for your server when you created it, but
it's a very similar process.
This is actually much easier to use an IP table, so I recommend using the firewall that your cloud
provider gives you to manage access to your service.
So I want to create a new rule custom for nine 100.
I want to only allow my Prometheus service access to that, and that is running on my Safana server.
He could be running on his own server if you want to.
The Pipefitters of Mega-fauna server is that so I'm going to allow just that IP address to query on
Port nine 100 since I'm running my show on that server as well, I'm going to add another one as well.
My skill three three zero six also only could allow that IP address.
And so OK.
So three, three, zero six and four S.H. all configured that.
Also, I'm only going to allow the IP address of this actual server that I'm making this video from
to access this S-H port.
Twenty two, what is my IP I go into?
I'm going to call this my skill.
That's my rule.
And I'm going to apply it to my my SQL server there.
There we go.
Great Firewall.
OK, so there we go.
I recommend using the firewall option provided by your cloud provider, but you could also use IP tables
to restrict access to ports, a certain IP addresses as well.
If you want to use that method now continuing, I should no longer be able to access that port over
the internet.
So if I just refresh that one, that will eventually timeout, but I should be able to access it from
my grandfather server where my Prometheus service is running.
OK, so upload onto Mega-fauna server.
Now, with the Prometheus services running in, I should be able to access that curl.
That's the IP address of my My SQL Server Port 9100 metrics and its response.
So let me go my pomace.
Your service can access the node exporter on that server once I configured it, but I can see that the
firewall that I've set up in my cloud provider is working as expected.
OK, so now to go on to the Prometheus service and configure a new scrape target that will pull the
metrics from that, you know, export up.
So on microphone, a server with the Prometheus services running, we're going to edit the Prometheus
voicemail.
OK, so down in our ADC, Prometheus, Prometheus, why?
And if I scroll down to the scribe targets or the script config, there is ActionScript conflicts gave
it further.
There's a job name called Node.
So we already have one target their local host, not 100.
I'm going to add another target being this are the server targets.
That was the IP address, Colin, no, I 100 finished it off.
OK, so I have to static conflicts for the job note, and that will rate the metrics from that server
as well.
So Control X to say yes, we need to restart Prometheus two Prometheus restart and we'll check its status.
And so that looks good.
Control C to get out of that, they go back into this not exported dashboard on Bafana for just refresh
the screen.
I now have another server showing up down here, so hostname MySchool, so we got that hostname automatically
and then the statistics about it.
So we'll start to see information about.
My mosque, your server selected there, I can filter by either server by pressing those, these node
graphs are overall down here.
We can have the resources Agraféna I can see I've used 19 per cent disk space on a server.
What changed that to my my SQL server?
I can see I've used 14 per cent disk space and a messy internet traffic.
There will be more data as time goes on by use.
Local host I can see I have much more data for the local node export on that server.
OK, so that's what we have now won Prometheus service.
It's running a Mega-fauna server because that was a good place to put it, and it could be on its own
server if you need it.
And I have to not export us now, you can go and create as many node exporters as you like and just
keep adding the targets in your scrape configs, the job name node so you can have as many of those
as you like.
OK, so also another consideration is Engine X.
When I've added my other scrape config, I just look at it again.
I added the target as the IP address nine 100 now, I could have also set up a firewall rule for the
VPC IP address.
So if I go to VPC here and I look at the service in my Amsterdam, VPC, the members, I could have
allowed this private IP address instead of the external IP address and configured it there as well.
Now that's a better way to do it if you're lucky enough to have service on the same VPC or network.
But I'm just showing you how to do it across the internet anyway if you need to, in case your server
isn't on the same cloud provider, for example.
But also another consideration is that if your servers are not on the same cloud provider and you can't
set up a VPC, you should encrypt that traffic as it's traveling across the internet.
For that, you could set up an internet service proxy on that server.
I could create a new domain name, for example, was killed or a code dot net and send that to that
IP address of a muscular server.
I then get an SSL certificate and sent set up an index reverse proxy, and I'd add a location called
Metrix Proxy passing to local host nominative metrics.
OK, so be aware of your servers are on the internet.
Data should be encrypted and using it and next birth proxy is a good way of doing that.
OK?
Excellent.
So that's what we have a Prometheus data source, Prometheus service and to note exporters, it can
have as many as you like.