摘要: Tcpdump 抓包 #!/bin/bash #this script used montor mysql network traffic.echo sql tcpdump -i bond0 -s 0 -l -w - dst port 3366 | strings | perl -e ' while 阅读全文
posted @ 2020-06-06 01:11 Carry00 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 在线修改大表结构pt-online-schema-change 使用场景 在线数据库的维护中,总会涉及到研发修改表结构的情况,修改一些小表影响很小,而修改大表时,往往影响业务的正常运转,如表数据量超过500W,1000W,甚至过亿时 在线修改大表的可能影响 在线修改大表的表结构执行时间往往不可预估, 阅读全文
posted @ 2020-05-22 18:58 Carry00 阅读(173) 评论(0) 推荐(0) 编辑
摘要: MySQL 过滤复制 第一种方法: 进行物理备份,备份后指定GTID show variables like "%gtid%"; set global gtid_purged = '40571d7e-4cee-11ea-8199-00163e084b44:1-2104754,474b6197-4ce 阅读全文
posted @ 2020-02-08 06:51 Carry00 阅读(40) 评论(0) 推荐(0) 编辑
摘要: mysql 导出csv格式数据解决乱码 #导出 root@95d956bb2012:/# mysql -u rootp -p -e "select * from wordpress.wp_users" > /tmp/wp_users.csv #解决乱码 sed -i '1s/^/\xEF\xBB\x 阅读全文
posted @ 2020-02-07 06:50 Carry00 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 自建dns服务器 yum -y install bind bind-chroot bind-util bind-libs vim /etc/named.conf named.conf zone "service.consul" IN { type forward; forwarders { 192. 阅读全文
posted @ 2020-02-07 06:47 Carry00 阅读(96) 评论(0) 推荐(0) 编辑
摘要: MySQL 角色管理 创建角色 create role test_role@'%'; 授权角色 grant select,insert,update,delete on testdb.* to test_user; 将角色分配给用户 create user 'test'@'192.168.1.1' 阅读全文
posted @ 2020-02-07 03:14 Carry00 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Mysql巡检脚本 环境说明 mysql8.0+ python 2.7 yum install python-pip -y yum install python-devel yum install MySQL-python -y #!/usr/bin/env python # -*- coding: 阅读全文
posted @ 2020-02-05 03:23 Carry00 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 加密解密脚本 #!/usr/bin/env python # -*- coding:utf-8 -*- from Crypto.Cipher import AES from binascii import b2a_hex,a2b_hex # from deveops.settings import 阅读全文
posted @ 2020-02-04 03:26 Carry00 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Sysbench 压测工具使用 PolarDB-X 性能测试使用 Sysbench 作为压测工具,本文介绍 Sysbench 的使用方法。 安装 测试使用的是 Sysbench 0.5 版本,安装方法如下: git clone https://github.com/akopytov/sysbench 阅读全文
posted @ 2020-02-01 02:40 Carry00 阅读(99) 评论(0) 推荐(0) 编辑
摘要: kafka 常用操作 创建 topic /usr/local/kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --replication-factor 3 --partitions 10 --create --topic test 查看 to 阅读全文
posted @ 2020-01-29 03:22 Carry00 阅读(47) 评论(0) 推荐(0) 编辑