Skip to content
clojureit edited this page Apr 16, 2014 · 2 revisions

架构:Rails -> BGW -> 两台MySQL

两台MySQL互为主备,双主模式,数据互相同步,不适用大量写入的情形;

tar -xzf ~/nfs/package/mysql-5.1*

./configure --prefix=/home/work/local/mysql --with-charset=utf8 --with-extra-charsets=gbk,utf8,ascii,big5,latin1,binary --localstatedir=/home/work/local/mysql --with-plugins=all --with-pthread --enable-static --enable-thread-safe-client --enable-assembler --without-ndb-debug --with-unix-socket-path=/home/work/local/mysql/tmp/mysql.sock --with-mysqld-user=work

make

make install

mkdir -p /home/work/local/mysql/{tmp,log,data,etc}

touch /home/work/local/mysql/tmp/mysql.sock

/home/work/local/mysql/bin/mysql_install_db --datadir=/home/work/local/mysql/data

nohup /home/work/local/mysql/libexec/mysqld --basedir=/home/work/local/mysql --datadir=/home/work/local/mysql/data/ --pid-file=/home/work/local/mysql/mysql.pid --skip-external-locking --port=8306 --socket=/home/work/local/mysql/tmp/mysql.sock &

/home/work/local/mysql/bin/mysqladmin -u root password 'root_password'

GRANT REPLICATION SLAVE ON *.* TO 'user'@'ip' IDENTIFIED BY 'password';

配置方式:http://blog.csdn.net/dba_waterbin/article/details/8878343 权限:http://www.cnblogs.com/xyzdw/archive/2011/08/11/2135227.html

Clone this wiki locally