Can i disable RDS when i installed mysql in ec2 - amazon-web-services

I am using 1 ec2 instance and OS is ubuntu. I installed mysql, php in the ec2 instance.
My RDS Service charge is coming high.
I don't know if RDS service is required for me. Can i disable this service?

Yes, you can temporarily turn off an RDS instance as of 6/1/7:
https://aws.amazon.com/about-aws/whats-new/2017/06/amazon-rds-supports-stopping-and-starting-of-database-instances/
Keep in mind that you can only turn it off for upto 7 days and then it will turn back on by itself (and begin accruing charges again), so make sure you either delete it before the 7 days is up if you decide you don't need it, or else make sure to turn it back off after it turns back on.

Related

AWS RDS free tier database wont start

I created a free tier RDS Postgres database in AWS yesterday. It was working fine and I used it probably for 2 hrs. I stopped it after using it. Today when I try to start it, it won't start and also won't give any errors. What am I doing wrong?
You probably need to check what is RDS status. If the policy is set for terminate on shutdown, you won't be able to start it.

force-stop RDS instance

I currently have one AWS RDS Mariadb instance stuck at rebooting. In the current state, I cannot either modify or stop the instance.
I contacted AWS requesting to have the instance stopped and they responded We cannot STOP the instance on behalf of our customers. It is available to do actions from your end.
I understand that it might have hit this mariadb bug
I'd like to try update some innodb_* parameters to see if the instance can be started.
But there's nothing I can do at the moment because the instance is stuck at rebooting.
I don't think I am the only one who had this kind of issue.
AWS support is not helping at all. The only solution they suggest is delete the instance and restore from backup. Restoring from backup would be my last option. Luckily, this is not our production database. If restoring from backup is the only option if you hit a mariadb bug and the instance end up stuck at rebooting, I'd reconsider whether I should host mariadb on EC2 instances.

AWS EC2 keeps shutting down automatically

I am trying to create an API that runs on AWS EC2 t2.micro. The problem I'm having is that my instance keeps shut down automatically every ~3 hours, which could be because of the "session time" of my AWS Educate account (screenshot attached)
Is there any way to keep my instance running constantly (for days and even months)?
I am using "tmux", which does seem to keep my API and the EC2 instance running even after my ssh connection is terminated, but the EC2 instance itself still shuts down automatically.
EDIT: If it is not possible to keep an EC2 instance of an AWS Educate account running constantly. Is there a way to start a new session automatically when the old instance's session has expired?
(Maybe using a script/using some tools offered by AWS? I'm new to AWS so I don't know if this is possible)
Sadly you can't change that. It is explicitly stated in AWS educate docs:
When your session ends, your resources will be “stopped.” You will be required to re-start your resources when you start a new session.
Instead of Using AWS Educate you can Create Regular AWS account which provides some services for free for one year. It includes the EC2 instance as well so you don't have to pay anything and you can run for months and year it will never gone down until you manually stop it.

Why should I use AWS RDS/DynamoDB instead of putting everything inside an EC2?

Currently I'm hosting my IPB forums on a single high-end OVH dedicated server without any tech issues. I'm considering moving to AWS and AWS recommends (??) you to host your web app on a EC2 (or ELB if you want scalability) and host your database separately on RDS/DynamoDB (RDS on my use case).
I have almost 5k CCU during peak hours and 50GB+ database.
Why should I use AWS RDS/DynamoDB instead of putting everything inside an EC2? Isn't that more expansive?
You can put it all on Ec2 (not dynamodb, there is no production version that you can run local), but a db like mysql or anything else that can be installed on the instance - then you are responsible for backing it up, apply patches etc.
I for years ran web apps on ec2 using a local SQL Server database, and they worked just fine.
However, once I moved my databases to RDS I slept a lot better. I no longer need to worry about an instance crashing in the middle of the night and losing customer data - I pay AWS to worry about it for me.
So, yes, technically it's possible - and it will even work - until something goes very wrong. If you are fanatical about doing your backups, storing them somewhere safe, and applying all required patches - you may be fine; I'd rather pay AWS, but it will absolutely work and you can always upgrade later.

Do I need to keep my EC2 and RDS instances running on AWS to have my website available?

I have recently started getting to know how to use AWS free tier to run a web application, but there are so many information out there that I can't digest all at once! As I've learned so far, we need an RDS instance to have the database on the server, and a EC2 instance to be able to transfer files to the server. If I keep the instances running, I will have to pay for it, and if I stop them, what will happen to my website?!
I need help to understand if I need to keep those instances running all the time.
You of course need to keep your web server running to serve your website. How else would users reach it? Yes, you have to pay for it every minute that it runs, that's how cloud computing works. If you shut it down, your website will become unreachable until you turn it back on.
You do not need an RDS instance. It's much easier to get up and running and is better design, but for a small site, there is no reason you can't just install mySQL on your ec2 box and access it locally. EC2 is just a server box, you can install whatever you want on it.