Wednesday, June 22, 2016

top output on all cpu cores

wanna check 'top' command on all cpu cores?

first type
#top

then press '1' over top output

=================================

Also, wanna check which specific CPU core a specific process is running?

check this out:

# ps o pid,psr,comm `pidof gvim`
  PID PSR COMMAND
12063   7 gvim


so, 'gvim' command is running on cpu core '7'.
----------------------------------------------------------------------------------

want to check every process and the core in which it is running?

# ps -eo psr,comm,pid




Monday, May 23, 2016

yum undo installation - howto

Get the package install/uninstall history like:
yum history list

Now, undo specific history:
yum history undo <number>

Where <number>, is taken from ID number in "yum history list".



Thursday, May 5, 2016

python-cheetah in rhel7

Facing error related to python-cheetah ( actually a yum installation error during cinder installation).

You need to enable as below:

Source Link:
https://www.rdoproject.org/documentation/repositories/

Enabling the Optional, Extras, and RH Common channels on RHEL

If using RHEL, then RDO needs the Optional, Extras, and RH Common channels to be enabled:

$ sudo subscription-manager repos --enable rhel-7-server-optional-rpms

$ sudo subscription-manager repos --enable rhel-7-server-extras-rpms

$ sudo subscription-manager repos --enable=rhel-7-server-rh-common-rpms


Now, try installing python-cinder.noarch , it should work.
========================================

gluster geo-replication with non-root user


A quick guide to setup non-root geo-replication setup:


mount broker setup :
  
Run the below commands in SLAVE Host

// Assumption:  geoacct user added (with geogrp as group).

// create a directory as below:
mkdir /var/mountbroker_root

// change permission as below - ( ensure /var directory is having default permission )
chmod 0711 /var/mountbroker_root


gluster system:: execute mountbroker opt mountbroker-root  /var/mountbroker_root

// geogrp is group of geoacct user.
gluster system:: execute mountbroker opt geo-replication-log-group geogrp

gluster system:: execute mountbroker opt rpc-auth-allow-insecure on

// tv2 is slave volume , geoacct is slave user to which session is created
gluster system:: execute mountbroker user geoacct tv2

// Now restart glusterd - to make effect of above settings
killall glusterd; glusterd -LDEBUG

// check glusterd.vol file  - (optional)  just to ensure above settings are in place

Run at MASTER Host: (as root user) 
ssh-copy-id  geoacct@gfvm4
where gfvm4 is Slave Host

Now Run at Slave Host:
/usr/local/libexec/glusterfs/set_geo_rep_pem_keys.sh geoacct tv1 tv2

// To review the settings at Slave Host: (optional)
gluster system:: execute mountbroker info

Now setup geo-replication at Master Host:
gluster volume geo-replication tv1 geoacct@gfvm4::tv2 create push-pem

// Check status - It should be created:
gluster volume geo-replication tv1 geoacct@gfvm4::tv2 status

// Start the session:
gluster volume geo-replication tv1 geoacct@gfvm4::tv2 start

// Check status  - it should be Started :
gluster volume geo-replication tv1 geoacct@gfvm4::tv2 status

// If required , you can stop session as below:
gluster volume geo-replication tv1 geoacct@gfvm3::tv2 stop

// You can delete session as below , if you wish so :) :
gluster volume geo-replication tv1 geoacct@gfvm3::tv2 delete


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
$
$