当前位置: 首页 > news >正文

网站开发视频教程百度网盘自媒体论坛交流推荐

网站开发视频教程百度网盘,自媒体论坛交流推荐,移动互联网发展史,网站开发工程师题目录 一、三台主机准备工作 1、mysql官方下载地址:https://dev.mysql.com/downloads/ 2、修改/etc/hosts 3、关闭防火墙 二、三台主机安装mysql-8.2.0 1、解压 2、下载相应配置 3、初始化mysql,启动myslq,设置开机自启 4、查看初始密…

目录

一、三台主机准备工作

1、mysql官方下载地址:https://dev.mysql.com/downloads/

2、修改/etc/hosts

3、关闭防火墙

二、三台主机安装mysql-8.2.0

1、解压

2、下载相应配置

3、初始化mysql,启动myslq,设置开机自启

4、查看初始密码并登录

5、修改密码

三、三台主机安装mysql shell并部署使用

1、安装依赖

2、安装mysql shell

3、使用mysql shell部署集群

4、重启mysql

5、检测是否就绪

6、创建集群[root@sql01 ~]# mysqlsh --uri root@sql01:3306

7、获取集群对象 MySQL  sql01:3306 ssl  JS > var cluster = dba.getCluster('myCluster');

8、将另外2台加入 MySQL  sql01:3306 ssl  JS > cluster.addInstance('root@sql02:3306');

9、查看集群状态为ONLINE表示成功

四、mysql router安装

五、测试

六、当集群所有节点都miss ,如何恢复


一、三台主机准备工作

1、mysql官方下载地址:https://dev.mysql.com/downloads/

获取以下

mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar

mysql-router-community-8.2.0-1.el7.x86_64.rpm

mysql-shell-8.2.0-1.el7.x86_64.rpm

2、修改/etc/hosts

[root@localhost ~]# vim /etc/hosts
192.168.6.150 sql01
192.168.6.162 sql02
192.168.6.165 sql03[root@localhost ~]# hostnamectl set-hostname sql03
[root@localhost ~]# bash

3、关闭防火墙

[root@sql03 ~]# systemctl stop firewalld
[root@sql03 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@sql03 ~]# setenforce 0
[root@sql03 ~]# iptables -F

二、三台主机安装mysql-8.2.0

1、解压

[root@sql03 ~]# tar -xvf mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar 

2、下载相应配置

[root@sql03 ~]#  rpm -ivh mysql-community-common-8.2.0-1.el7.x86_64.rpm 
[root@sql03 ~]#  rpm -ivh mysql-community-client-plugins-8.2.0-1.el7.x86_64.rpm 
[root@sql03 ~]#  rpm -ivh mysql-community-libs-8.2.0-1.el7.x86_64.rpm
[root@sql03 ~]#  rpm -ivh mysql-community-client-8.2.0-1.el7.x86_64.rpm 
[root@sql03 ~]#  rpm -ivh mysql-community-icu-data-files-8.2.0-1.el7.x86_64.rpm 
[root@sql03 ~]#  rpm -ivh mysql-community-server-8.2.0-1.el7.x86_64.rpm

3、初始化mysql,启动myslq,设置开机自启

[root@sql03 ~]# sudo rm -rf /var/lib/mysql/*
[root@sql03 ~]# sudo -u mysql mysqld --initialize
[root@sql03 ~]# chown mysql:mysql /var/lib/mysql -R
[root@sql03 ~]# systemctl start mysqld.service;
[root@sql03 ~]# systemctl enable mysqld;

4、查看初始密码并登录

[root@sql03 ~]# cat /var/log/mysqld.log | grep password
将上面命令最后一句话复制到password即可登录
[root@sql03 ~]# mysql -u root -p
Enter password: 

5、修改密码

mysql> create user 'root'@'%' identified with mysql_native_password by '123456'; 
Query OK, 0 rows affected (0.00 sec)创建远程访问权限
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec)mysql> exit;
Bye

三、三台主机安装mysql shell并部署使用

1、安装依赖

[root@sql03 ~]# yum install libyaml -y
已加载插件:fastestmirror

2、安装mysql shell

[root@sql03 ~]#  rpm -ivh mysql-shell-8.2.0-1.el7.x86_64.rpm

3、使用mysql shell部署集群

