# Practical

#### &#x20;1. Launching an instance

&#x20;We can launch the DB using EC2 OR RDS

&#x20;**1. EC2**&#x20;

* Go to ec2 -> launch instance -> rhel -> launch -> login&#x20;
* \#yum install -y mariadb\*
* &#x20;\#yum update -y&#x20;
* \#systemctl restart mariadb
* &#x20;\#systemctl enable mariadb

#### &#x20;2. RDS

```
Create a security group -> SG name
(RDSSecurity) ->Description (RDSSecurity) -> VPC
(default) ->add rule -> mysql/aurora (3306) ->add
source (copy the SG id of ec2 instance and paste it
to source, because we are going to allow only the
connection from ec2) -> Go to RDS -> select
MariaDB -> dev/test -> DB instance class (t2.micro)
-> multi-AZ deployment (no) -> storage type (ssd) ->
allocated storage (5G, max 6TB) -> DB instance
identifier (nirmal, give a unique name to identify DB)
-> master username (nirmal) -> master password
(pragathi, give any 8 character) -> confirm password
-> VPC (default) -> subnet (default) -> publicly
accessible (no, if set to yes the RDS will have a
public ip so anyone can access from outside -> VPC
SG (RDSSecurity, one that you created) -> DB Name
(MariaDB) -> backup retention period (7 days, max
35days, maximum no.of days the snapshot should
be retained) -> Backup window (default, specifying
at wot time the backup should be done) -> Auto
minor version upgrade (yes) -> Launch DB instance.
```

#### &#x20;3.Login to EC2 and connect to RDS

```
Check mariadb is working fine or not->
#mysql -u root -p
If working
#mysql -h (endpoint, without port no) -P 3306 -u
(username) -p
(check whether connection is happening to
RDS or not, then show some basic MariaDB cmd)
```

#### &#x20;4.Restoring DB

&#x20;if we restore its going to recreate a new instance with a new endpoint.

```
Select action -> go to pointin time -> use
latest restorable time (latest) or custom restore
time -> launch
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gyansetu-aws.gitbook.io/aws-cloud/practical-18.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
