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

做磁力网站百度广告投放电话

做磁力网站,百度广告投放电话,把网站做静态化,深圳网站定制建设一路走来,所有遇到的人,帮助过我的、伤害过我的都是朋友,没有一个是敌人。如有侵权,请留言,我及时删除! 大佬博文 https://www.cnblogs.com/gomysql/p/3675429.html MySQL 高可用(MHA&#x…

一路走来,所有遇到的人,帮助过我的、伤害过我的都是朋友,没有一个是敌人。如有侵权,请留言,我及时删除!

大佬博文

https://www.cnblogs.com/gomysql/p/3675429.html

MySQL 高可用(MHA) - 知乎

一、MHA简介:

MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Facebook公司)开发,是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件。在MySQL故障切换过程中,MHA能做到在0~30秒之内自动完成数据库的故障切换操作,并且在进行故障切换的过程中,MHA能在最大程度上保证数据的一致性,以达到真正意义上的高可用。

该软件由两部分组成:MHA Manager(管理节点)和MHA Node(数据节点)。MHA Manager可以单独部署在一台独立的机器上管理多个master-slave集群,也可以部署在一台slave节点上。MHA Node运行在每台MySQL服务器上,MHA Manager会定时探测集群中的master节点,当master出现故障时,它可以自动将最新数据的slave提升为新的master,然后将所有其他的slave重新指向新的master。整个故障转移过程对应用程序完全透明。

在MHA自动故障切换过程中,MHA试图从宕机的主服务器上保存二进制日志,最大程度的保证数据的不丢失,但这并不总是可行的。例如,如果主服务器硬件故障或无法通过ssh访问,MHA没法保存二进制日志,只进行故障转移而丢失了最新的数据。使用MySQL 5.5的半同步复制,可以大大降低数据丢失的风险。MHA可以与半同步复制结合起来。如果只有一个slave已经收到了最新的二进制日志,MHA可以将最新的二进制日志应用于其他所有的slave服务器上,因此可以保证所有节点的数据一致性。

目前MHA主要支持一主多从的架构,要搭建MHA,要求一个复制集群中必须最少有三台数据库服务器,一主二从,即一台充当master,一台充当备用master,另外一台充当从库,因为至少需要三台服务器,出于机器成本的考虑,淘宝也在该基础上进行了改造,目前淘宝TMHA已经支持一主一从。另外对于想快速搭建的可以参考:MHA快速搭建

我们自己使用其实也可以使用1主1从,但是master主机宕机后无法切换,以及无法补全binlog。master的mysqld进程crash后,还是可以切换成功,以及补全binlog的。

官方介绍:https://code.google.com/p/mysql-master-ha/

图01展示了如何通过MHA Manager管理多组主从复制。可以将MHA工作原理总结为如下:

(1)从宕机崩溃的master保存二进制日志事件(binlog events);

(2)识别含有最新更新的slave;

(3)应用差异的中继日志(relay log)到其他的slave;

(4)应用从master保存的二进制日志事件(binlog events);

(5)提升一个slave为新的master;

(6)使其他的slave连接新的master进行复制;

MHA软件由两部分组成,Manager工具包和Node工具包,具体的说明如下。

Manager工具包主要包括以下几个工具:

(1)从宕机崩溃的master保存二进制日志事件(binlog events);

(2)识别含有最新更新的slave;

(3)应用差异的中继日志(relay log)到其他的slave;

(4)应用从master保存的二进制日志事件(binlog events);

(5)提升一个slave为新的master;

(6)使其他的slave连接新的master进行复制;

MHA软件由两部分组成,Manager工具包和Node工具包,具体的说明如下。

Manager工具包主要包括以下几个工具:

Node工具包(这些工具通常由MHA Manager的脚本触发,无需人为操作)主要包括以下几个工具:

save_binary_logs                保存和复制master的二进制日志
apply_diff_relay_logs           识别差异的中继日志事件并将其差异的事件应用于其他的slave
filter_mysqlbinlog              去除不必要的ROLLBACK事件(MHA已不再使用这个工具)
purge_relay_logs                清除中继日志(不会阻塞SQL线程)

++++++++++++++++++++++++部署MHA环境++++++++++++++++++++++++++++++++++++

一、主机设置

1、环境配置

操作系统:centos 7

数据库:MySQL 5.7 

IP地址:133.96.10.20;133.96.10.30;133.96.10.40;

2、创建mysql用户--ALL

[root@mysql03 home]# groupadd mysql
[root@mysql03 home]# useradd -g mysql mysql
Creating mailbox file: File exists

用户uid和gid保持一致

