Resolving Mariadb Connection Issue in Production

"What k*lls the creative force is not age or a lack of talent, but our own spirit, our own altitude" - Robert Greene Good day, everyone😊 Day 9 of my #100DaysOfDevOps challenge was a reminder that in production, chaos is the only constant. But chaos is also where a DevOps engineer finds their value. The scenario: The Nautilus Application in the Stratos DC was hemorrhaging. Production support flagged a critical connection failure, the application couldn’t talk to the database. When the heartbeat of your app stops, every second counts. Here is how I resolved this problem, moving from a blind error to a surgical fix. First let me clear this out, we are troubleshooting the mariadb connection issue. So here's how I did it I always implement research Over reflex. Before touching the terminal or using commands, I went to the documentation. It’s very tempting to start throwing commands at a broken server, but I’ve learned that expertise is built on structured troubleshooting. I familiarized myself with MariaDB’s common failure modes before jumping into the heat, as well as possible solutions. So to solve this task, I first accessed the database server (`stdb01`) using the ssh command to leave the jump host. When that was done I tried to start it once more using: 'sudo systemctl start mariadb' The result? A failure. Then I used 'systemctl status' which showed Exit status: 1. This is the crossroads where most people get frustrated, but it’s where the real work begins. If the service won't start, the logs are the only map you have. I went straight to the MariaDB error logs using 'cat /var/log/mariadb/mariadb.log | tail -30' The log read as follows: Can't create/write to file '/run/mariadb/mariadb.pid' (Errcode: 13 "Permission denied") In the Linux, permissions are the silent killers of uptime. The /run/mariadb directory, essential for holding the Process ID (PID) file had lost its way. I had to re-assert control using the commands: 'chown -R mysql:mysql /run/mariadb`' (Returning the keys to the 'mysql' user). 'chmod 755 /run/mariadb' (Ensuring the owner can write while keeping the system secure). When that was done I used `systemctl start`, then checked the status to see if the issue is resolved. And boom success, mariadb was active and running which signaled my task is done. If you can't read the logs, you're just guessing. If you can't manage permissions, you're just a visitor in your own environment. Though of course there are many ways to resolve this, and this was one of them. #DevOps #100DaysOfDevOp #TechCommunity #LearningInPublic

To view or add a comment, sign in

Explore content categories