- 博客(25)
- 收藏
- 关注
转载 pt-heartbeat监测mysql主从同步延迟
pt-heartbeat监测mysql主从同步延迟:安装percona toolkit(pt-heartbeat为该软件的子命令):http://repo.percona.com/release/6/RPMS/x86_64/percona-toolkit-3.0.13-1.el6.x86_64.rpmyum install perl-DBD-MySQLyum install perl-IO...
2019-09-12 14:43:21
292
转载 python函数def示例(计算梯形面积)
python函数def示例(计算梯形面积):vi aa.py#!/usr/bin/pythondef fun(a,b,h):s = (a+b)*h/2print sfun(3,4,5):wqpython aa.py
2019-09-11 11:04:04
9383
转载 python知识学习
** 表示冥运算// 表示相除取整\ 表示转义r" " 可用于避免转义用于将字符串相连字符串 * 数字表示复制字符串个数变量[0] 表示变量里的第1个,[1]为第2个变量[-1] 表示变量里的倒数第1个,[-2]为倒数第2个endswith() 表示以xx结尾startswith() 表示以xxx开头isdigit() 如果字符串只包含数字则为True,否则为Falselen() 返回字符串长...
2019-09-09 22:49:19
188
转载 sysbench测试mysql性能
sysbench测试mysql性能:安装sysbench 1.0:apt-get install bzr automake libtool libmysqlclient-dev pkg-config unzipln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.14 /usr/lib/libmysqlclient_r.sowget ...
2019-09-07 13:21:49
224
转载 解决mysql中文乱码
解决mysql中文乱码:注:通过SQL语句调整不起作用的,只能重启mysql生效vi /etc/my.cnf[mysqld]character-set-server=utf8[client]default-character-set=utf8[mysql]default-character-set=utf8:wqservice mysql restart...
2019-08-30 11:25:08
168
转载 设置mysql不区分大小写
设置mysql不区分大小写:注:这个参数没办法通过sql语句改的,只能重启mysql生效vi /etc/my.cnf[mysqld]lower_case_table_names=1:wqservice mysql restart
2019-08-30 11:22:51
594
转载 Ubuntu 16.04搭建K8S集群
Ubuntu 16.04搭建K8S集群:vi /etc/apt/sources.listdeb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stabledeb http://mirrors.aliyun.com/ubuntu/ xenial mail restricteddeb https://mirrors.a...
2019-08-28 17:24:14
704
转载 Ubuntu 16.04 mount报Operation not supported解决办法
Ubuntu 16.04 mount报Operation not supported解决办法:注:kernel升级到4.15版本后会有这个问题解决办法:加vers=1.0参数具体命令:$ sudo mount -o username=aa,password=xxxx,vers=1.0 //10.0.1.5/ming /mnt...
2019-08-27 17:59:24
3965
转载 华为magicbook安装Ubuntu 16.04没有wifi问题解决办法
华为magicbook安装Ubuntu 16.04没有wifi问题解决办法:解决办法:将kernel升级到4.15版本即可到网上搜索kernel 4.15的deb包(linux-headers-4.15.1-xxx.deb、linux-headers-4.15.1-xxx-geniric_xxx.deb、linux-image-4.15.1-xxx-generic_xxx.deb)安装下然后重...
2019-08-26 17:56:55
3857
转载 不动物理分区扩swap大小
不动物理分区扩swap大小(通过dd的方式从硬盘划16G空间做swap用):dd if=/dev/zero of=/home/swapfile.img bs=1024 count=16Mmkswap /home/swapfile.imgvi /etc/fstab/home/swapfile.img swap swap defaults 0 0:wqswapon /...
2019-08-26 16:07:54
106
转载 Ubuntu配置vsftpd虚拟帐号
Ubuntu配置vsftpd虚拟帐号:apt-get install vsftpdmkdir /etc/vsftpdvi /etc/vsftpd/userlist.txt (奇数行为用户名,偶数行为密码)aaxxxx:wqapt-get install db-utilcd /etc/vsftpddb_load -T -t hash -f userlist.txt /etc/vsftp...
2019-08-22 14:39:24
244
转载 CentOS 7配置tomcat https并改端口为443
CentOS 7配置tomcat https并改端口为443:安装tomcat:yum install tomcat (默认为tomcat 7)配置tomcat证书(有公司https key、crt文件情况):openssl pkcs12 -export -in ming.crt -inkey ming.key -out ming.p12 -certfile gd_bundle-g2-g...
2019-08-20 09:45:51
1941
转载 限制docker容器的内存使用
限制docker容器的内存使用:$ docker run -it -m 16g --memory-swap=1g xxxx /bin/bash-m是限制内存最多16G,--memory-swap是限制swap最多1G
2019-08-05 11:25:16
459
转载 限制docker容器的CPU使用
限制docker容器的CPU使用:$ docker run -it --cpus="8" xxx /bin/bash--cpus参数可以简单理解为CPU core数(可精确到小数位,如1.5),--cpus="8"为可以最多使用8个100%的CPU core,不过实际上系统会将这8个100%(即800%)按总core数进行均分,如总core数为20,实际使用为8/20x100%=40%,即...
2019-08-05 11:05:19
897
转载 修改容器的时区
修改容器的时区:docker ps -a (查看下容器ID)到容器里查看下时间(时区):docker exec -it <容器ID> /bin/bash$ date $ exit用宿主机的时区替换容器的时区:docker cp /etc/localtime <容器ID>:/etc/localtime可以再到容器里确认下...
2019-07-31 09:50:04
806
转载 Ubuntu修改时区
Ubuntu修改时区:dpkg-reconfigure tzdata选择Asia——Shanghaidate (查看确认)之前常用的 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime已不起作用
2019-07-31 09:27:17
222
转载 Ubuntu 16.04搭建docker版nexus+nginx反向代理(https)
Ubuntu 16.04搭建docker版nexus+nginx反向代理(https) 安装docker-ce: vi /etc/apt/sources.listdeb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable apt-get updateapt-get install docker-ce下载...
2019-07-24 15:47:17
564
转载 Ubuntu 16.04搭建docker版nexus
Ubuntu 16.04搭建docker版nexus:安装docker-ce:vi /etc/apt/sources.listdeb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stableapt-get updateapt-get install docker-ce下载neuxs image:docker...
2019-07-24 15:33:14
329
转载 nexus配置LDAP
nexus配置LDAP:nexus页面——Security——LDAPConnection——Name:ldap——LDAP server address:ldap://10.0.0.3:389——Search base:DC=ming,DC=com——Authentication method:Simple Authentication——Username or DN:CN=aa,OU=&l...
2019-07-19 10:08:34
1866
转载 Ubuntu 16.04搭建elasticsearch集群
Ubuntu 16.04搭建elasticsearch集群:注:至少3台服务器安装:apt-get install openjdk-8-jdkapt-get install elasticsearch配置:mkdir /space/elasticsearch/data -pmkdir /space/elasticsearch/logs -pchown elasticsearch:e...
2019-07-15 10:25:16
334
转载 CentOS 6.8搭建mysql-proxy实现负载均衡
CentOS 6.8搭建mysql-proxy实现负载均衡:下载网址:http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-Proxytar zxfv mysql-proxy-0.8.5-linux-el6-x86-64bit.tar.gz -C /spacemv /space/mysql-proxy-0.8.5-linux-el6-x86-64bit /s...
2019-07-11 09:28:50
345
转载 mysqldumpslow命令查看mysql慢查询log
mysqldumpslow命令查看mysql慢查询log:命令示例:msyqldumpslow -s c -t 20 /var/log/mysql/mysql-slow.log注:-s是指排序,c是指次数,-t是时间(这里的时间是指单次x次数的总时间)...
2019-07-10 09:07:18
319
转载 alertmanager+webhook发报警邮件(使用587端口)
alertmanager+webhook发报警邮件(使用587端口):webhook安装:go get github.com/prometheus/alertmanager/examples/webhook启动webhook(默认端口为TCP 5001):go/bin/webhookwebhookmail.py下载网址(需要手动复制其内容):https://github.com/you...
2019-07-01 09:13:41
1775
转载 Dockerfile 和entrypoint
Dockerfile 和entrypoint:Dockerfile是容器启动前执行的命令,entrypoint是容器系统启动后执行的命令entrypint.sh示例:#!/bin/shset -egroupadd docker -g "$GROUP_ID"useradd docker --shell /bin/bash -u "$USER_ID" -g "$GROUP_ID" exp...
2019-06-25 20:10:54
651
转载 CentOS 6.8搭建Galera Cluster(innodb引擎)
CentOS 6.8搭建Galera Cluster(innodb引擎):注:共需要3台服务器下载网址:http://releases.galeracluster.com/galera-3.23/centos/6/x86_64http://releases.galeracluster.com/mysql-wsrep-5.6/centosgalera-3-25.3.23-2.el6.x86_...
2019-06-21 15:16:51
199
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人