Friday, April 4, 2014

Friday: That explains it.

Pretty much every day this week, I go to do my lunchtime "let's expire shit from the DVR" routine, only to discover that the DVR backend has crashed.  I've been poking at it trying to figure out why, and yesterday I discovered that the mysql server that connects everything together has been crashing continually as well.  Today I figured out where the log information was going (syslog, apparently), which told me that the RSS reader table had crashed, and because that table was crashed, the server was crashing, which was causing the DVR to crash as well.

This is the problem with running your own cloud services off of a single computer.

In case this happens again, and I need to fix things again, here's the steps necessary to do so:
  1. Shut down everything.
  2. Edit /etc/mysql/my.cnf to include the line in the mysqld section:
    • innodb_force_recovery = 1
  3. Restart mysqld.
  4. Dump the entire database to be safe, then dump the table that needs to be replaced:
    • mysqldump --all_databases > backup_copy.sql
    • mysqldump ttrss.ttrss_entries > fix.sql
  5. Shut down everything again.
  6. Edit /etc/mysql/my.cnf to remove that line you put in.  It allows the database to skip the broken entries in the crashed table (those broken entries were the source of the database server continually crashing), but because it doesn't want you to break anything, you can't write to the database with that in place.
  7. Restart mysqld.
  8. Execute the fix.sql commands in mysql.  I just did the \. fix.sql.
  9. Restart everything else.
  10. Discover that you have a backlog of secret things that had been trapped by that crashed table, so now there's a lot of stuff in the RSS feeds that you're just not going to read tonight.
I don't have a good picture, so here's something I made playing this game.

No comments:

Post a Comment