AWS micro instances & mysqld deadlock

Hello all,

If you’re running mysql daemon on an AWS micro instance type AMI like me, you must already have undergone mysqld deadlocks day by day. I guess,   to move local mysql db to AWS RDS is the best solution in order to avoid this circumstance.

Creating a swap space is one of the solutions but you may have a limited storage on micro instances.Another solution would be to restart mysqld when it stops by cron jobs :)

crontab-syntax

Here is my bash script:

[ec2-user@ip-xyz-xyz-xyz-xyz filestores]$ more mybashscript
#!/bin/bash
if [[ ! “$(/sbin/service mysqld status)” =~ “start/running” ]]
then
/sbin/service mysqld start
fi

Don’t forget to give required permission for your bash file.

chmod +x /home/ec2-user/filestores/mybashscript 

And here is crontab (root crontab file!)You can access root crontab file by typing sudo crontab -e command

*/1 * * * * /home/ec2-user/filestores/mybashscript  –> Bash will run in every 1 minute.

That’s all, just give it a try. You can find different bash script on the Internet.

Wish you good and prosperity

Have a nice day.

 

 

 

Linux – Sudoers

Dear readers,

In this post, I am going to cover the sudoers in CentOS7. You all probably know that su means super user or substitute user and sudo means “do as su(per user)” :)

If you login to the system as root user, you are allowed to run all of the commands. I will try to perform several tasks as normal user for you to review the results.

Screen Shot 2016-05-24 at 18.53.49

Let’s try to run command by using sudo then.

Continue reading “Linux – Sudoers”

Linux – Granting permissions

Hello all,

In this blog, I am going to review file and folder permissions which are assigned to user , group and other objects.The very fundamental parameters that are needed to be considered when assigning permissions are User,Group,Others,Read,Write,Execute. In shortly, we can use ugo for user,group,others and rwx for read,write and execute. The table shown below is sufficient to express permissions in octal mode.

Continue reading “Linux – Granting permissions”

Linux – User & Group Basics 2

Hey dear readers,

In this post, I am going to review user object creation, group object creation, group membership change tasks. The distribution I have setup is CentOS7.

Firstly, I will create few user objects. The very basic command to achieve this task is to run “useradd user_logon_name” .

Screen Shot 2016-05-23 at 19.50.37

As you see, the user is created without a password. That’s why, it can not be used to login to the system. To assign a password to the new user , you can run the passwd command as shown below.

Continue reading “Linux – User & Group Basics 2”