March 9 2018

library not found for -lssl

UcJmhs-MacBook-Pro:db-dashboard ucjmh$ sudo pip install MySQL

The directory ‘/Users/ucjmh/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you ma[……]

Read more

Category: python | LEAVE A COMMENT
March 6 2018

mysql-statefulset.yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
serviceName: mysql
replicas: 3
template:
metadata:
labels:
app: mysql
spec:
initContainers:
– name: init-mysql
image: mysql:5.7
command:
– bash
– “-c”
– |
set -ex
# Generate mys[……]

Read more

Category: 其它 | LEAVE A COMMENT
February 7 2018

mysql 5.7 dockerfile

FROM centos

RUN groupadd -g 510 dba
RUN useradd -u 509 -d /home/mysql -g dba mysql
RUN yum install -y net-tools
RUN mkdir -p /u01/my3306/{data,log,run,tmp}
RUN mkdir -p /u01/mysql
RUN chmod -R 775 /u01/
RUN chown -R mysql.dba /u01
RUN yum -y install gcc gcc-c++ gcc-g77 kernel-devel autocon[……]

Read more

Category: mysql | LEAVE A COMMENT
January 2 2018

定时生产audit的表

delimiter $$
CREATE EVENT test_event
ON SCHEDULE EVERY 1 MONTH
STARTS ‘2018-01-01 00:00:00’
COMMENT ‘定时生产audit的表’
DO
BEGIN
set @cur_date=DATE_FORMAT(NOW(), ‘%Y%m’);
set @sqltext=concat(“rename table audit_trail to audit_trail_”, @cur_date,”;”);
PREPARE rename_table from @sqltext;
execute r[……]

Read more

Category: mysql | LEAVE A COMMENT
December 12 2017

mysql mgr搭建

node1 : ssh root@10.18.19.55

node2 : ssh root@10.18.19.233

node3 : ssh root@10.18.19.234

 

Server version: 8.0.3-rc-log MySQL Community Server (GPL)

 

#binlog binlog配置,Group Replication是要根据GTID来进行同步的,所以需要开启GTID

server_id= 1  #启用全局事物标识符  不同的节点的这个数据不同

gtid_mode=ON[……]

Read more

Category: mysql | LEAVE A COMMENT
December 6 2017

CRONTAB 不执行

1 crond服务未启动

crontab不是Linux内核的功能,而是依赖一个crond服务,这个服务可以启动当然也可以停止。如果停止了就无法执行任何定时任务了,解决的方法是打开它:

crond

service crond start

如果提示crond命令不存在,可能被误删除了,CentOS下可以通过这个命令重新安装:

yum -y install crontabs

2 权限问题

比如:脚本没有x执行权限,解决方法:

增加执行权限,或者用bash abc.sh的方法执行

3 路径问题

有的命令在shell中执行正常,但是在[……]

Read more

Category: linux | LEAVE A COMMENT
December 1 2017

mgr单主模式

mgr单主模式
1.在单主模式下,组复制具有自动选主功能,每次只有一个 server成员接受更新。
2.在多主模式下,所有的 server 成员都可以同时接受更新.

我们已经安装过mgr多主了 详细的步骤可以看:http://www.ucjmh.com/2017/12/12/mysql-mgr搭建/

接下来我们把mgr的多主模式转成单主的进行操作。

loose-group_replication_single_primary_mode = off #关闭单主模式的参数
loose-group_replication_enforce_update_everywhere_c[……]

Read more

Category: mysql | LEAVE A COMMENT