Archives by Tag 'Python'
python小技巧—MySQLdb查询返回字典
通过MySQLdb.cursors.DictCursor方式,使python MySQLdb执行查询返回的结果通过字典方式展现出来!
haproxy系列—定制mysql健康检查程序
随着生产环境用户访问的与日俱增,数据库访问压力也随之增大,近期准备对生产环境中的单一数据库进行扩容,增加多台slave数据库,进行读写分离操作,经过若干测试,最终选择使用Haproxy方案,在haproxy版本选型时,选择了1.4的版本,因为在1.4.9开始,haproxy增加了option mysql-check 健康检查功能,其工作原理是建立对应的Mysql连接,然后断开来判断数据库当前的健康状况。而实际生产环境中对数据一致性要求较高,不仅需要对mysql进行健康检查,也需要的slave节点的repliation状态(Slave_IO_Running,Slave_SQL_Running,Seconds_Behind_Master)进行检查,故现阶段的haproxy健康检查功能无法满足需求,需自己进行定制.
ganglia系列—定制ganglia
由于ganglia默认的自带的数据插件有限,生产环境中往往需要自己根据需求定制自己所需的插件,然后通过Web将相关数据通过绘图展现出来,而ganglia支持C/C++、python来定制自己想要的插件,刚好自己写了一些python的插件,特意将对应的经验分享出来。
ganglia系列—初识ganglia
最近由于需要在现有的Web集群系统中建立对应的统计程序,采集现有集群环境的使用状况,以便对下一阶段的集群扩展提供数据支撑,评估几个对应的开源平台后,绝对选择ganglia作为本次统计平台的基础框架。
Python-email module小例子
查询相关资料得知python标准模块中有一个email模块,功能相当强大,大致看了下,举个小例子和大家分享
初识paramiko
Paramiko (a combination of the esperanto words for “paranoid” and “friend”) is a module for python 2.3 or greater that implements the SSH2 protocol for secure (encrypted and authenticated) connections to remote machines.
小试pydns
由于工作需要,需要对域名进行监控,搜索了python dns module后,最终选择相对简单的pydns.
SMTP小窥
SMTP(Simple Mail Transfer Protocol)提供可靠高效的传送邮件协议。在RFC821对其有这样的描述:
The objective of Simple Mail Transfer Protocol (SMTP) is to transfer mail reliably and efficiently. SMTP is independent of the particular transmission subsystem and requires only a reliable ordered data stream channel.
学习python
Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.