본문 바로가기
[AWS]/Highly Available, Scalable, AWS Stack

30. [활용] Configure and verify app

by SAMSUNG CLOUD-OKY 2022. 1. 25.
반응형

 

## RDS 와 읽기전용 복제본은 사용자 계정과 암호가 동일함

## APP 엔드포인트 수정

1) /var/www/html/rds_rr.php

2) /var/www/html/memcached.php

3) /var/www/html/cloudfront_image.php

 

 

All right so in the final video in this module let's configure the application.

And in the in the application we have to set up the three elements right that we have created.

So one is the memcache cluster.

The other one is the read replica that we have and the third one is the cloud front distribution that we

have set up.

Right.

And so we have three pages.

We have three different pages to edit.

One is RDS Read replica dot PHP.

The other one is memcached dot PHP and finally cloud front cloud front underscore image dot PHP as

well.

So these three pages we will have to edit and in these we will have to enter.

We'd have to specify the the RDS read replicas endpoint.

Right so this has an end point.

And we also have to configure the user name and password which will be the same as RDS username

and password.

So the RDS username and the master user right and the password will be the same for the read replica

as well.

Be the same because remember it's a replica.

So even the user details are carried over.

Not just the data.

So we have to configure the endpoint and then the RDS username and password in this in this particular

page.

Right.

Then the memcached DNS end point.

Right so this would have an endpoint of its own and we will configure that as well.

In this page in the memcached page.

And finally in cloudfront we will have to configure the cloud front.

URL the URL that we tested the one with the DNS name followed by the followed by the the image

name.

Right.

So that URL you have to specify in this page.

So here's the instance that I have.

Right.

And let me SSH into this instance.

Like this and we'll start editing the files one by one by.

And these are in the usual location.

The Apache document root.

Let's start with the RDS reads replica And here let me paste the RDS endpoint.

All right so let me get the RDS end point this is let me go to RDS and here we have the Read replica

and let's find the endpoint of the replica.

Remember the replica will have a different end point to the to the main the primary.

RDS instance.

Right so so let's scroll down here.

And this is the replicas end point and let me copy that and paste that here right.

And once again if it goes into the next line make sure that you bring it up right there should be no

extra space.

No no junk character right none of that.

Otherwise your page right page will not work.

OK.

The user name will be the same as the one that we have set up in RDS dot PHP.

But because remember this is a read replica.

And the user details are also replicated into the replica.

So that remains the same as what we have for RDS dot PHP.

This is our RDS.

RDS read replica.

next let's configure memcached right.

And here we just need to add one value and that is the memcached server's DNS end point.

So so we here we now go to memcached.

OK so this is ElastiCache.

And here we have a cluster.

I have a cluster here and this is the end point.

Let me copy that.

Right.

And we dont need the port.

So just copy up to com .com and then paste like this.

All right.

Thats it.

So basically what it does is it it saves a key value pair and then retrieves that and then compares

the value retrieved from the cache is what was set right so.

So theres a little bit of a logic here to verify that the read and write the get and set happened

correctly so.

So basically it's a roundabout way of testing the connectivity.

But but basically we set a value and then we get it and then verify that it's the same as what we had

set.

That's what the page is doing just for your information.

OK.

So this is on memcached page.

And finally the cloud front page and here we need to specify the URL of the image

via cloud front not not the S3 URL.

So over here.

Let me go and get the image URL.

I'm sorry.

So this is the URL and we simply copy and paste like this.

Right.

And you can also HTTPS by the way that should also work but anyway let's give

this a try.

Right.

So three pages have been configured.

Now let's verify.

So the IP address let me use the IP address of the server.

this one.

And.

And let's go to our homepage first and then let's look at these three pages one by one.

Right.

 

So the first one is this one the image via cloud front.

Let's see if this works.

You can see it looks good.

Next we will test this one.

The RDS read replica page.

This should say connected like this.

That's good.

And finally let's go to the memcached page and this should say successful as well like this.

This is the right message.

OK.

All right.

 
 
 
 
 
반응형

댓글