This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.paths.unshift('../'); | |
var ZK = require ('zookeeper').ZooKeeper; | |
var connect = require('connect'); | |
var Storage = (function() { | |
var that = {}; | |
// connection manager object is responsible for maintaining the connection to zk | |
var connection_manager = (function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#LOG | |
#--- | |
#Log sequence number 248 2222568315 | |
#Log flushed up to 248 2222533410 | |
#Last checkpoint at 248 1843690869 | |
# | |
use strict; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT db, tbl, SUM(this_cnt) AS total_rows, COUNT(*) AS chunks | |
FROM percona.checksums, information_schema.tables | |
WHERE | |
percona.checksums.db=information_schema.tables.TABLE_SCHEMA AND | |
percona.checksums.tbl=information_schema.tables.TABLE_NAME AND | |
information_schema.tables.ENGINE != 'MEMORY' AND | |
percona.checksums.db='myDB' AND | |
( | |
master_cnt <> this_cnt | |
OR master_crc <> this_crc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vrrp_script chk_haproxy { | |
script "killall -0 haproxy" | |
interval 2 | |
weight 5 | |
} | |
vrrp_instance VI_PXC_DB { | |
interface eth1 | |
state MASTER | |
virtual_router_id 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[percona@db1 ~]$ cat /etc/security/limits.d/91-mysql.conf | |
* soft nofile 4096 | |
* hard nofile 4096 | |
* soft nproc 204800 | |
* hard nproc 204800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
socket=/data/mysql/mysql.sock | |
[mysqld_safe] | |
# connect this node up to the cluster | |
wsrep_urls = gcomm://10.1.6.10:4567,gcomm://10.1.6.11:4567,gcomm://10.1.6.12:4567 | |
[mysqld] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local2 | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 20000 | |
user haproxy | |
group haproxy | |
daemon | |
#nbproc 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk -v lines=1000000 -v fmt="database.table.%06d.sql" '{print>sprintf(fmt,1+int((NR-1)/lines))}' ../export-20121119-062335/database.table.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select all_tables.* | |
FROM | |
(select table_schema, table_name from information_schema.statistics group by table_schema, table_name ) all_tables | |
LEFT JOIN | |
(select table_schema, table_name from information_schema.statistics where index_name='PRIMARY' group by table_schema, table_name ) primary_tables | |
USING ( table_schema, table_name) | |
WHERE primary_tables.table_name is null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema, | |
CONCAT(ROUND(sum(table_rows) / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(sum(data_length) / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(sum(index_length) / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( sum(data_length) + sum(index_length) ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(sum(index_length) / sum(data_length), 2) idxfrac | |
FROM information_schema.TABLES | |
group by table_schema | |
ORDER BY data_length + index_length DESC |