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

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://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ā)
日韩成人在线高清视频| 国产福利91精品一区二区三| 91精品免费播放在线观看| 国产精品久久黑丝诱惑| 91精品国产高清一区二区性色| 男人天堂手机视频在线| 日韩国产亚洲欧美国产| 国产一区二区三区性色| 午夜在线观看欧美福利| 中国女人内射91熟女| 极品少妇高潮在线观看免费| 精华国产一区二区三区| 欧美女人又粗又长亚洲| 国产九色av在线一区尤物| 日韩av在线观看大全| 91激情黑丝在线观看| 欧美日韩精品乱码在线观看| 国产真实乱偷精品视频免| 国产精品一区二区毛卡片| 日韩精品一区二区三区中文| 亚洲中文字幕av每天更新| 国产成人亚洲综合色影视| 欧美丰满老妇性猛交| 免费在线观看97视频| 国产亚洲精品久在线| 国产二区三区在线播放| 夫妻性生活黄色录像视频| av在线免费观看大全| 久久视频在线播放视频| 男人天堂插插综合搜索| 国产一区二区欧美日本| 青青操国产在线自偷自拍| 日韩精品一二三黄色一级| 内射久久一区二区亚洲| 日本免费91午夜视频| av天天堂网在线播放| 麻豆成人三级电影在线| 日本亚洲中文字幕网站| 欧美亚日韩精品视频| 午夜福利激情视频在线| 国产免费久久黄av片|