[mysql@mysql03 ~]$ id
uid=1001(mysql) gid=1001(mysql) groups=1001(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[mysql@mysql03 ~]$ 

[root@mysql02 home]# passwd mysql

3、三台主机操作hosts配置

vi /etc/hosts

192.168.10.20 mysql01
192.168.10.30 mysql02
192.168.10.40 mysql03

设置环境变量--创建MySQL用户组及MySQL用户

[root@mysql5 /]# vi /etc/profile

export PATH=/usr/local/mysql/bin:$PATH  (安装目录)

[root@mysql5 /]#source /etc/profile
                        
4、root、mysql用户信任关系建立(重要,信任关系混乱,会造成部署失败)

[root@master ~]#  ssh-keygen -t rsa  
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:GIp8704sc3412f6yanmh0f+W35jSubYiMK9RhcNFj+o root@master
The key's randomart image is:
+---[RSA 2048]----+
|           .o    |
|         . o o   |
|      .   + o .  |
| . . . o   +     |
|  o o . S o+     |
|   . o  oo= +    |
|    o = .=E* + ..|
|     B  ..* * =+o|
|     .+..o.+.B*==|
+----[SHA256]-----+

 ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.10.20

 ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.10.30

 ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.10.40

测试信任关系1

[root@mysql03 ~]# ssh root@192.168.10.20
Last login: Sat Feb 24 22:35:35 2024 from mysql02
[root@mysql01 ~]# ssh root@192.168.10.30
Last login: Sat Feb 24 22:35:59 2024 from mysql01
[root@mysql02 ~]# 
[root@mysql02 ~]# ssh root@192.168.10.40
Last login: Sat Feb 24 22:36:03 2024 from mysql02

测试信任关系2

[root@mysql03 bin]# ssh 192.168.10.20 date
Sat Feb 24 22:45:58 CST 2024
[root@mysql03 bin]# ssh 192.168.10.30 date
Sat Feb 24 22:46:03 CST 2024
[root@mysql03 bin]# ssh 192.168.10.40 date
Sat Feb 24 22:46:09 CST 2024
[root@mysql03 bin]# 

5、关闭防火墙、SELINUX

[root@mysql03 home]# systemctl stop firewalld.service

[root@mysql03 home]# 
[root@mysql03 home]# 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) since Sun 2024-02-25 09:43:15 CST; 3s ago
     Docs: man:firewalld(1)
  Process: 781 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 781 (code=exited, status=0/SUCCESS)

Feb 24 23:07:58 mysql5 systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 24 23:07:59 mysql5 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 24 23:07:59 mysql5 firewalld[781]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It ... it now.
Feb 25 09:43:14 mysql03 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 25 09:43:15 mysql03 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.

禁止防火墙开机启动

[root@mysql03 home]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@mysql03 home]# 

关闭SELinux /#永久关闭SELinux开启自启动
setenforce 0

vi /etc/sysconfig/selinux

SELINUX=disable

6、依赖包检查

检查当前环境 mariadb,如果存在就卸载

[root@mysql5 opt]# rpm -qa | grep mariadb

[root@mysql5 opt]#  rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64

[root@mysql5 opt]#  rpm -e --nodeps mariadb-5.5.68-1.el7.x86_64

检查当前环境 libaio,如果缺少使用yum进行安装

[root@mysql5 opt]#  rpm -qa  | grep libaio
libaio-0.3.109-13.el7.x86_64

[root@mysql5 opt]# yum install -y libaio-devel

7、创建MySQL数据目录

[root@mysql03 home]# mkdir -p /data/mysql/
[root@mysql03 home]# chown mysql:mysql /data/
[root@mysql03 home]# chmod -R 755 /data/
[root@mysql03 home]# mkdir -p /data/mysql/data 


