欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

MySQL8.0MIC高可用集群的搭建過程

本篇內(nèi)容主要講解“MySQL8.0 MIC高可用集群的搭建過程”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學(xué)習(xí)“MySQL8.0 MIC高可用集群的搭建過程”吧!

郯城網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)公司,郯城網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為郯城成百上千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務(wù)好的郯城做網(wǎng)站的公司定做!

一,集群部署

1.1 安裝環(huán)境;

操作系統(tǒng):Linux,版本:CentOS-7-x86

介質(zhì)準(zhǔn)備:無

環(huán)境清理

釋放yum進程

[root@bug ~]# ps -ef|grep yum root     22481  1694  5 17:23 ?        00:00:03 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none root     22591 22507  1 17:24 pts/    00:00:00 grep --color=auto yum [root@bug ~]# kill -9 22481

查看是否有多余系統(tǒng),有則卸載

1

2

[root@bug ~]# rpm -qa|grep mairadb

[root@bug ~]# rpm -qa|grep mysql

關(guān)閉防火墻

1

2

3

4

[root@bug ~]# systemctl status firewalld.service

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

   Active: inactive (dead)

關(guān)閉selinux,重啟系統(tǒng)后生效

[root@bug selinux]# vi /etc/selinux/config SELINUX=disabled

[root@bug selinux]# reboot

1.2 安裝MySQL8.0

1

2

3

[root@bug ~]# yum install -y wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

[root@bug ~]# yum list|grep mysql

[root@bug ~]# yum install -y mysql-community-client.x86_64 mysql-router.x86_64 mysql-shell.x86_64

采用YUM源安裝方式,總下載量約400M,

1.3自動集群部署

部署節(jié)點1

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

[root@bug ~]# mysqlsh

 

 MySQL  JS >  dba.deploySandboxInstance(3310);

A new MySQL sandbox instance will be created on this host in

/root/mysql-sandboxes/3310

 

Warning: Sandbox instances are only suitable for deploying and

running on your local machine for testing purposes and are not

accessible from external networks.

 

Please enter a MySQL root password for the new instance: ******

Deploying new MySQL instance...

 

Instance localhost:3310 successfully deployed and started.

Use shell.connect('root@localhost:3310'); to connect to the instance.

第一個節(jié)點部署完畢,端口設(shè)置為3310,登陸賬號為root@localhost,密碼 ******

使用本地認證的方式, 登陸數(shù)據(jù)庫實例,進行驗證。

1

2

3

[root@bug ~]# mysql -uroot -porange -S /root/mysql-sandboxes/3310/sandboxdata/mysqld.sock

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

同樣的方法,部署節(jié)點2,節(jié)點3。

1

2

3

MySQL  JS >  dba.deploySandboxInstance(3320);

 

MySQL  JS > dba.deploySandboxInstance(3330);

1.4創(chuàng)建集群

此實驗采用簡單的創(chuàng)建本地集群。

1

2

3

4

5

6

7

8

9

10

11

12

MySQL  JS >  \connect root@localhost:3310

Creating a session to 'root@localhost:3310'

 

*****************************************************

 MySQL  localhost:3310 ssl  JS >  var cluster=dba.createCluster('test')

A new InnoDB cluster will be created on instance 'root@localhost:3310'.

 

*********************************************************

 

Cluster successfully created. Use Cluster.addInstance() to add MySQL instances.

At least 3 instances are needed for the cluster to be able to withstand up to

one server failure.

集群系統(tǒng)已經(jīng)創(chuàng)建成功,最后一行:At least 3 instances are needed for the cluster to be able to withstand up to one server failure.提示需要至少三個實例,才能保證災(zāi)備,所以接下來,將節(jié)點2,3添加進集群。

1

2

3

4

5

6

7

8

MySQL  localhost:3310 ssl  JS > cluster.addInstance( 'root@localhost:3320')

 

The instance 'root@localhost:3320' was successfully added to the cluster.

 

 

 MySQL  localhost:3310 ssl  JS > cluster.addInstance( 'root@localhost:3330')

 

The instance 'root@localhost:3330' was successfully added to the cluster.

查看集群狀態(tài)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

MySQL  localhost:3310 ssl  JS > dba.getCluster().status()

{

    "clusterName": "test",

    "defaultReplicaSet": {

        "name": "default",

        "primary": "localhost:3310",

        "ssl": "REQUIRED",

        "status": "OK",

        "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",

        "topology": {

            "localhost:3310": {

                "address": "localhost:3310",

                "mode": "R/W",

                "readReplicas": {},

                "role": "HA",

                "status": "ONLINE"

            },

            "localhost:3320": {

                "address": "localhost:3320",

                "mode": "R/O",

                "readReplicas": {},

                "role": "HA",

                "status": "ONLINE"

            },

            "localhost:3330": {

                "address": "localhost:3330",

                "mode": "R/O",

                "readReplicas": {},

                "role": "HA",

                "status": "ONLINE"

            }

        }

    },

    "groupInformationSourceMember": "mysql://root@localhost:3310"

}

