close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_delta.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Oct 7, 2008, 3:07:11 PM (16 years ago)
- Author:
-
rider
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
7 | 7 | Debian GNU/Linux Etch 4.0r4 with kernel 2.6.18[[BR]] |
8 | 8 | |
| 9 | === Part1: 安裝MySQL 5.0 === |
| 10 | |
9 | 11 | '''步驟一 :''' 安裝 MySQL (假定 Master1 & Master2 都還沒有安裝 MySQL database)[[BR]] |
10 | 12 | |
… |
… |
|
12 | 14 | ''rider@ocean:~$ sudo apt-get install mysql-server-5.0 mysql-client-5.0''[[BR]] |
13 | 15 | |
14 | | '''步驟二 :''' 為了要確保同步設定有效,我們讓MySQL可以在該網路介面上(interface)任意開啟監聽的埠(port)並藉由編輯 /etc/mysql/my.cnf 來註釋 bind-address. |
| 16 | '''步驟二 :''' 為了要確保同步設定有效,我們讓MySQL可以在該網路介面上(interface)任意開啟監聽的埠(port)並藉由編輯 /etc/mysql/my.cnf 將 bind-address註釋起來. |
15 | 17 | |
16 | 18 | 使用指令[[BR]] |
… |
… |
|
25 | 27 | |
26 | 28 | 使用指令[[BR]] |
27 | | ''rider@ocean:~$ sudo /etc/init.d/mysql restart''[[BR]] |
| 29 | ''rider@ocean:~$ sudo su''[[BR]] |
| 30 | ''root@ocean:~$ /etc/init.d/mysql restart''[[BR]] |
28 | 31 | |
29 | 32 | '''步驟四 :''' 檢查MySQL所開啟的連接埠 |
30 | 33 | |
31 | 34 | 使用指令[[BR]] |
32 | | ''rider@ocean:~$ netstat -tunlp | grep mysql''[[BR]] |
| 35 | ''root@ocean:~$ netstat -tap | grep mysql''[[BR]] |
33 | 36 | {{{ |
34 | | tcp 0 0 *:mysql *:* LISTEN 2671/mysqld |
| 37 | tcp 0 0 *:mysql *:* LISTEN 21678/mysqld |
35 | 38 | }}} |
36 | 39 | |
… |
… |
|
38 | 41 | |
39 | 42 | 使用指令[[BR]] |
40 | | ''rider@ocean:~$ sudo mysqladmin -u root password yourrootsqlpassword''[[BR]] |
| 43 | ''root@ocean:~$ mysqladmin -u root password yourrootsqlpassword''[[BR]] |
| 44 | |
| 45 | '''/* @Master1 */''' [[BR]] |
| 46 | |
| 47 | '''步驟六 :''' 設定 root@master1.nchc.org.tw的MySQL使用者密碼 |
| 48 | |
| 49 | 使用指令[[BR]] |
| 50 | ''root@ocean:~$ mysqladmin -h master1.nchc.org.tw -u root password yourrootsqlpassword''[[BR]] |
| 51 | |
| 52 | '''步驟七 :''' 設定一組同步使用者 slave2_user 給 Master2 能存取 Master1 的MySQL 資料庫的權限 |
| 53 | |
| 54 | 使用指令[[BR]] |
| 55 | ''root@ocean:~$ mysql -u root -p''[[BR]] -> 登入MySQL |
| 56 | |
| 57 | ''Enter password: rootmysqlpasswd''[[BR]] -> 輸入root 的 MySQL 登入密碼 |
| 58 | |
| 59 | ''GRANT REPLICATION SLAVE ON *.* TO 'slave2_user'@'%' IDENTIFIED BY 'slave2_password';[[BR]]FLUSH PRIVILEGES;[[BR]]quit;[[BR]]'' -> 設定使用者: slave2_user 的同步權限並給予密碼 |
| 60 | |
| 61 | '''/* @Master2 */''' [[BR]] |
| 62 | |
| 63 | '''步驟八 :''' 設定 root@master2.nchc.org.tw的MySQL使用者密碼,與設定一組同步使用者 slave1_user 給 Master1 能存取 Master2 的MySQL 資料庫的權限(重複步驟六&七: 設定 Master1 MySQL的方法) |
| 64 | |
| 65 | 使用指令[[BR]] |
| 66 | |
| 67 | ''root@ocean:~$ mysqladmin -h master1.nchc.org.tw -u root password yourrootsqlpassword''[[BR]] |
| 68 | |
| 69 | ''root@ocean:~$ mysql -u root -p''[[BR]] -> 登入MySQL |
| 70 | |
| 71 | ''Enter password: rootmysqlpasswd''[[BR]] -> 輸入root 的 MySQL 登入密碼 |
| 72 | |
| 73 | ''GRANT REPLICATION SLAVE ON *.* TO 'slave1_user'@'%' IDENTIFIED BY 'slave1_password';[[BR]]FLUSH PRIVILEGES;[[BR]]quit;[[BR]]'' -> 設定使用者: slave1_user 的同步權限並給予密碼 |
| 74 | |
| 75 | === 注意事項 === |
41 | 76 | |
42 | 77 | |
43 | 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |