Execute the command to configure the remote keys:
ssh-keygen -t rsa -m PEM -f remote-key
Dockerfile for the Remote_Server:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683424194825/b81ae918-cf72-4919-afb1-28f9569de47a.png)
Installation of mysql using docker-compose file:
In this lab first, we build the image using the commands.
root@ip-172-31-17-221:/home/remote-projects# docker-compose build
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683424001621/fc99d805-00f6-4ad7-a538-8b3273d50c7f.png)
All servers are ready in Docker:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683423884652/9fba6dd1-4c63-4496-8828-1a3bc0da5133.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683423944823/b118c159-6b24-4f0e-87c6-9a70f54d4915.png)
Access my mysql server from remote-server:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683424639667/c2675994-d1d1-438a-b8ca-ccf992efa416.png)
Pull the data1 from mysql server –> remote server:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683426059432/9bcd5255-19c9-40fc-91a3-fc70c2a30164.png)
Create the AWS S3 Bucker:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683426240121/e640c39d-9281-45a6-8c99-7103b1ebc062.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683426256833/910259de-a955-465c-9566-d7bb82d98db3.png)
Create user access in AWS for s3 bucket:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427480395/0e4abea9-6cdd-46da-979e-9e30cdfe2a66.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427560815/62cd2ca9-7a63-4802-a306-6a07b7034293.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427605033/0657ad0d-a644-4b3a-bd0e-ba1758358ace.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427626271/ddad2b67-748b-4bb6-b250-d0f90d25b0b9.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427746768/0c2117a2-6957-4547-bde4-27126b5ad901.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683427762337/9fed94ef-7a6e-4966-80ec-f39ae81e6cd9.png)
Set environment variables for aws access from the remote server:
replace the keys which we extract in the above configuration –
export AWS_ACCESS_KEY_ID=AKIAYLT72WWPQUY4TSDX
export AWS_SECRET_ACCESS_KEY=oazeKzeOLTjvUWESrhjLcADZrDVcLhObsYcX/bIO
export AWS_DEFAULT_REGION=us-east-1
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683428082959/fa60880a-4275-4f27-92f1-8823718c2193.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683428185549/cca5728c-23dd-4077-93f2-b178eb7a6f9b.png)
Push the mysql DB in the AWS S3 Bucket From the remote server:
connection established:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683428273264/96def693-881b-4418-a149-da4d569c2652.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683428445439/2861d7b9-9833-4e29-b92e-8f002fec0857.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683428471479/554e6946-9093-49cc-a120-636b4735e3ee.png)
Commands Used In Project:
==============================================
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683429098974/1775fc26-dff0-48ae-ac09-b5ab90d6e7ed.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683429134810/81d84251-85a5-4bdc-8514-5c1de286789e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683429153421/9d8f0997-fbef-4643-8cc1-3f97cb0ab6d1.png)
=======================================
Have a Good Weekend!
In the next lab, I will automate the whole process using the Jenkins (BASH) –
No comments:
Post a Comment