ysql
Re
plication
_服务器_
比特网 21 Bestnewslave Ca Newsfront Panarama Php P 1 2489 Best New Slave" href="http://21.bestnewslave.com/feed//ca/newsfront/panarama.php?p=1-2489" />
ysql
Re
plication
_服务器_
比特网 21 Bestnewslave Ca Newsfront Panarama Php P 1 2489 Best New Slave
ysql
Re
plication
_服务器_
比特网 21 Bestnewslave Ca Newsfront Panarama Php P 1 2489 Best New Slave类似于从一台服务器拷贝数据库到另一台服务器上,但它是通过定义Master 和Slave的关系去实时地保证两个数据库的完全同步,这个功能在Mysql的3.23版中开始出现。
Master/Slave模式备份
TestEnv:
Master:Mysql-4.1.12 on Redhat9.0 IP:192.168. 0.217
Slave: Mysql-4.1.12 on Redhat9.0 IP:192.168.10.244
1、编译,安装
1. #tar –zxvf Mysql-4.1.12.tar.gz
2. #cd Mysql-4.1.12
3. .#/configure –prefix=/var/eyou/mysql
4. #make
5. #make install
6. #chown –R root /var/eyou/mysql
7. # chown –R mysql /var/eyou/mysql/var
8. #chgrp –R mysql /var/eyou/mysql
9. #scripts/mysql_install_db
10. #cp support-files/my-medium.cnf /etc/my.cnf
Mysql Replication
类似于从一台服务器拷贝数据库到另一台服务器上,但它是通过定义Master 和Slave的关系去实时地保证两个数据库的完全同步,这个功能在Mysql的3.23版中开始出现。
Master/Slave模式备份
TestEnv:
Master:Mysql-4.1.12 on Redhat9.0 IP:192.168. 0.217
Slave: Mysql-4.1.12 on Redhat9.0 IP:192.168.10.244
1、编译,安装
1. #tar –zxvf Mysql-4.1.12.tar.gz
2. #cd Mysql-4.1.12
3. .#/configure –prefix=/var/eyou/mysql
4. #make
5. #make install
6. #chown –R root /var/eyou/mysql
7. # chown –R mysql /var/eyou/mysql/var
8. #chgrp –R mysql /var/eyou/mysql
9. #scripts/mysql_install_db
10. #cp support-files/my-medium.cnf /etc/my.cnf
2、Master 机器设置权限,赋予Slave机器FILE及Replication Slave权利,并打包要同步的数据库结构。
Master# pwd
/var/eyou/mysql/bin
Master#./mysql –u root –p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT FILE ON *.* TO rep@192.168.0.244 IDENTIFIED BY ‘eyou’;
mysql> GRANT REPLICATION SLAVE ON *.* TO rep@192.168.0.244 IDENTIFIED BY ‘eyou’;
赋予192.168.10.244也就是Slave 机器有File权限, 这个4.1.12版对replication的权限好像做了调整,只赋予Slave机器有File权限还不行,还要给它REPLICATION SLAVE的权限才可以。
然后打包要复制的数据库
Master# cd var
Master# tar czvf reptest.tar.gz reptest
这样,我们得到一个reptest数据库的打包文件reptest.tar.gz
2设置主服务器Master的my.cnf,启动Mysql服务
Master# vi /etc/my.cnf
在[mysqld]添加或修改以下的
[mysqld]
log-bin #打开logbin选项以能写到slave的 I/O线程;
aM
ysql
Re
plication
_服务器_
比特网 21 Bestnewslave Ca Newsfront Panarama Php P 1 2489 Best New Slaveu y y Best j j Slave New New
wM
ysql
Re
plication
_服务器_
比特网 21 Bestnewslave Ca Newsfront Panarama Php P 1 2489 Best New Slavea v e Slave New