Blog Archives

How to fix a hole in drywall

My family stopped by my wife’s uncle’s vacation home. At the bottom of the stairs we spotted this:   So we called the uncle. As a thank-you we offered to fix the hole. It was too big for a patch

Posted in In My Life

hbase performance tuning

First, with almost all databases check this setting: sysctl -a |grep swap Default is set to 60. This is really bad for databases. Lets set swappiness to 0 sysctl -w vm.swappiness=0    echo “vm/swappiness=0″ >> /etc/sysctl.conf sysctl -a |grep swap

Posted in HBase

Synchronous Replication using Percona

So, I’m really happy to have discovered Percona’s XtraDB Cluster replication I’ve used MySQL Replication for a while, but there were always sync problems, and it was difficult to bring a server back in the mix.  Mutex contention was a

Posted in MySQL

ssh mount drive

INSTALL LIBARY: yum install fuse-utils sshfs   load the FUSE kernel module: sudo modprobe fuse   Now mount: sshfs user@host: mountpoint   to unmount fusermount -u mountpoint

Posted in MySQL

Postgres ‘Show’ database, table, …

mysql: SHOW TABLES postgresql: \d postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public’; mysql: SHOW DATABASES postgresql: \l postgresql: SELECT datname FROM pg_database; mysql: SHOW COLUMNS postgresql: \d table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name =’table’; mysql: DESCRIBE TABLE postgresql: \d+ table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name =’table’;

Posted in MySQL, PostgreSQL

add script to boot

cp <script-file> /etc/init.d ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/S50<scriptfile> ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/K50<scriptfile> The S50 is to tell the system to start the script when it boots up, the K50 is to tell the system to shut down cleanly when you do a shut

Posted in Linux

Postgres – Show current settings

This is VERY easy show all;    

Posted in PostgreSQL, SQL

open-files-limit / innodb_open_files What is the right setting

This is what I do to get an idea: sudo yum install lsof for innodb you should count the *.ibd files sudo lsof | grep -c “\.ibd$” for myisam you should count the *.MYD    

Posted in MySQL

Recover from MySQL Replication failure

If your slave stops working first do this: show slave status; This will give you the last error when it failed. If you can move past the error, and want to restart replication do this:   STOP SLAVE;  SET GLOBAL

Posted in MySQL

High created_tmp_disk_tables

You should monitor this, along with several other status vars regularly. I have an automated report create bar charts to rank all the servers I watch. Why is this important? Most MySQL DBs lately are configured using the InnoDB engine. Don’t

Posted in MySQL