安装好了mysql监控神器innotop,正得意,innotoop不可用,其错误提示为install_driver(mysql) failed: Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file:...经查原有又是DBD惹的祸,这个问题已经发生过好几次了。 1、故障现象 [root@dbsrv1 ~]# cat /etc/issue CentOS release 5.11 (Final) Kernel \r on an \m [root@dbsrv1 ~]# innotop localhost PROCESSLIST_NO_IS: install_driver(mysql) failed: Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230. at (eval 504) line 3 Compilation failed in require at (eval 504) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/bin/innotop line 7601 2、安装perl-DBD-MySQL [root@dbsrv1 ~]# yum install perl-DBD-MySQL Loaded plugins: fastestmirror, security Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository contrib is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.163.com * epel: mirrors.ustc.edu.cn * extras: mirrors.skyshe.cn * updates: mirrors.pubyun.com Setting up Install Process Package perl-DBD-MySQL-3.0007-2.el5.x86_64 already installed and latest version Nothing to do ###上面描述已经perl-DBD-MySQL已经安装,且为最新的版本 [root@dbsrv1 yum.repos.d]# rpm -qa |grep -i dbd perl-DBD-MySQL-3.0007-2.el5 ###首先先卸载perl-DBD-MySQL,然后再次使用yum安装 [root@dbsrv1 yum.repos.d]# rpm -e --nodeps perl-DBD-MySQL-3.0007-2.el5 [root@dbsrv1 yum.repos.d]# rpm -qa |grep -i dbd [root@dbsrv1 yum.repos.d]# yum install perl-DBD-MySQL Loaded plugins: fastestmirror, security Repository base is listed more than once in the configuration Reposit
可知 perl-DBD-MySQL 已经安装了,和报错不符合 解决办法: 重装 perl-DBD-MySQL [root@master-qa ~]# yum list all | grep perl-DBD-MySQL perl-DBD-MySQL.x86_64 4.013-3.el6 @base [root@master-qa ~]# yum reinstall perl-DBD-MySQL.x86_64 Load
最近在使用yum方式安装perl-DBD-MySQL时碰到了Temporary failure in name resolution,Trying other mirror。即命名解析失败,尝试使用其它镜像。由于本机为最近安装的新服务器,下面是这个问题的现象描述及处理过程。 1、故障现象 ###当前环境 [root@GZDB ~]# cat /etc/issue CentOS release 5.11 (Final) Kernel \r on an \m [root@GZDB ~]# yum install perl-DBD-MySQL .............. http://mirrors.pubyun.com/centos/5.11/os/x86_64/CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')> Trying other mirror. http://mirrors.sina.cn/centos/5.11/os/x86_64/CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')> Trying other mirror. Error Downloading Packages: mysql-5.0.95-5.el5_9.x86_64: failure: CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm from base: [Errno 256] No more mirrors to try. perl-DBI-1.52-2.el5.x86_64: failure: CentOS/perl-DBI-1.52-2.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. perl-DBD-MySQL-3.0007-2.el5.x86_64: failure: CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. ###尝试ping百度,结果提示未知的主机 [root@GZDB yum.repos.d]# ping www.baidu.com ping: unknown host www.baidu.com [root@GZDB yum.repos.d]# ping www.baidu.com ping: unknown host www.baidu.com 2、故障解决 ###结合上面的错误提示及无法ping通百度,应该是dns解析未配置 [root@GZDB yum.repos.d]# more /etc/resolv.conf ###未配置dns解析 ###添加dns解析 [root@GZDB yum.repos.d]# echo " > nameserver 121.14.37.62 > nameserver 203.196.0.6">>/etc/resolv.conf [root@GZDB yum.repos.d]# ping www.baidu.com PING www.a.shifen.com (119.75.217.109) 56(84) bytes of data. 64 bytes from 119.75.217.109: icmp_seq=1 ttl=52 time=38.7 ms 64 bytes from 119.75.217.109: icmp_seq=2 ttl=52 time=38.8 ms 64 bytes from 119.75.217.109: icmp_seq=3 ttl=52 time=38.7 ms --- www.a.shifen.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 6078ms rtt min/avg/max/mdev = 38.711/38.742/38.801/0.165 ms ###再次yum perl-DBD-MySQL时成功 [root@GZDB yum.repos.d]# yum install perl-DBD-MyS
最近的MHA验证时,遭遇了DBD::mysql::dr::imp_data_size unexpectedly这个错误。而DBD这个包已经是安装过了的。下面是这个问题的描述和解决方案。
安装xtrabackup的时候,到了安装perl-DBD-MySQL这一步的时候报错
pt-kill 是 Percona Toolkit 中的一个工具,用于 kill MySQL 的连接。它的参数包括:
1、1主1从,两台间建立主从。另外有一台额外的,安装MHA管理端 2、从库my.cnf配置 relay_log_purge=0 log_bin=/xx/x-bin expire_logs_days=7 log-slave-updates=1 3、三台主机建免密登录 4、主从两台DB安装mha-node包 yum -y install perl-DBD-MySQL ncftp perl-DBI rpm -ivh mha4mysql-node-0.57-0.el7.noxxxx.rpm 5、所有节点添加MHA权限 grant all privileges on . to mha@10.0.0.% identified by 'mha'; flush privileges;
[root@MHA3 ~]# /usr/bin/purge_relay_logs --user=root --password=123456 -disable_relay_log_purge --port=3306 --workdir=/opt/mysql/data/ 2014-08-27 09:19:30: purge_relay_logs script started. install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 6) line 3. Perhaps the DBD::mysql perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge. at /usr/bin/purge_relay_logs line 162
安装percona-xtrabackup [root@slave-test src]# yum -y install percona-xtrabackup.x86_64 Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirrors.pubyun.com * extras: mirrors.pubyun.com * upd
MHA在MySQL数据库中被广泛使用,它小巧易用,功能强大,实现了基于MySQL replication架构的自手动主从故障转移,从库重定向到主库并自动同步。尽管如此,在部署配置的过程中,由于疏忽总难以避免这样或那样的错误。本文是对MHA配置中常见问题的一个汇总,供大家参考。
一:安装XtraBackup软件包 1)安装依赖包perl-DBD-MySQL perl-Digest-MD5 libev # yum -y install perl-DBD-MySQL perl-Digest-MD5 #rpm –ivh libev-4.15-1.el6.rf.x86_64.rpm 2)安装percona-xtrabackup #rpm -ivh percona-xtrabackup-*.rpm (需要安装包的童鞋可后台留言) 二:使用XtraBackup执行数据库备份 --host
xtrabackup是percona团队研发的备份工具,比MySQL官方的ibbackup的功能还要多。支持myisam温全备、innodb热全备和温增备,还可以实现innodb的定时点恢复,而且备份和恢复的速度都较快。在目前MySQL的备份实现上,考虑价格、速度、安全、一致性等角度,xtrabackup是非常合适的工具。 MariaDB也可以使用percona xtrabackup进行备份,不过MariaDB基于percona xtrabackup开发了它自己的备份工具:MariaDB Backup。它基
> xtrabackup是percona团队研发的备份工具,比MySQL官方的ibbackup的功能还要多。支持myisam温全备、innodb热全备和温增备,还可以实现innodb的定时点恢复,而且备份和恢复的速度都较快。在目前MySQL的备份实现上,考虑价格、速度、安全、一致性等角度,xtrabackup是非常合适的工具。
原文链接:https://rumenz.com/rumenbiji/linux-install-xtrabackup8.html
Percona XtraBackup是一个用于MySQL数据库备份的免费、开源的工具,能够在不停止MySQL服务器的情况下执行热备份。本节将详细介绍如何安装Percona XtraBackup 2.3.4版本,包括安装所需的依赖包、升级MySQL版本、安装Percona Toolkit、安装libev插件以及安装XtraBackup本身的步骤。
MyISAM是默认的存储引擎。 每个MyISAM在磁盘上存储成三个文件,每一个文件的名字均以表的名字开始,扩展名指出文件类型。
Dependencies Resolved ========================================================================================= Package Arch Version Repository Size ========================================================================================= Installing: mariadb x86_64 1:5.5.56-2.el7 base 8.7 M mariadb-server x86_64 1:5.5.56-2.el7 base 11 M Installing for dependencies: perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k perl-DBD-MySQL x86_64 4.023-6.el7 base 140 k perl-DBI x86_64 1.627-4.el7 base 802 k perl-IO-Compress noarch 2.061-2.el7 base 260 k perl-Net-Daemon noarch 0.48-5.el7 base 51 k perl-PlRPC noarch 0.2020-14.el7 base 36 k Transaction Summary ========================================================================================= Install2 Packages (+7 Dependent packages) Total download size: 21 M Installed size: 110 M Downloading packages: (1/9): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00 (2/9): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm | 140 kB 00:00:00 (3/9): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00 (4/9): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00 (5/9): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00:00 (6/9): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:01 (7/9): mariadb-server-5.5.56-2.el7.x86_64.rpm | 11 MB 00:00:08 (8/9): mariadb-5.5.56-2.el7.x86_64.rpm
今天在搭建MySQL MHA 安装MHA node所需的perl模块(DBD:mysql)时遇到了一个小的错误,如果思路不对的话,还是产生不少麻烦。
安装 MySQL使用 Mysql 作为数据库(py3) [root@h165 ~]# yum -y install mariadb mariadb-devel mariadb-serverLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirror.pregi.net * epel: mirror.pregi.net * extras: mirror.pregi.net * updates: mi
之前的文章中介绍了 MHA 的功能和原理,MHA 主要是通过对 master 自动进行故障转移,来保证集群的高可用,下面就实际搭建一下 MHA 环境 目标 搭建完成 MHA 环境,然后模拟 maste
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/148226.html原文链接:https://javaforall.cn
在日常的linux运维工作中,大数据量备份与还原,始终是个难点。关于mysql的备份和恢复,比较传统的是用mysqldump工具,今天这里推荐另一个备份工具innobackupex。innobackupex和mysqldump都可以对mysql进行热备份的,mysqldump对mysql的innodb的备份可以使用single-transaction参数来开启一个事务,利用innodb的mvcc来不进行锁表进行热备份,mysqldump备份是逻辑备份,备份出来的文件是sql语句,所以备份和恢复的时候很慢,但
DBA经常会遇到需定期对数据进行归档和清除,可利percona的pt-archiver工具能完成这一功能,使得数据归档变得方便简单。pt-archiver可以很轻松的将生产环境的历史数据归档到文件或者直接删除,还可以不同主机间同步数据,而不用将数据落盘,实现的功能有点类似Oracle的数据泵和dblink;pt-archiver一款非常好用的数据归档及清理历史数据的工具,工作中可以起到事半功倍的效果;
提到MySQL高可用性,很多人会想到MySQL Cluster,亦或者Heartbeat+DRBD,不过这些方案的复杂性常常让人望而却步,与之相对,利用MySQL复制实现高可用性则显得容易很多,目前大致有MMM,MHA等方案可供选择:MMM是最常见的方案,可惜它问题太多(What’s wrong with MMM,Problems with MMM for MySQL);相比之下,MHA是个更好的选择,经过DeNA大规模的实践应用证明它是个靠谱的工具。
线上数据库难免会有修改表结构的需求,MySQL 在修改表结构时会锁表,这就会影响读写操作,小表还好,一会儿就修改完成了,但大表会比较麻烦,下面看一个解决方案 解决思路 (1)新建一个表,结构就是要修改后的结构 (2)在旧表上建立触发器,旧表更新数据时同步到新表 (3)把旧表数据复制到新表 (4)数据同步完成后,执行重命名操作,交换新旧表 (5)删除旧表及触发器 实现方式 这个解决思路已经有了很成熟的工具,数据库服务公司 Percona 提供了 MySQL Toolkit 工具集,其中的 pt-online-
https://github.com/yoshinorim/mha4mysql-manager/wiki/Downloads
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116468.html原文链接:https://javaforall.cn
大体上差不多,不过8.0版本移除了innobackupex命令且只能备份8.0版本的MySQL
本文介绍使用XtraBackup工具,将云mysql数据库物理备份恢复到自建数据库
1、安装 rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm yum install perl-DBI yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL yum -y install perl-Digest-MD5 wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.10/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.10-1.el7.x86_64.rpm 2、创建备份用户
背景 最近正在拓展 MySQL 数据库知识 发现很多提及 "PerconaTookit" 管理工具的建议 会方便对数据库在线状态下的结构调整 在此,先进行安装一番 … 环境 MySQL版本: mysql 5.7.32 Linux 版本: CentOS7.9 PerconaTookit : 3.0.7 安装步骤 1). 安装第三方依赖包 首先需要安装几个第三方依赖包 yum install -y perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-
MHA由MHA节点(可以理解为子节点)及MHA管理节点2部分组成。因此对于MHA的安装,相应的也分为2个部分,即安装MHA节点,安装MHA管理节点。本文基于CentOS 5.9 64bit简要描述了MHA的安装,同时也描述了在配置MHA时需要完成的等效性配置。供大家参考。
链接: https://pan.baidu.com/s/12TScnbBXLOeeAR2nuB7DuA 提取码: mhgx
介绍:Anemometer 是一个图形化显示MySQL慢日志的工具。结合pt-query-digest,Anemometer可以很轻松的帮你去分析慢查询日志,让你很容易就能找到哪些SQL需要优化
1.安装依赖 yum install perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes perl perl-DBI perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-Digest-MD5
pt-heartbeat 数据库做主从复制时,复制状态、数据延迟是否正常是非常关键的指标,那么如何对其进行监控呢? pt-heartbeat 是 PERCONA 开发的一个工具集中的一个,专门用来监控MySQL和PostgreSQL的复制延迟。 比较成熟,例如Uber等大型公司都在使用。 监控原理 在 master 中建一个 heartbeat 表,其中有一个 时间戳 字段,pt-heartbeat 会周期性的修改时间戳的值。 slave 会复制 heartbeat表,其中就包含了 master执行修改动作
脚本中记着修改vip地址以及用户密码,均为后续需要登录的数据库密码,方便切换主从。
MHA服务有两种角色, MHA Manager(管理节点)和MHA Node(数据节点)
https://www.percona.com/software/mysql-tools/percona-toolkit
该文章是一篇介绍Apache Hive的技术文章,主要介绍了Hive的基本概念、架构设计、数据类型、数据存储、SQL语法、数据导入导出、元数据查询、Hive Web UI的使用、Hive CLI、Hive SQL和Hive Shell等方面的内容。此外,文章还介绍了Hive的生态系统,包括Hive的社区、生态系统、Hive的扩展和插件、Hive的数据安全等方面的内容。
MHA(Master High Availability)目前在 MySQL 高可用方面是一个相对成熟的解决方案,是一套优秀的作为 MySQL 高可用性环境下故障切换和主从提升的高可用软件。在MySQL 故障切换过程中,MHA 能做到在 0~30 秒之内自动完成数据库的故障切换操作,并且在进行故障切换的过程中,MHA 能在最大程度上保证数据的一致性,以达到真正意义上的高可用。
pt工具是非常实用有效的一个工具集,对于诊断常规问题还是非常有效的,相比于Oracle的工具,MySQL中没有那么多复杂的数据字典,在实现方式上相对更加轻巧,主要都是针对日志的挖掘。在庞大复杂的日志中能够找出一些非常有效的信息,确实难能可贵。 image.png 在官网上查看Percona的系列产品,可以看到Percona Toolkit的一个Logo好像是条鹿犬。 image.png 如果查看用户手册,可以看到里面有非常多的命令,如果没有分门别类还是没有任何的方向。 在此找到同事之前的分享,工具的分类如下
工作原理: Anemometer: 实现慢查询sql可视化 pt-query-digest :抽取慢查询日志 /etc/my.cnf 开启慢查询 【 #slow_query log_queries_not_using_indexes=1 long_query_time=1 slow_query_log=1 】 部署架构(单机部署): httpd 服务【相当于是tomcat 的用途,去为Anemometer提供服务】 pt-query-digest 慢查询日志抓取导入【从慢查询日志里面提取慢sql 写入到Anemometer 自身的数据库中,后面会将它写入定时任务中】 Anemometer 可视化展示【安装目录:/var/www/htm】 搭建Anemometer框架 前置工作: 1.关闭selinux setenforce 0 sed -i 's/enforcing/disabled/g' /etc/sysconfig/selinux
如果文章出现不完整,可以去我的个人博客查看,个人博客地址:https://blog.97hjh.cn
MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Facebook公司)开发,是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件。
俗话说:工欲善其事,必先利其器!如果你是做MySQL DBA或运维的,Percona-toolkit我相信这是你日常工作中必备的神器,能够高效的帮助您完成日常的工作;
一,安装cacti所需要的环境(mysql、mysql-server、httpd、php、php-mysql)-此部署环境并没有默认安装mysql,php,httpd等
1.安装依赖 yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL libev-devel
首先会启动一个xtrabackup_log后台检测的进程,实时检测mysql redo的变化,一旦发现redo有新的日志写入,立刻将日志写入到日志文件xtrabackup_log中 复制innodb的数据文件和系统表空间文件idbdata1到对应的以默认时间戳为备份目录的地方 复制结束后,执行flush table with read lock操作 复制.frm .myd .myi文件 并且在这一时刻获得binary log 的位置 将表进行解锁unlock tables 停止xtrabackup_log进程
领取专属 10元无门槛券
手把手带您无忧上云