99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

MySQL數據管理7

部署MySQL高可集群 mysql-mmm + mysql主從同步

創新互聯主要從事成都網站制作、成都網站設計、外貿營銷網站建設、網頁設計、企業做網站、公司建網站等業務。立足成都服務榆次,10多年網站建設經驗,價格優惠、服務專業,歡迎來電咨詢建站服務:18982081108

環境準備  (四臺數據庫服務器 12   11    10    9 )

systemctl  stop firewalld

setenforce  0

配置YUM源

yum -y  install  gcc  gcc-c++   perl-*

systemctl   start  mysqld

++++++++++++++++++++++++++++++

一 配置mysql主從同步(12   11    10    9 )

9 和  10   配置為主主結構

12  和  11  配置為 10 的從數據庫服務器

要求:客戶端訪問數據庫服務器9時 創建的庫表記錄 在 11 和12 

上也要有。

用戶授權:

1 有同步數據權限的用戶(9 和 10)

grant  replication  slave  on  *.*   to  slaveuser@"%"  

identified by "123456";

把9 和  10   配置為主主結構

9

vim /etc/my.cnf

[mysqld]

server_id=9

log_bin=master9

binlog_format="mixed"

:wq

10

vim /etc/my.cnf

[mysqld]

server_id=10

log_bin=master10

binlog_format="mixed"

log_slave_updates

:wq

9

mysql> change master  to  

master_host="192.168.4.10",master_user="slaveuser",

master_password="123456",master_log_file="master10

.000001",master_log_pos=154;

mysql> show slave status\G;

10

mysql> change master  to  

master_host="192.168.4.9",master_user="slaveuser",m

aster_password="123456",master_log_file="master9.00

0001",master_log_pos=154;

mysql> show slave status\G;

12  和  11  配置為 10 的從數據庫服務器

11

vim /etc/my.cnf

[mysqld]

server_id=11

:wq

12

vim /etc/my.cnf

[mysqld]

server_id=12

:wq

11 和 12 

mysql> change master  to  

master_host="192.168.4.10",master_user="slaveuser",

master_password="123456",master_log_file="master10

.000001",master_log_pos=154;

mysql> show slave status\G;

測試注冊同步配置:

9

mysql> create  database gamedb;

mysql>grant all on gamedb.*  to  stu10@"%" identified 

by "123456";

254

mysql  -h292.168.4.9  -ustu10  -p123456  gamedb

mysql> create  table  t1(id int);

mysql> insert into  t1  values(100);

在其他3臺數據庫服務器上能夠查看記錄和授權用戶

select  user,host  from mysql.user  where  user="stu10";

select  * from gamedb.t1;

二、配置mysql-mmm

mysql-mmm軟件介紹

mmm_monitor 監控服務 運行在監控端

mmm_agentd  代理服務  運行在數據庫服務器上

ip規劃

寫vip地址 192.168.4.100 (9  、10)

讀vip地址 192.168.4.101/102 (11  、12)

配置監控服務器8

systemctl  stop firewalld

setenforce  0

配置YUM源

yum -y  install  gcc  gcc-c++   perl-*

裝包 (12  、 11   、 10 、 9 、8)

5  unzip mysql-mmm.zip 

cd mysql-mmm/

tar -zxvf mysql-mmm-2.2.1.tar.gz

cd mysql-mmm-2.2.1/

make install

配置文件說明

ls /etc/mysql-mmm/

mmm_mon.conf   mmm_monitor 監控服務的主配置文件

mmm_agent.conf   mmm_agentd  代理服務

mmm_common.conf  公共文件( 監控服務器和數據庫服務器

都要有)

修改配置文件

1、修改4臺數據庫服務器上mmm_agentd  代理服務的主配置

文件

vim  /etc/mysqlmmm/mmm_agent.conf 

include mmm_common.conf

this 主機名  #自定義

:wq

2 修改監控服務器上的mmm_monitor 監控服務的主配置文件

3 修改公共文件mmm_common.conf  公共文件

4 在4臺數據庫服務器上根據mmm_common.conf配置文件中

的設置添加對應的授權用戶。

mysql>grant  replication  client  on *.*  to      

monitor@"%"   identified by    "123456";

mysql>grant  replication client,process,super on *.*  to    

 agent@“%" identified by   "123456";

四、啟動服務

4.2 啟動數據庫服務器上agnetd服務

2  rpm -ivh perl-Log-Log4perl-1.26-1.el6.rf.noarch.rpm 

  4  tar -zxvf Algorithm-Diff-1.1902.tar.gz 

  6  cd Algorithm-Diff-1.1902/

  8  perl Makefile.PL

  9  make

  10  make install

   13  tar -zxvf Proc-Daemon-0.03.tar.gz 

   14  cd Proc-Daemon-0.03/

   16  perl Makefile.PL 

   17  make

   18  make install

21  gunzip Net-ARP-1.0.8.tgz 

23  tar -xvf Net-ARP-1.0.8.tar 

25  cd Net-ARP-1.0.8/

27  perl Makefile.PL 

28  make 

29  make install

31  /etc/init.d/mysql-mmm-agent status

 32  /etc/init.d/mysql-mmm-agent start

 33  netstat -utnalp  | grep :9989

ls /var/log/mysql-mmm/mmm_agentd.log

4.3 啟動監控服務器上monitor服務

  2  rpm -ivh perl-Log-Log4perl-1.26-1.el6.rf.noarch.rpm 

  4  tar -zxvf Algorithm-Diff-1.1902.tar.gz 

  6  cd Algorithm-Diff-1.1902/

  8  perl Makefile.PL

  9  make

  10  make install

   13  tar -zxvf Proc-Daemon-0.03.tar.gz 

   14  cd Proc-Daemon-0.03/

   16  perl Makefile.PL 

   17  make

   18  make install

  27  /etc/init.d/mysql-mmm-monitor status

   28  /etc/init.d/mysql-mmm-monitor start

   29  netstat -utnalp  | grep :9988

   30  ls /var/log/mysql-mmm/mmm_mond.log 

登錄監控服務器8的管理頁面查看數據庫服務器的狀態

# mmm_control help

# mmm_control show

# mmm_control  set_online  master9

# mmm_control  set_online  master10

# mmm_control  set_online  master11

# mmm_control  set_online  master12

# mmm_control show

在數據庫服務器本機查看獲取的虛擬ip地址

#ip  addr  show  | grep  192.168.4.100

  

測試配置

254客戶端訪問

ping  192.168.4.100

mysql  -h292.168.4.100   -ustu10  -p123456   gamedb

分享標題:MySQL數據管理7
新聞來源:http://www.yijiale78.com/article8/gjhsip.html

成都網站建設公司_創新互聯,為您提供外貿建站、軟件開發域名注冊、App設計、電子商務

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

網站建設網站維護公司