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/python | |
from flask import abort, Flask, request, Response | |
import json | |
import subprocess | |
listen_port = 6780 | |
listen_addr = "0.0.0.0" | |
debug_mode = True |
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
#include <stdio.h> | |
#include <string.h> | |
#include <rados/librados.h> | |
int set_rados_option(rados_t cluster, const char *option, const char *value) { | |
printf("Set the %s option to: %s\n", option, value); | |
return rados_conf_set(cluster, option, value); | |
} | |
int main(int argc, char *argv[]) { |
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 time | |
import socket | |
import subprocess | |
import json | |
graphite_host = 'my.graphite.machine' | |
graphite_port = 2003 | |
prefix = 'ceph' |
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 | |
''' | |
Simple Python script which endlessly keeps writing 100MB to a temp file. | |
Used to demonstrate a Ceph cluster. This script runs inside a Virtual Machine (KVM) | |
running on a RBD image on a Ceph cluster. | |
The demo is to randomly pull out machines and show that the script can still write | |
and read data. |
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 | |
from optparse import OptionParser | |
def get_object_name(prefix, sector, order): | |
sector_size = 512 | |
return "%s.%012x" % (prefix, (sector * sector_size) / pow(2, order)) | |
def main(): | |
parser = OptionParser() |
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 | |
''' | |
This script writes X MegaByte random data to 10 RADOS objects and read the data again afterwards | |
It writes these statistics towards a Graphite server so you can see what the latency | |
inside your cluster is for both Read and Write | |
Author: Wido den Hollander <[email protected]> | |
''' |
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
''' | |
WSGI wrapper for the Ceph REST API to be run behind Apache with mod_wsgi. | |
Place this script in /var/www as ceph-rest-api.wsgi and use this VirtualHost: | |
<VirtualHost *:80> | |
DocumentRoot /var/www | |
ServerName ceph-rest-api | |
ErrorLog /var/log/apache2/error.log |
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 | |
# Generates a CRUSH location based on the machine's hostname. | |
# This Gist was written for a customer who has mixed SSDs and HDDs in a a chassis. | |
# Hostname example in this case: dc2-rk01-ceph01 (Datacenter 2, rack 01, Ceph machine 01) | |
# It checks if the backing disk is a SSD or not and then comes up with the CRUSH location | |
while :; do | |
case $1 in | |
--cluster) |
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 | |
''' | |
This script gathers pool statistics from RADOS and sends them to a Graphite server | |
It allows you to graph and see what each pool is doing. | |
Author: Wido den Hollander <[email protected]> | |
''' |
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
# udev rule to set disk schedulers for Ceph | |
# For spinning disks we want the CFQ scheduler so that we can set | |
# priorities on client and recovery I/O threads | |
# | |
# Author: Wido den Hollander <[email protected]> | |
# Date: July 2015 | |
# Use deadline for SSDs | |
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" |
OlderNewer