01 2016 档案
Mongo性能测试-python脚本
摘要:单线程 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 阅读(983) 评论(3) 推荐(0)
ansible安装测试
摘要:安装: # 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 阅读(683) 评论(0) 推荐(0)
expect安装测试-批量用户管理
摘要:安装: 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 阅读(269) 评论(0) 推荐(0)
批量配置SSH 免密钥登录脚本
摘要:[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 阅读(856) 评论(0) 推荐(0)
ping测试局域网内主机是否alive
摘要:[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 阅读(331) 评论(0) 推荐(0)
批量ssh执行命令
摘要:[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 阅读(2105) 评论(0) 推荐(0)
通过scp批量推送文件到远程目录
摘要:[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 阅读(1754) 评论(0) 推荐(0)
expect安装测试-自动登陆脚本
摘要:安装: 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 阅读(159) 评论(0) 推荐(0)
Linux批量生成生成帐户脚本,随机密码
摘要:此脚本应用于生产环境下生成帐户,也可生成成百上千个密码相同的帐户。脚本代码如下: 批量生成: #!/bin/bash for name in tom jerry joe jane do useradd $name pwd=`cat /dev/urandom | tr -dc "a-zA-Z0-9"| 阅读全文
posted @ 2016-01-14 18:32 vlen 阅读(286) 评论(0) 推荐(0)