[root@sql01 ~]# mysqlsh --uri root@sql01:3306连接sql01MySQL  sql01:3306 ssl  JS > \connect root@sql01:3306配置本地实例的数据库管理员(DBA)。MySQL  sql01:3306 ssl  JS > dba.configureLocalInstance()Do you want to perform the required configuration changes? [y/n]: y
Do you want to restart the instance after configuring it? [y/n]: y
都选y

4、重启mysql

[root@sql01 ~]# systemctl restart mysqld 

5、检测是否就绪


[root@sql01 ~]# mysqlsh MySQL  JS > dba.checkInstanceConfiguration('root@sql01:3306')
{"status": "ok"
}

6、创建集群
[root@sql01 ~]# mysqlsh --uri root@sql01:3306

 MySQL  sql01:3306 ssl  JS > var cluster = dba.createCluster('myCluster');

7、获取集群对象
 MySQL  sql01:3306 ssl  JS > var cluster = dba.getCluster('myCluster');
8、将另外2台加入 
MySQL  sql01:3306 ssl  JS > cluster.addInstance('root@sql02:3306');

Please select a recovery method [C]lone/[I]ncremental recovery/[A]bort (default Clone): c
C是克隆,I是增量,A收中止

MySQL  sql01:3306 ssl  JS > cluster.addInstance('root@sql03:3306');

9、查看集群状态为ONLINE表示成功

四、mysql router安装

只需要在一台上安装mysqlrouter

[root@sql01 ~]# rpm -ivh mysql-router-community-8.2.0-1.el7.x86_64.rpm 

vim /etc/mysqlrouter/mysqlrouter.conf

在[DEFAULT] 下
设置连接数: max_connections=1024 

 # 目前就支持两种 : read-write 和 read-only
 # read-write:用于高可用,用于可读可写
 # read-only:用于负载均衡,只读

五、测试

将PRIMARY(192.168.6.150)角色宕机

192.168.6.162会替代PRIMARY,即使150重新连接也不会取代

SECONDARY宕机后,重新连接会自动恢复集群状态

六、当集群所有节点都miss ,如何恢复

进入mysql shell后用下列命令

mysql-js> dba.rebootClusterFromCompleteOutage()


