Skip to content

Instantly share code, notes, and snippets.

View cholcombe973's full-sized avatar

Chris Holcombe cholcombe973

  • @tesla.com
  • Portland
View GitHub Profile
root@ip-172-31-46-218:~# ./rust_rados
Connecting to ceph
Object: CephObject { name: "test", entry_locator: "test", namespace: "test" }
ubuntu@ip-172-31-33-109:~$ sudo ceph auth list
installed auth entries:
mds.ceph-fs
key: AQDg0OpXvkO3JBAAWyILLBH3EpKBx3qIwIAjWw==
caps: [mds] allow
caps: [mon] allow rwx
caps: [osd] allow *
osd.0
key: AQD5wepXXe7+OhAAr7O4lhnKNXaRizmFHXu4wA==
//! This program has been created to handle an incompatibility between how mysqldump escapes
//! some characters and how hive interprets those escaped chars. It does the following:
//! If you see an 0x5c30 in the input sequence
//! a. and there is no or even number of 0x5c before 0x5c30, translate this 0x5c30 to 0x00
//! b. if there is odd number of 0x5c before 0x5c30, don't do anything.
//! Some sample transforms:
//! 0x5c30 => 0x00
//! 0x5c5c30 => 0x5c5c30
//! 0x5c5c5c30 => 0x5c5c00
//! 0x5c5c5c5c30 => 0x5c5c5c5c30
Introduction
This is meant to be a reference to Diagnose My Ceph Cluster Script that I developed as part of Google Summer of Code 2016.
This project resides at https://github.com/CanonicalLtd/DiagCephCluster. It is still under development and pull requests are
always welcome. I am Kumar Rishabh and I can reached at [email protected].
What the heck is Diagnose My Ceph Cluster?
The project aims was to build a script that can be run very quickly and give the user best guess as to what was wrong with the
running Ceph cluster and also suggest a solution to rectify it. If the user is satisfied with the diagnosis he may allow the
unit-openattic-8: 2016-08-17 15:51:18 INFO unit.openattic/8.juju-log server.go:270 Initializing Apt Layer
unit-openattic-8: 2016-08-17 15:51:18 INFO worker.uniter.jujuc server.go:174 running hook tool "config-get" ["install_sources" "--format=json"]
unit-openattic-8: 2016-08-17 15:51:18 INFO worker.uniter.jujuc server.go:174 running hook tool "config-get" ["install_keys" "--format=json"]
unit-openattic-8: 2016-08-17 15:51:18 INFO worker.uniter.jujuc server.go:174 running hook tool "juju-log" ["-l" "INFO" "Invoking reactive handler: reactive/apt.py:36:update"]
unit-openattic-8: 2016-08-17 15:51:18 INFO unit.openattic/8.juju-log server.go:270 Invoking reactive handler: reactive/apt.py:36:update
unit-openattic-8: 2016-08-17 15:51:18 INFO worker.uniter.jujuc server.go:174 running hook tool "status-get" ["--format=json" "--include-data"]
unit-openattic-8: 2016-08-17 15:51:18 INFO worker.uniter.jujuc server.go:174 running hook tool "status-set" ["maintenance" "Updating apt cache"]
unit-openattic-8: 2016-08-17 15:51
options:
int-option:
default: 9001
description: "A short description of the configuration option"
type: int
string-option:
default: "Default Value"
description: "A short description of the configuration option"
type: string
boolean-option:
crushmap Ok(CrushMap {
magic: 65536,
max_buckets: 8,
max_rules: 1,
max_devices: 3,
buckets: [Straw(Straw(CrushBucketStraw {
bucket: Bucket {
id: -1,
bucket_type: SetChooseLocalTries,
alg: Straw,
VERSION_TABLE = {
0.80: 'firefly', # LTS
0.87: 'giant',
0.94: 'hammer', # LTS
9.2: 'infernalis',
10.2: 'jewel', # LTS
}
def import_ceph_api():
"""
root@ip-172-31-11-155:~# ceph pg dump --format=json
dumped all in format json
{"version":13,"stamp":"2016-06-20 15:38:32.997444","last_osdmap_epoch":7,"last_pg_scan":1,"full_ratio":"0.950000","near_full_ratio":"0.850000","pg_stats_sum":{"stat_sum":{"num_bytes":0,"num_objects":0,"num_object_clones":0,"num_object_copies":0,"num_objects_missing_on_primary":0,"num_objects_degraded":0,"num_objects_unfound":0,"num_objects_dirty":0,"num_whiteouts":0,"num_read":0,"num_read_kb":0,"num_write":0,"num_write_kb":0,"num_scrub_errors":0,"num_shallow_scrub_errors":0,"num_deep_scrub_errors":0,"num_objects_recovered":0,"num_bytes_recovered":0,"num_keys_recovered":0,"num_objects_omap":0,"num_objects_hit_set_archive":0},"stat_cat_sum":{},"log_size":0,"ondisk_log_size":0},"osd_stats_sum":{"kb":9386436,"kb_used":102016,"kb_avail":9284420,"hb_in":[],"hb_out":[],"snap_trim_queue_len":0,"num_snap_trimming":0,"op_queue_age_hist":{"histogram":[],"upper_bound":1},"fs_perf_stat":{"commit_latency_ms":1,"apply_latency_ms":204}},"pg_stats_
def pg_dump(self, dumpcontents=None):
"""
show human-readable versions of pg map (only 'all' valid
with plain)
:param dumpcontents: list valid_range=["all","summary","sum","delta","pools","osds","pgs","pgs_brief"] allowed repeats=many
:return: (string outbuf, string outs)
:raise CephError: Raises CephError on command execution errors
:raise rados.Error: Raises on rados errors
"""