From: Joe Presbrey Date: Thu, 30 Aug 2007 19:23:56 +0000 (+0000) Subject: only run cron jobs on slaves X-Git-Url: http://andersk.mit.edu/gitweb/sql.git/commitdiff_plain/a677e39368139f033c9309e5f92bc83f35857eae only run cron jobs on slaves git-svn-id: svn://presbrey.mit.edu/sql@147 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- diff --git a/etc/lighttpd.conf b/etc/lighttpd/lighttpd.conf similarity index 100% rename from etc/lighttpd.conf rename to etc/lighttpd/lighttpd.conf diff --git a/etc/my.cnf b/etc/my.cnf new file mode 100644 index 0000000..6df5596 --- /dev/null +++ b/etc/my.cnf @@ -0,0 +1,58 @@ +[client] +socket=/srv/mysql/mysql.sock + +[mysql] +socket=/srv/mysql/mysql.sock + +[mysqld] +datadir=/srv/mysql +log_slow_queries +long_query_time=2 +max_connections=5000 +#max_connect_errors=10 +wait_timeout=600 +interactive_timeout=600 +connect_timeout=10 + +log-bin=sql-bin +log-bin-index=sql-bin.index +relay-log=kitchen-sink-relay-bin +relay-log-index=kitchen-sink-relay-bin.index + +skip-locking +#skip-external-locking + +query_cache_limit=1M +query_cache_size=128M +query_cache_type=1 +thread_cache_size=8 +table_cache=1024 +key_buffer=400M +join_buffer=1M +record_buffer=1M +max_allowed_packet=16M +sort_buffer_size=2M +read_buffer_size=2M +read_rnd_buffer_size=8M +tmp_table_size=35M +thread_concurrency=4 +myisam_sort_buffer_size=8M + +innodb_buffer_pool_size=512M +innodb_additional_mem_pool_size=20M +innodb_log_file_size=200M +innodb_log_buffer_size=2M +#innodb_lock_wait_timeout=50 + +innodb_file_per_table + +old_passwords=1 +server-id=1 + +skip-bdb +#skip-networking + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M diff --git a/etc/sysconfig/iptables b/etc/sysconfig/iptables new file mode 100644 index 0000000..cd0e614 --- /dev/null +++ b/etc/sysconfig/iptables @@ -0,0 +1,20 @@ +# Generated by iptables-save v1.3.7 on Wed Aug 29 23:33:53 2007 +*filter +:INPUT ACCEPT [663:117098] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [313:38212] +:Firewall - [0:0] +-A INPUT -j Firewall +-A FORWARD -j Firewall +-A Firewall -i lo -j ACCEPT +-A Firewall -p 50 -j ACCEPT +-A Firewall -p 51 -j ACCEPT +-A Firewall -p icmp --icmp-type any -j ACCEPT +-A Firewall -m state --state RELATED,ESTABLISHED -j ACCEPT +-A Firewall -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT +-A Firewall -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT +-A Firewall -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT +-A Firewall -m state --state NEW -m tcp -p tcp --dport 5666 -s 18.187.1.128/255.255.255.255 -j ACCEPT +-A Firewall -j REJECT --reject-with icmp-host-prohibited +COMMIT +# Completed on Wed Aug 29 23:33:53 2007 diff --git a/etc/sysconfig/openafs b/etc/sysconfig/openafs new file mode 100755 index 0000000..0b760b1 --- /dev/null +++ b/etc/sysconfig/openafs @@ -0,0 +1,5 @@ +# OpenAFS Client Configuration +AFSD_ARGS="-dynroot -fakestat-all" + +# OpenAFS Server Configuration +BOSSERVER_ARGS= diff --git a/libexec/cron-daily-afs.sh b/libexec/cron-daily-afs.sh index bca3dfb..4232bc8 100755 --- a/libexec/cron-daily-afs.sh +++ b/libexec/cron-daily-afs.sh @@ -1,5 +1,7 @@ #!/bin/bash /srv/sql/libexec/afs-renew-tickets.sh -/srv/sql/libexec/afs-run-backup.php -/srv/sql/libexec/afs-set-permissions.php +if [[ -s /srv/mysql/master.info ]]; then + /srv/sql/libexec/afs-run-backup.php + /srv/sql/libexec/afs-set-permissions.php +fi diff --git a/libexec/cron-daily-local.sh b/libexec/cron-daily-local.sh index 0b926bb..643f5d2 100755 --- a/libexec/cron-daily-local.sh +++ b/libexec/cron-daily-local.sh @@ -1,9 +1,9 @@ #!/bin/bash -NEWBF=/srv/backup/daily/sql.mit.edu_`date +%m-%d-%Y`.sql.gz - -/usr/bin/mysqldump -umit-backup -efqQK --all-databases | gzip > $NEWBF - -if [[ -s $NEWBF && `ls /srv/backup/daily/ | wc -l` -ge 4 ]]; then - rm -f /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` +if [[ -s /srv/mysql/master.info ]]; then + NEWBF=/srv/backup/daily/sql.mit.edu_`date +%m-%d-%Y`.sql.gz + /usr/bin/mysqldump -umit-backup -efqQK --all-databases | gzip > $NEWBF + if [[ -s $NEWBF && `ls /srv/backup/daily/ | wc -l` -ge 4 ]]; then + rm -f /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` + fi fi diff --git a/libexec/cron-weekly-local.sh b/libexec/cron-weekly-local.sh index 3857aa4..47ff5fd 100755 --- a/libexec/cron-weekly-local.sh +++ b/libexec/cron-weekly-local.sh @@ -1,5 +1,7 @@ #!/bin/bash -if [[ `ls /srv/backup/daily/ | wc -l` -ge 3 ]]; then - mv /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` /srv/backup/weekly/ +if [[ -s /srv/mysql/master.info ]]; then + if [[ `ls /srv/backup/daily/ | wc -l` -ge 3 ]]; then + mv /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` /srv/backup/weekly/ + fi fi