PMM部署遇到的坑

PMM部署遇到的坑

系统 内核版本
CentOS release 6.4 (Final) 2.6.32-358.el6.x86_64

1.公司环境pull不下来

在自己的环境pull下来然后save image

1
2
3
4
5
6
7
8
9
[root@slave oracle]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/percona/pmm-server 1.2.0 eb82a0e154c8 2 weeks ago 1.266 GB
docker.io/percona/pmm-server latest eb82a0e154c8 2 weeks ago 1.266 GB
[root@slave oracle]# docker save eb82a0e154c8 > pmm-server.tar
[root@slave oracle]# scp pmm-server.tar 10.4.2.43:~/
root@10.4.2.43's password:
pmm-server.tar 100% 1232MB 902.5KB/s 23:18

在原环境导入

1
[root@test2 ~]# docker load < pmm-server.tar

repostory和tag是

1
2
3
4
[root@test2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> abdf7c1b7a63 2 weeks ago 1.266 GB
<none> <none> 3690474eb5b4 11 months ago 0 B

修改tag

1
2
3
4
5
[root@test2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> abdf7c1b7a63 2 weeks ago 1.266 GB
<none> <none> 3690474eb5b4 11 months ago 0 B
[root@test2 ~]# docker tag abdf7c1b7a63 docker.io/percona/pmm-server:1.2.0

2.docker容器无法启动 no such file or directory statusCode=404

这个搜了半天不知道是什么原因,怀疑是内核版本太低

因为CentOS6.4自带内核版本是2.6.32-358.23.2.el6.x86_64,而Docker要求内核版本大于3.0,推荐3.8以上的内核

https://yq.aliyun.com/ziliao/48262

遂升级内核

1
wget http://elrepo.org/linux/kernel/el6/x86_64/RPMS/kernel-lt-3.10.107-1.el6.elrepo.x86_64.rpm

如果连接不对,自己去http://elrepo.org/linux/kernel/el6/x86_64/RPMS/看一眼,找一个合适的

1
rpm -ivh kernel-lt-3.10.107-1.el6.elrepo.x86_64.rpm

修改grub.conf

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
vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-LogVol00
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.107-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /vmlinuz-3.10.107-1.el6.elrepo.x86_64 ro root=/dev/mapper/VolGroup-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=VolGroup/LogVol00 rd_NO_DM rhgb quiet numa=off elevator=deadline
initrd /initramfs-3.10.107-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/VolGroup-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=VolGroup/LogVol00 rd_NO_DM rhgb quiet numa=off elevator=deadline
initrd /initramfs-2.6.32-358.el6.x86_64.img
现在title CentOS (3.10.107-1.el6.elrepo.x86_64)在 0 号位置,所以将
default=1改为default=0
重启os

重启后

1
2
3
4
[root@test2 ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@test2 ~]# uname -r
3.10.107-1.el6.elrepo.x86_64

再次创建container成功

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
[root@test2 ~]# docker load < pmm-server.tar
[root@test2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> abdf7c1b7a63 2 weeks ago 1.266 GB
<none> <none> 3690474eb5b4 11 months ago 0 B
[root@test2 ~]# docker tag abdf7c1b7a63 docker.io/percona/pmm-server:1.2.0
[root@test2 ~]# docker create \
> -v /opt/prometheus/data \
> -v /opt/consul-data \
> -v /var/lib/mysql \
> -v /var/lib/grafana \
> --name pmm-data \
> percona/pmm-server:1.2.0 /bin/true
094c63bd911b5139a267abe7939e5c4442cdc857970dedaccb9ae0cb5f165fc9
[root@test2 ~]# docker run -d \
> -p 80:80 \
> --volumes-from pmm-data \
> --name pmm-server \
> --restart always \
> percona/pmm-server:1.2.0
69195dca404bc607fa12a9cd6436a9786a71dcf226a0e4c1d6bf0b9879a14f03
[root@test2 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
69195dca404b percona/pmm-server:1.2.0 "/opt/entrypoint.sh" 11 seconds ago Up 9 seconds 0.0.0.0:80->80/tcp, 443/tcp pmm-server
094c63bd911b percona/pmm-server:1.2.0 "/bin/true" 21 seconds ago pmm-data

Note

PMM-server选择一个内核版本搞的服务器就行

PMM-client无所谓

3.pmm-data 状态为Exited
内核版本低

4.MySQL dashboard没数据
防火墙没关

1
2
3
4
5
pmm-admin check-network
centos 7
停止: systemctl disable firewalld
禁用: systemctl stop firewalld

5.容器时区为UTC与我们系统CST差八个小时
进入容器

1
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

http://www.cnblogs.com/w2206/p/6904446.html

MHA在监控和故障转移时都做了什么

MHA在监控和故障转移时都做了什么

以下是MHA(masterha_manager)在监控和故障切换上的基本流程

验证复制配置和识别当前主库

  • 通过连接配置文件中描述的所有主机来识别当前主库.你不必手动指明那个主句是主库,MHA会自动检查复制设置并识别当前主库.

    注意:MHA本身不能构建复制环境,MHA监控已存在的复制环境

  • If any slave is dead at this stage, terminating the script for safety reasons(If any slave is dead, MHA can not recover the dead slave, of course). 开启监控时任何slave发生故障都会导致监控退出,MHA并不能修复从库

  • 如果任何必要的脚本没有安装在所有Node,MHA abort而不会启动监控

    阅读全文

MHA Tutorial

MHA Tutorial

简单故障转移

构建复制环境

MHA不会帮你搭建复制环境,所以你需要自己搭建复制.换句话说,你可以在已有环境中使用MHA.举个例子,假设有四台主机:host1,host2,host3,host4.主库运行在host1,两个从库分别运行在host2和host3,而host4负责运行MHA Manager.

在host1-host4安装MHA Node

See Installing MHA Node

阅读全文

MHA Overview

MHA概览

MHA能够实现自动化的master failover和从库升级为new master,通常这一过程只需要10-30秒的停机时间.MHA最大程度保证了数据一致性,对性能零影响,易于安装,并且不需要改变现有部署情况.

MHA支持计划性在线主库切换,在短时间内(0.5-2秒)的停机时间(仅限阻塞写入),将当前运行的主机安全地更改为新主机.

MHA提供以下功能,并且可用于需要高可用性,数据完整性和近乎不间断主库维护的许多部署中.


Powered by Hexo and Hexo-theme-hiker

Copyright © 2013 - 2018 Fan() All Rights Reserved.

访客数 : | 访问量 :

#