分类目录

Howto: MySQL Master Slave Configuration

Mysql Master-Slave configuration 网络环境

主服务器:server1, 192.168.2.231

备份服务器:server2, 192.168.1.78

配置主备数据库 创建同步用户

在主数据库上创建同步用户,以便该帐号可以访问主数据库。

e.g.

mysql> GRANT REPLICATION SLAVE ON *.* TO ‘repl’@’192.168.1.78′ IDENTIFIED BY ’123456′;

验证方法,可以登录到备份服务器使用下面的命令访问主服务器,如果可以访问说明配置正确:

# mysql –u repl –p –h 192.168.2.231

修改数据库配置文件

注意:所有服务器的server-id不能相同!!!

1. 修改主配置文件

# vi /etc/my.cnf

[mysqld]

log-bin=mysql-bin

server-id=1   # 1 – 2^32-1

2. 修改备配置文件

# vi /etc/my.cnf

[mysqld]

server-id=101      # 1 – [...]

Howto: 安装配置CentOS文件同步

Homepage: inotify-tools

master: the source host slave: the destination host

1. Download inotify-tools package and installation

master # cd ~ master # wget https://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz master # tar zxvf inotify-tools-3.14.tar.gz master # cd inotify-tools-3.14 master # ./configure master # make master # make install

2. Generate the SSH KEY to access without the password

master # [...]

Howto: narro installation and setup

Homepage: Narro

Download version:

narro-0.9.4.tar.gz

OS version: CentOS 5

# uname -a Linux hzserver2 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

Installation path:

# cat /etc/httpd/conf.d/narro.conf …… Alias /narro /var/www/narro

Order Deny,Allow Deny from all # Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx/24

Modify the config file:

[...]