My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Installation  
How to install the scripts.
Phase-Deploy
Updated Dec 12, 2012 by ilmar.kerm

1. Introduction

How to install the scripts and create MySQL instances. Make sure you have read ArchitectureOverview before.

2. Details

2.1. Installing scripts

Execute everything as user root.

  1. Create user for running mysql
  2. adduser mysql
    passwd -l mysql
  3. Copy all scripts to /u02/app/mysql
  4. Set execute flag on script files
  5. chown a+x action_handler.scr
    chown a+x init_mysql_db.sh
    chown a+x mysql_handler.sh
  6. Edit instances.sh, this is a configuration file. Look over all global parameters.
  7. All managed MySQL instances are configured in instances.sh as a configuration block like this (NB! This is a BASH file, so all variables must follow BASH rules). Please take a look at AddNewInstance:
  8. sample_instance=(
      DATADIR="/instance/sample_instance/data"
      CONFFILE="/instance/sample_instance/config/my.cnf"
      BINDADDR="10.0.1.2"
      SOFTWARE="/u02/app/mysql/product/5.5.17/advanced"
      LOGDIR="/instance/sample_instance/logs"
    )
  9. Download MySQL RDBMS software tar-release and unpack it to (assuming its 5.5.17 advanced edition) /u02/app/mysql/product/5.5.17
  10. mkdir -p /u02/app/mysql/product/5.5.17
    cd /u02/app/mysql/product/5.5.17
    tar xzf mysql-advanced-5.5.17-linux2.6-x86_64.tar.gz
    mv mysql-advanced-5.5.17-linux2.6-x86_64 advanced
  11. Create mysql client defaults file with MySQL root password. This is needed to execute MySQL console in local server without password.
  12. touch /root/.my.cnf
    chmod 600 /root/.my.cnf
    vi /root/.my.cnf
  13. Example contents of /root/.my.cnf file:
  14. [client]
    user=root
    password="sOmepassw!ord"
    
    [mysqldump]
    user=root
    password="sOmepassw!ord"
  15. Execute mysql_logrotate.sh from crontab regularly (for example once per day or once per week) on every cluster node.
Powered by Google Project Hosting