- lxml - Pythonic binding for the C libraries libxml2 and libxslt.
- boto - Python interface to Amazon Web Services
- Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
- Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
- PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
- Celery - Task queue to distribute work across threads or machines.
- pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
dialect+driver://username:password@host:port/database
The Postgresql dialect uses psycopg2 as the default DBAPI. pg8000 is also available as a pure-Python substitute;详情见
# default
engine = create_engine('postgresql://scott:tiger@localhost/mydatabase')
# psycopg2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster: | |
head: "cbt" | |
clients: ["client1","client2","client3"] | |
osds: ["osd1","osd2","osd3"] | |
mons: ["mon1","mon2","mon3"] | |
osds_per_node: 1 | |
fs: xfs | |
mkfs_opts: -f -i size=2048 -n size=64k | |
mount_opts: -o inode64,noatime,logbsize=256k | |
conf_file: /etc/ceph/ceph.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster: | |
head: "cbt" | |
clients: ["client1","client2","client3"] | |
osds: ["osd1","osd2","osd3"] | |
mons: ["mon1","mon2","mon3"] | |
osds_per_node: 1 | |
fs: xfs | |
mkfs_opts: -f -i size=2048 -n size=64k | |
mount_opts: -o inode64,noatime,logbsize=256k | |
conf_file: /etc/ceph/ceph.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
log=/root/ceph_yunwei/repair_pg_mismatch.log | |
pg=$1 | |
filename=$2 | |
disk_size=$3 | |
meta_size=$4 | |
size_hex_revert() | |
{ | |
size_hex=`printf '%x\n' $1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-03-21 10:33:17.961553 7f0d0956c7c0 0 ceph version 0.80.7 (6c0127fcb58008793d3c8b62d925bc91963672a3), process ceph-osd, pid 4334 | |
2016-03-21 10:33:17.963542 7f0d0956c7c0 1 filestore(/var/lib/ceph/osd/ceph-6) mkfs in /var/lib/ceph/osd/ceph-6 | |
2016-03-21 10:33:17.963592 7f0d0956c7c0 -1 filestore(/var/lib/ceph/osd/ceph-6) mkfs on-disk fsid 509c0d73-9dc2-4983-92f5-097f940d19f3 != provided fd403120-f998-4c24-935a-6b475e4c24f4 | |
2016-03-21 10:33:17.963728 7f0d0956c7c0 -1 OSD::mkfs: ObjectStore::mkfs failed with error -22 | |
2016-03-21 10:33:17.963768 7f0d0956c7c0 -1 ESC[0;31m ** ERROR: error creating empty object store in /var/lib/ceph/osd/ceph-6: (22) Invalid argumentESC[0m | |
2016-03-21 10:33:44.093836 7fed3424a7c0 0 ceph version 0.80.7 (6c0127fcb58008793d3c8b62d925bc91963672a3), process ceph-osd, pid 4736 | |
2016-03-21 10:33:44.095605 7fed3424a7c0 1 filestore(/var/lib/ceph/osd/ceph-6) mkfs in /var/lib/ceph/osd/ceph-6 | |
2016-03-21 10:33:44.095632 7fed3424a7c0 1 filestore(/var/lib/ceph/osd/ceph-6) mkfs fsid is already s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import json | |
cmd = ''' | |
ceph pg dump | awk ' /^pg_stat/ { col=1; while($col!="up") {col++}; col++ } /^[0-9a-f]+\.[0-9a-f]+/ {print $1,$col}' | |
''' | |
body = os.popen(cmd).read() | |
SUM = {} | |
for line in body.split('\n'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding: utf-8 | |
import os | |
import sys | |
import logging | |
from threading import Thread | |
import Queue | |
OlderNewer