Joshua Hesketh | dd65060 | 2013-08-21 12:18:50 +1000 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | |
| 3 | # $1 is the db engine name, currently one of: |
| 4 | # mysql |
Joshua Hesketh | bacf189 | 2013-09-09 11:30:39 +1000 | [diff] [blame] | 5 | # percona |
Joshua Hesketh | dd65060 | 2013-08-21 12:18:50 +1000 | [diff] [blame] | 6 | |
| 7 | git pull |
| 8 | |
| 9 | # Percona support |
| 10 | apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A |
| 11 | cp etc/percona.list /etc/apt/sources.list.d/percona.list |
| 12 | |
| 13 | apt-get update |
| 14 | apt-get dist-upgrade -y |
| 15 | apt-get install -y git python-pip libxml2-dev libxml2-utils libxslt-dev libmysqlclient-dev pep8 postgresql-server-dev-9.1 python2.7-dev python-coverage python-netaddr python-mysqldb $1-server python-git virtualenvwrapper python-numpy |
| 16 | |
| 17 | mkdir -p /var/log/mysql |
| 18 | touch /var/log/mysql/slow-queries.log |
| 19 | chown mysql.mysql /var/log/mysql/slow-queries.log |
| 20 | |
| 21 | chmod ugo+rx /var/log/mysql |
| 22 | chmod ugo+r /var/log/syslog /var/log/mysql/slow-queries.log /var/log/mysql/error.log |
| 23 | |
Joshua Hesketh | dd65060 | 2013-08-21 12:18:50 +1000 | [diff] [blame] | 24 | if [ -e /etc/logrotate.d/percona-server-server-5.5 ] |
| 25 | then |
| 26 | rm /etc/logrotate.d/percona-server-server-5.5 |
| 27 | fi |
| 28 | /usr/sbin/logrotate /etc/logrotate.conf |
| 29 | |
| 30 | /etc/init.d/apparmor restart |
| 31 | /etc/init.d/mysql restart |
Joshua Hesketh | e13932b | 2013-09-06 16:45:33 +1000 | [diff] [blame] | 32 | |
| 33 | mkdir -p /var/log/turbo-hipster |
| 34 | chown turbo-hipster:turbo-hipster /var/log/turbo-hipster |
| 35 | |
| 36 | mkdir -p /var/lib/turbo-hipster |
| 37 | chown turbo-hipster:turbo-hipster /var/log/turbo-hipster |
Joshua Hesketh | 055a08b | 2013-09-06 16:48:41 +1000 | [diff] [blame] | 38 | |
| 39 | mysql -u root -e "create user 'nova'@'localhost' identified by 'tester';" |
| 40 | mysql -u root -e "grant all privileges on nova.* TO 'nova'@'localhost';" |
Joshua Hesketh | af26dbb | 2013-09-11 12:30:38 +1000 | [diff] [blame] | 41 | |
| 42 | # Fix log rotate for MySQL to be other readable. |