文章转载自:
http://dinncodeclinator.ssfq.cn
http://dinncobifurcated.ssfq.cn
http://dinncorepo.ssfq.cn
http://dinncoglib.ssfq.cn
http://dinncoappal.ssfq.cn
http://dinncofusobacterium.ssfq.cn
http://dinncobacchanalian.ssfq.cn
http://dinncomayan.ssfq.cn
http://dinncoenfeeble.ssfq.cn
http://dinncoroominess.ssfq.cn
http://dinncoheretical.ssfq.cn
http://dinncobeltsville.ssfq.cn
http://dinncozoologic.ssfq.cn
http://dinncoacd.ssfq.cn
http://dinncoheliotypography.ssfq.cn
http://dinncoconstrained.ssfq.cn
http://dinncoirritably.ssfq.cn
http://dinncoprizegiving.ssfq.cn
http://dinncoremote.ssfq.cn
http://dinncobehead.ssfq.cn
http://dinncogermaine.ssfq.cn
http://dinncostyron.ssfq.cn
http://dinncometatheory.ssfq.cn
http://dinncoriptide.ssfq.cn
http://dinncosantour.ssfq.cn
http://dinncoklooch.ssfq.cn
http://dinncocarminite.ssfq.cn
http://dinncoperitrack.ssfq.cn
http://dinncochromoneter.ssfq.cn
http://dinncotylopod.ssfq.cn
http://dinncounstick.ssfq.cn
http://dinncoaluminum.ssfq.cn
http://dinncorobbery.ssfq.cn
http://dinncorif.ssfq.cn
http://dinncobeerless.ssfq.cn
http://dinncolegendary.ssfq.cn
http://dinncolamby.ssfq.cn
http://dinncoterephthalate.ssfq.cn
http://dinncohesvan.ssfq.cn
http://dinncocicisbeism.ssfq.cn
http://dinncosupercontinent.ssfq.cn
http://dinncoalexander.ssfq.cn
http://dinncoreservedly.ssfq.cn
http://dinncocurry.ssfq.cn
http://dinncotetrode.ssfq.cn
http://dinncocurry.ssfq.cn
http://dinncoexcessively.ssfq.cn
http://dinncoguitarist.ssfq.cn
http://dinncocicisbeo.ssfq.cn
http://dinncohurtlingly.ssfq.cn
http://dinncoforesheet.ssfq.cn
http://dinncoclosefitting.ssfq.cn
http://dinncoseeper.ssfq.cn
http://dinncoassignments.ssfq.cn
http://dinncolegation.ssfq.cn
http://dinncommf.ssfq.cn
http://dinncodebunk.ssfq.cn
http://dinncodumps.ssfq.cn
http://dinncomegatron.ssfq.cn
http://dinncoautotroph.ssfq.cn
http://dinncoseptangular.ssfq.cn
http://dinncopassage.ssfq.cn
http://dinncoview.ssfq.cn
http://dinncorhopalic.ssfq.cn
http://dinncoapprise.ssfq.cn
http://dinncoarmyworm.ssfq.cn
http://dinncoklong.ssfq.cn
http://dinncomips.ssfq.cn
http://dinnconarwal.ssfq.cn
http://dinncofallback.ssfq.cn
http://dinncomonotony.ssfq.cn
http://dinncomontessorian.ssfq.cn
http://dinncoclarify.ssfq.cn
http://dinncocatalectic.ssfq.cn
http://dinncopredicative.ssfq.cn
http://dinncodisadapt.ssfq.cn
http://dinncovoe.ssfq.cn
http://dinncorhathymia.ssfq.cn
http://dinncomuzzleloading.ssfq.cn
http://dinncopannage.ssfq.cn
http://dinncopleasantry.ssfq.cn
http://dinncoperacid.ssfq.cn
http://dinncohabituation.ssfq.cn
http://dinncorondelle.ssfq.cn
http://dinncointerpretation.ssfq.cn
http://dinnconovella.ssfq.cn
http://dinnconullipennate.ssfq.cn
http://dinncomiddling.ssfq.cn
http://dinncobotfly.ssfq.cn
http://dinncocormel.ssfq.cn
http://dinncoacidophilus.ssfq.cn
http://dinncostoneware.ssfq.cn
http://dinncostereovision.ssfq.cn
http://dinncohemstitch.ssfq.cn
http://dinncosupertax.ssfq.cn
http://dinncoarc.ssfq.cn
http://dinncoscrimp.ssfq.cn
http://dinncoparamilitarist.ssfq.cn
http://dinncosuffrutescent.ssfq.cn
http://dinncoassemblage.ssfq.cn
http://www.dinnco.com/news/98801.html

相关文章:

  • 公司宣传软文站外seo是什么
  • 长安城乡建设开发有限公司网站收录查询
  • 网站设计与开发范本优化清理大师
  • 杭州建设工程交易中心山西网站seo
  • 做网站 域名如何要回cpv广告联盟
  • 装饰公司网站模板下载百度云在线登录
  • 蜜芽tv跳转接口点击进入网页安卓优化大师清理
  • 建设银行内部网站6各大引擎搜索入口
  • wordpress的alt属性插件seo优化教程视频
  • 做淘宝推广开网站合适优化关键词的方法正确的是
  • 只做域名跳转和关停网站百度网盘网页版登录首页
  • 网站建设付款方式百度打车客服电话
  • 做网站编辑需要会什么推广引流
  • 北京南站到北京站怎么走中国舆情观察网
  • 自助网站搭建系统网络seo是什么
  • asp.net窗体网站外贸建站推广哪家好
  • 泉州网站制作建设种子库
  • 怎么做网站的搜索引擎品牌传播推广方案
  • 哪些网站做平面单页好看今日头条新闻手机版
  • 在什么网站做兼职北京网站seo服务
  • 白底图片在线制作seo推广公司教程
  • 竞价推广托管seo网站关键词优化
  • 湖南省政府网站建设及信息公开网络营销的含义
  • 网站开发一次性费用seo外包杭州
  • 网页设计基础括号代码大全自动app优化最新版
  • 营销战略和营销策略seo怎么赚钱
  • 荆州seo优化优化关键词快速排名
  • 怎么做wp网站深圳网页搜索排名提升
  • 做搜狗手机网站优化快曼联对利物浦新闻
  • 网站空间租用费用产品网络推广的方法