2016年5月11日
摘要: 迁移数据到从库 配置GTID主从环境 $ cat /etc/my.cnf [mysql@mysql-1 ~]$ cat /etc/my.cnf # For advice on how to change settings please see # http://dev.mysql.com/doc/r 阅读全文
posted @ 2016-05-11 15:49 vlen 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 配置文件 初始化数据库目录 启动、关闭 全部启动、关闭: mysqld_multi --defaults-extra-file=/etc/my.cnf start //启动 mysqld_multi --defaults-extra-file=/etc/my.cnf start 1,2 //启动 m 阅读全文
posted @ 2016-05-11 15:38 vlen 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 创建MySQL用户 安装仓库 要使用yum 安装mysql,要使用mysql的yum仓库,先从官网下载适合你系统的仓库http://dev.mysql.com/downloads/repo/yum/然后安装一下这个仓库列表 wget http://repo.mysql.com//mysql57-co 阅读全文
posted @ 2016-05-11 10:01 vlen 阅读(7457) 评论(0) 推荐(0) 编辑
  2016年1月15日
摘要: 单线程 500+w条数据,插入时间:1小时,13分钟。 脚本: [root@10 hurl]# cat insert-mongo2.py #!/usr/bin/env python #coding=utf-8 import time,datetime import pymongo from pymo 阅读全文
posted @ 2016-01-15 17:22 vlen 阅读(955) 评论(3) 推荐(0) 编辑
摘要: 安装: # yum install ansible # yum install sshpass 配置: # vi /etc/ansible/hosts [mysqldb] 172.16.100.23 ansible_ssh_user=root ansible_ssh_pass=c3root 172. 阅读全文
posted @ 2016-01-15 15:15 vlen 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 安装: yum list | grep expect yum install expect 批量创建用户: ansible mysqldb -m user -a 'name=ansible state=present' ansible mysqldb -m raw -a 'echo 123456|p 阅读全文
posted @ 2016-01-15 15:10 vlen 阅读(255) 评论(0) 推荐(0) 编辑
摘要: [root@c3-zabbix-serv hurl]# cat sendsshkey.sh #!/bin/bash if [ -z $1 ]; then echo "Usage : sh $0 username passwd" echo "Example: sh $0 root 'passwd!@# 阅读全文
posted @ 2016-01-15 14:31 vlen 阅读(832) 评论(0) 推荐(0) 编辑
摘要: [root@zabbix ~]# cat alivehost.sh #!/bin/bash #Checks to see if hosts 192.168.1.100-192.168.1.200 are alive for n in {50..150}; do host=172.16.0.$n pi 阅读全文
posted @ 2016-01-15 14:29 vlen 阅读(315) 评论(0) 推荐(0) 编辑
摘要: [root@openfire1 script]# cat test.sh #!/bin/bash #本地通过ssh执行远程服务器的脚本 for ip in `cat iplist` do echo $1 if [[ -z $1 ]]; then #"-z",如果为空 echo "Not find c 阅读全文
posted @ 2016-01-15 14:23 vlen 阅读(2061) 评论(0) 推荐(0) 编辑
摘要: [root@openfire1 script]# cat test.sh #!/bin/bash #通过scp推送文件到远程目录 for ip in `cat iplist` do echo $1 if [[ -z $1 ]]; then #"-z",如果为空 echo "Not find comm 阅读全文
posted @ 2016-01-15 14:18 vlen 阅读(1734) 评论(0) 推荐(0) 编辑