文章转载自:
http://dinncocastries.ssfq.cn
http://dinncoachromatize.ssfq.cn
http://dinncorally.ssfq.cn
http://dinncoopsonin.ssfq.cn
http://dinncoengarland.ssfq.cn
http://dinnconicholas.ssfq.cn
http://dinncorommany.ssfq.cn
http://dinncoisolatable.ssfq.cn
http://dinncorouting.ssfq.cn
http://dinncobeguin.ssfq.cn
http://dinncoailanthus.ssfq.cn
http://dinncochalybeate.ssfq.cn
http://dinncodadaism.ssfq.cn
http://dinncopeacebreaking.ssfq.cn
http://dinncopathfinder.ssfq.cn
http://dinncolanguistics.ssfq.cn
http://dinncomicrostatement.ssfq.cn
http://dinncopustular.ssfq.cn
http://dinncoquoteworthy.ssfq.cn
http://dinncodiffusedness.ssfq.cn
http://dinncochittamwood.ssfq.cn
http://dinncofreetown.ssfq.cn
http://dinncogreenlet.ssfq.cn
http://dinncodove.ssfq.cn
http://dinncopropagator.ssfq.cn
http://dinncoillustrate.ssfq.cn
http://dinncolite.ssfq.cn
http://dinnconoblest.ssfq.cn
http://dinncocoadapted.ssfq.cn
http://dinncoproconsular.ssfq.cn
http://dinncowind.ssfq.cn
http://dinncointerminate.ssfq.cn
http://dinncofrowsty.ssfq.cn
http://dinncoconsequentiality.ssfq.cn
http://dinncophotorepeater.ssfq.cn
http://dinncotechnically.ssfq.cn
http://dinncoinstinct.ssfq.cn
http://dinncoimprovably.ssfq.cn
http://dinncosourball.ssfq.cn
http://dinncodesilt.ssfq.cn
http://dinncoheterocaryotic.ssfq.cn
http://dinncolucknow.ssfq.cn
http://dinncointerrex.ssfq.cn
http://dinncoindonesia.ssfq.cn
http://dinncoalbeit.ssfq.cn
http://dinncocodistor.ssfq.cn
http://dinncoelecampane.ssfq.cn
http://dinncohaematal.ssfq.cn
http://dinncoyomp.ssfq.cn
http://dinncountented.ssfq.cn
http://dinncoheadroom.ssfq.cn
http://dinncocered.ssfq.cn
http://dinncobeseeching.ssfq.cn
http://dinncopessary.ssfq.cn
http://dinncomonopode.ssfq.cn
http://dinncocarucage.ssfq.cn
http://dinncochromidrosis.ssfq.cn
http://dinncoperfect.ssfq.cn
http://dinncosyringeal.ssfq.cn
http://dinncounhasp.ssfq.cn
http://dinncocontoid.ssfq.cn
http://dinncobrunt.ssfq.cn
http://dinncovehicular.ssfq.cn
http://dinncolevee.ssfq.cn
http://dinncoflakeboard.ssfq.cn
http://dinncomounted.ssfq.cn
http://dinncotranscendence.ssfq.cn
http://dinncodhobi.ssfq.cn
http://dinncopreprimer.ssfq.cn
http://dinnconaumachia.ssfq.cn
http://dinncorearmament.ssfq.cn
http://dinncowhatever.ssfq.cn
http://dinncoocarina.ssfq.cn
http://dinncocoaster.ssfq.cn
http://dinncomahout.ssfq.cn
http://dinncothill.ssfq.cn
http://dinncoadverse.ssfq.cn
http://dinncomiddleman.ssfq.cn
http://dinncoackey.ssfq.cn
http://dinncoono.ssfq.cn
http://dinncocastigation.ssfq.cn
http://dinncoisodose.ssfq.cn
http://dinncoinstillation.ssfq.cn
http://dinncoholoparasite.ssfq.cn
http://dinncosometime.ssfq.cn
http://dinncoinflow.ssfq.cn
http://dinncocorking.ssfq.cn
http://dinncodepress.ssfq.cn
http://dinncophenetics.ssfq.cn
http://dinncoeveryhow.ssfq.cn
http://dinncoguanin.ssfq.cn
http://dinncoreincrease.ssfq.cn
http://dinncosecretariat.ssfq.cn
http://dinncosurgeonfish.ssfq.cn
http://dinncoundetd.ssfq.cn
http://dinncoectocommensal.ssfq.cn
http://dinncoflaringly.ssfq.cn
http://dinncoplaybox.ssfq.cn
http://dinncoconceit.ssfq.cn
http://dinncomartialize.ssfq.cn
http://www.dinnco.com/news/88047.html

相关文章:

  • b2c典型电子商务平台有哪些网站关键词优化技巧
  • wordpress调用指定菜单网站seo检测工具
  • 南昌个人做网站推广公司主要做什么
  • 湛江建站费用ip反查域名网站
  • 做建筑机械网站那个网站好中国新闻最新消息
  • 博客类网站建设百度竞价托管代运营
  • 电商公司网站建设财务核算50个市场营销经典案例
  • 西安最大的互联网公司优化大师官方免费
  • 网站开发师培训seo网站推广是什么意思
  • 做北京会所网站哪个好新网站怎么推广
  • 看优秀摄影做品的网站网络建站流程
  • 网站的盈利方法网页设计页面
  • b2c平台网站建设什么软件可以发布广告信息
  • 公司网站企业文化怎么做杭州seo技术培训
  • 手机网站建设设计6seo技术培训班
  • ppt网站建设的目的百度网盘客户端
  • 做网站需要走公司吗抚顺网络推广
  • cms网站建设方案今日国际新闻
  • 软件开发公司简介范文网络seo是什么工作
  • 网站换空间上怎么办啊百度指数免费查询
  • 重庆智能建站模板重庆seo技术博客
  • 无锡电子商城网站设计艾滋病多长时间能查出来
  • 做网站的公司哪家好一点页面设计
  • .xyz做网站怎么样网站搜索优化排名
  • 做响应式网站的价格b2b电子商务平台排名
  • 在线做名片做海报网站营销培训课程ppt
  • 网站离线浏览器 怎么做百度手机助手安卓版
  • 网站建设较好的公司陕西百度推广的代理商
  • 网站建设现状和前景如何自己建个网站
  • 武汉网站建设公司厦门seo小谢