Skip to content

Instantly share code, notes, and snippets.

View prashanthpai's full-sized avatar

Prashanth Pai prashanthpai

View GitHub Profile
@prashanthpai
prashanthpai / swift-obj-name.md
Created October 6, 2014 21:06
swift object name mapping to on-disk file path

Calculating object hash:

>>> from swift.common.utils import hash_path
>>> print hash_path("AUTH_abc/c1/o4")
c2b307d78b6c419c0c1b76d91c08c69f

The corresponding on-disk object path derived from the above hash:

/mnt/sdb1/./3/node/sdb3/objects/778/69f/c2b307d78b6c419c0c1b76d91c08c69f/1412628708.01757.data
@prashanthpai
prashanthpai / inotify-debug.md
Created August 8, 2014 09:09
Tracking inotify watches

Enable kernel debug tracing

echo 1 > /sys/kernel/debug/tracing/tracing_on

Enable tracing of all inotify syscalls

for i in `ls /sys/kernel/debug/tracing/events/syscalls | grep inotify`; do echo 1 >| /sys/kernel/debug/tracing/events/syscalls/$i/enable; done;
@prashanthpai
prashanthpai / swiftonfile-sp.md
Last active April 26, 2016 13:42
SwiftOnFile Storage Policy Notes

###Storage Policy configurations All glusterfs volumes as a single storage policy with each volume being just a device to Swift: In this case, Swift hashes and chooses where to place objects into. Hence PUT of an object can go to either of the volumes. For example, if we have two glusterfs volumes test and test2, putting ten objects (named 1 to 10) into AUTH_abc account and container cg (marked with sp glusterfs) can look like so on mountpoint:

curl -i http://vm1:8080/v1/AUTH_abc/cg -X PUT -H 'X-Storage-Policy: glusterfs'
curl -i http://vm1:8080/v1/AUTH_abc/cg/o{1..10} -X PUT -d'testobject'
/mnt/gluster-object/test
@prashanthpai
prashanthpai / swift_db.md
Last active August 29, 2015 13:56
swift DB struncture (SP)

###Account DB tables

CREATE TABLE account_stat (
                account TEXT,
                created_at TEXT,
                put_timestamp TEXT DEFAULT '0',
                delete_timestamp TEXT DEFAULT '0',
                container_count INTEGER,
 object_count INTEGER DEFAULT 0,
@prashanthpai
prashanthpai / static-ip.md
Last active July 15, 2016 09:33
Set Static IP in Fedora VM

Set Static IP

vim /etc/sysconfig/network-scripts/ifcfg-p7p1
TYPE=Ethernet
BOOTPROTO=static
NAME=p7p1
UUID=acd05c7f-20a5-4cf7-86f7-25a24e264620