一個簡單的包含三個節(jié)點的集群已經(jīng)創(chuàng)建完成。可以完成數(shù)據(jù)同步,讀寫分離等功能,比如此刻3310端口的狀態(tài)是"R/W",同時read與write,3320與3330的狀態(tài)是"R/O",只讀模式。

1.5配置中間件

此時的集群的高可用性還不完整,需要MySQL-router來完成集群與外部的對接,實現(xiàn)自動切換,故障轉(zhuǎn)移等功能。

MySQL-router的作用類似keepalived 類的中間件。當(dāng)主機發(fā)生故障后,自動將應(yīng)用切換到其他實例。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

[root@bug ~]#  mysqlrouter --bootstrap root@localhost:3310 --user=mysqlrouter

Please enter MySQL password for root: *****

 

Bootstrapping system MySQL Router instance...

Checking for old Router accounts

Creating account mysql_router2_j05xzi45m81x@'%'

MySQL Router  has now been configured for the InnoDB cluster 'test'.

 

The following connection information can be used to connect to the cluster.

 

Classic MySQL protocol connections to cluster 'test':

- Read/Write Connections: localhost:6446

- Read/Only Connections: localhost:6447

X protocol connections to cluster 'test':

- Read/Write Connections: localhost:64460

- Read/Only Connections: localhost:64470

 

Existing configurations backed up to '/etc/mysqlrouter/mysqlrouter.conf.bak'

[root@bug ~]# mysqlrouter&

[1] 25602

[root@bug ~]#  ps -ef|grep router

mysqlro+ 25602 22507  8 19:35 pts/0    00:00:01 mysqlrouter

root     25619 22507  0 19:36 pts/0    00:00:00 grep --color=auto router

驗證MySQL-router安裝效果

在MySQL-router默認配置下,

主機端口:6446

從庫端口:6447

1

2

3

4

5

[root@bug ~]#  mysql -uroot -h 127.0.0.1 -P 6446 -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

********************************************************8

mysql>

證明MySQL-router配置完成可用。

 1.6驗證集群效果

1,通過router同時登陸三個節(jié)點,查看端口號。

2,在節(jié)點1構(gòu)造數(shù)據(jù),在節(jié)點2,3差看狀態(tài),驗證數(shù)據(jù)同步性。

3,節(jié)點1(主機)離線,查看集群狀態(tài)與節(jié)點2,節(jié)點3狀態(tài),驗證災(zāi)備能力。

到此,相信大家對“MySQL8.0 MIC高可用集群的搭建過程”有了更深的了解,不妨來實際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

網(wǎng)頁標(biāo)題:MySQL8.0MIC高可用集群的搭建過程
當(dāng)前路徑:http://www.aaarwkj.com/article42/googec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動態(tài)網(wǎng)站、品牌網(wǎng)站制作網(wǎng)站改版、網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站排名

廣告

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

小程序開發(fā)
成人色视频免费在线观看| 国产精品三级竹菊影视| 久久久精品在线免费视频| 免费看欧美粗又大爽老| 欧美一区二区亚洲天堂| 日本东京热二三四区不卡免费的| 欧美日韩久久久久久精品| 日韩在线视频 一区二区三区| 亚洲乱色一区二区三区丝袜| 日韩免费av在线网站| 黄片色呦呦视频免费看| 日韩精品视频播放一区| 日本一欧美一欧美一亚洲| 色婷婷精品二区久久蜜臀av| 日韩精品一区福利合集| 日韩亚洲一区在线观看| av 一区二区三区av| 日韩欧美国产综合一区二区| 亚洲成熟中老妇女视频| 四虎在线观看精品一区| 亚洲91无专砖码高清观看| 久久精品视频亚洲一级| 在线播放欧美视频91| 未满十八禁止观看免费| 成人黄色av在线看| 亚洲熟女少妇淫语高潮| 一级片欧美女人性生活片| 熟妞人妻精品一区二区视频| 国产欧美精品久久三级| 99中文字幕国产精品| 精品国产伦一区二区三区在线| 最新天堂av资源在线观看| 久久精品国产精品亚洲片| 天堂免费av在线播放| 尤物天堂av一区二区| 高清欧美大片免费观看| 丰满少妇在线观看网站| 欧美福利区免费观看视频| 国产传媒在线免费播放视频| 成年人国产免费在线观看| 美女高潮啪啪啪91|