国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MySQL-MMM安裝指南(Multi-Master Replication Manager for MySQL)

2024-07-24 12:47:38
字體:
來源:轉載
供稿:網友

最基本的MMM安裝必須至少需要2個數據庫服務器和一個監控服務器下面要配置的MySQL Cluster環境包含四臺數據庫服務器和一臺監控服務器,如下:

functioniphostnameserver id
monitoring host192.168.0.10mon-
master 1192.168.0.11db11
master 2192.168.0.12db22
slave 1192.168.0.13db33
slave 2192.168.0.14db44

如果是個人學習安裝,一下子找5臺機器不太容易,可以虛擬機就可以完成。

 配置完成后,使用下面的虛擬IP訪問MySQL Cluster,他們通過MMM分配到不同的服務器。

iproledescription
192.168.0.100writer應用程序應該連接到這個ip進行寫操作
192.168.0.101reader應用程序應該鏈接到這些ip中的一個進行讀操作
192.168.0.102reader
192.168.0.103reader
192.168.0.104reader

結構圖如下:

2. Basic configuration of master 1

First we install MySQL on all hosts:
aptitude install mysql-serverThen we edit the configuration file /etc/mysql/my.cnf and add the following lines - be sure to use different server ids for all hosts:

復制代碼 代碼如下:

server_id = 1
log_bin = /var/log/mysql/mysql-bin.log
log_bin_index = /var/log/mysql/mysql-bin.log.index
relay_log = /var/log/mysql/mysql-relay-bin
relay_log_index = /var/log/mysql/mysql-relay-bin.index
expire_logs_days = 10
max_binlog_size = 100M
log_slave_updates = 1


Then remove the following entry:
bind-address = 127.0.0.1Set to number of masters:
auto_increment_increment = 2Set to a unique, incremented number, less than auto_increment_increment, on each server

auto_increment_offset = 1Do not bind of any specific IP, use 0.0.0.0 instead:

bind-address = 0.0.0.0Afterwards we need to restart MySQL for our changes to take effect:

/etc/init.d/mysql restart

3. Create usersNow we can create the required users. We'll need 3 different users:

function
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 梁山县| 巴林左旗| 昭通市| 泉州市| 朔州市| 长兴县| 新平| 美姑县| 宜章县| 凤庆县| 松潘县| 张家口市| 子长县| 比如县| 门头沟区| 定西市| 普格县| 本溪市| 车险| 田东县| 嘉义县| 鲁山县| 岳普湖县| 泰和县| 富宁县| 武山县| 万安县| 宁国市| 中牟县| 平原县| 民县| 图片| 额敏县| 潮安县| 福清市| 深泽县| 龙海市| 沂源县| 宿州市| 象山县| 宁晋县|