Tuesday, April 19, 2016

Sharding volume in gluster - simple example



Sharding volume:
=============





$ glusterd -LDEBUG

$ gluster volume create tv1 gant:/opt/volume_test/tv_1/b1 gant:/opt/volume_test/tv_1/b2 force
volume create: tv1: success: please start the volume to access data

$ gluster volume start tv1
volume start: tv1: success

$ mount -t glusterfs gant:/tv1 /mnt/master/


$ gluster volume get tv1 features.shard
Option                                  Value                                  
------                                  -----                                  
features.shard                          off                                    

$ gluster volume get tv1 features.shard-block-size
Option                                  Value                                  
------                                  -----                                  
features.shard-block-size               4MB                                    


$ gluster volume set tv1 features.shard-block-size 10MB
volume set: success


$ gluster volume get tv1 features.shard-block-size
Option                                  Value                                  
------                                  -----                                  
features.shard-block-size               10MB                                   

$ gluster volume set tv1 features.shard on
volume set: success


$ mount | grep glusterfs
gant:/tv1 on /mnt/master type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)


$ dd if=/dev/urandom of=testfile count=12 bs=6MB
12+0 records in
12+0 records out
72000000 bytes (72 MB) copied, 4.96613 s, 14.5 MB/s

$ /root/brick_content.sh tv1
Bricks Present:
/opt/volume_test/tv_1/b1
/opt/volume_test/tv_1/b2

Contents of Bricks:
/opt/volume_test/tv_1/b1:
total 0

/opt/volume_test/tv_1/b2:
total 10244
-rw-r--r-- 2 root root 10485760 Apr 19 16:09 testfile

$ ls -ls
total 70313
70313 -rw-r--r-- 1 root root 72000000 Apr 19 16:10 testfile

$ ls -ls /opt/volume_test/tv_1/*/
/opt/volume_test/tv_1/b1/:
total 0

/opt/volume_test/tv_1/b2/:
total 10244
10244 -rw-r--r-- 2 root root 10485760 Apr 19 16:09 testfile

$ ls -ls /opt/volume_test/tv_1/*/.shard/ 
/opt/volume_test/tv_1/b1/.shard/:
total 60076
10240 -rw-r--r-- 2 root root 10485760 Apr 19 16:09 e93bb270-2d70-40da-b74b-1ac4635fb0e3.1
10240 -rw-r--r-- 2 root root 10485760 Apr 19 16:10 e93bb270-2d70-40da-b74b-1ac4635fb0e3.2
10240 -rw-r--r-- 2 root root 10485760 Apr 19 16:10 e93bb270-2d70-40da-b74b-1ac4635fb0e3.3
10240 -rw-r--r-- 2 root root 10485760 Apr 19 16:10 e93bb270-2d70-40da-b74b-1ac4635fb0e3.4
10240 -rw-r--r-- 2 root root 10485760 Apr 19 16:10 e93bb270-2d70-40da-b74b-1ac4635fb0e3.5
 8876 -rw-r--r-- 2 root root  9085440 Apr 19 16:10 e93bb270-2d70-40da-b74b-1ac4635fb0e3.6

/opt/volume_test/tv_1/b2/.shard/:
total 0
$
$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
10485760*5
52428800
52428800+9085440+10485760
72000000
(interrupt) Exiting bc.
$
$
$ gluster volume info tv1

Volume Name: tv1
Type: Distribute
Volume ID: d66102b6-13c1-491a-912e-206d809573de
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: gant:/opt/volume_test/tv_1/b1
Brick2: gant:/opt/volume_test/tv_1/b2
Options Reconfigured:
features.shard: on
features.shard-block-size: 10MB
transport.address-family: inet
performance.readdir-ahead: on
$
$

Sunday, April 17, 2016

cdrom issues in fedora



After a looong time, tried to play some songs from cdrom  ;)

faced these errors:

[146512.870430] sr 5:0:0:0: [sr0] tag#12 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[146512.870443] sr 5:0:0:0: [sr0] tag#12 Sense Key : Illegal Request [current]
[146512.870445] sr 5:0:0:0: [sr0] tag#12 Add. Sense: Illegal mode for this track
[146512.870447] sr 5:0:0:0: [sr0] tag#12 CDB: Read(10) 28 00 00 05 68 1e 00 00 02 00
[146512.870448] blk_update_request: I/O error, dev sr0, sector 1417336
[146513.233773] sr 5:0:0:0: [sr0] tag#14 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[146513.233776] sr 5:0:0:0: [sr0] tag#14 Sense Key : Illegal Request [current]
[146513.233779] sr 5:0:0:0: [sr0] tag#14 Add. Sense: Illegal mode for this track
[146513.233780] sr 5:0:0:0: [sr0] tag#14 CDB: Read(10) 28 00 00 05 68 1f 00 00 01 00
[146513.233782] blk_update_request: I/O error, dev sr0, sector 1417340
[146513.233785] Buffer I/O error on dev sr0, logical block 354335, async page read


confused, googled, and what not?


Then tried mounting manually, voila it worked :)

mount /dev/sr0 /mnt/cdrom -o ro




gnome extensions in fedora

checkout these gnome extension and switch ON/OFF according to your needs.

This internally changes your system state :) ..awesome..isn't it?

https://extensions.gnome.org/local/


My favourites:

AlternateTab

Removable Drive Menu