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) 编辑
摘要: 安装: yum list | grep expect yum install expect 参考:http://www.cnblogs.com/iloveyoucc/archive/2012/05/11/2496433.html [devops@p2p-haproxy hurl]$ cat ssh- 阅读全文
posted @ 2016-01-15 14:11 vlen 阅读(148) 评论(0) 推荐(0) 编辑