Friday, December 21, 2012

Standalone Storage Server With GlusterFS 3 On CentOS /RedHat


Download repo file from Gluster web site copy to /etc/yum.repos.d/

http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.1/CentOS/glusterfs-epel.repo


[root@server ~]# chkconfig iptables off

[root@server ~]# chkconfig ip6tables off

Disable SELINUX

[root@server ~]# vi /etc/selinux/config

reboot

[root@server Downloads]#  yum -y install glusterfs glusterfs-fuse glusterfs-geo-replication fuse fuse-devel fuse-libs fuse-ntfs-3g
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
glusterfs-epel                                                                                                                                 | 1.3 kB     00:00
glusterfs-epel/primary                                                                                                                         | 2.7 kB     00:00
glusterfs-epel                                                                                                                                                    7/7
glusterfs-swift-epel                                                                                                                           | 1.3 kB     00:00
glusterfs-swift-epel/primary                                                                                                                   | 2.5 kB     00:00
glusterfs-swift-epel                                                                                                                                              7/7
Setting up Install Process
No package fuse-devel available.
Package fuse-ntfs-3g-2010.10.2-1.el6.rf.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package glusterfs.x86_64 0:3.3.1-1.el6 will be installed
---> Package glusterfs-fuse.x86_64 0:3.3.1-1.el6 will be installed
---> Package glusterfs-geo-replication.x86_64 0:3.3.1-1.el6 will be installed
--> Processing Dependency: glusterfs-server = 3.3.1-1.el6 for package: glusterfs-geo-replication-3.3.1-1.el6.x86_64
--> Running transaction check
---> Package glusterfs-server.x86_64 0:3.3.1-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================
 Package                                           Arch                           Version                                Repository                              Size
======================================================================================================================================================================
Installing:
 glusterfs                                         x86_64                         3.3.1-1.el6                            glusterfs-epel                         1.8 M
 glusterfs-fuse                                    x86_64                         3.3.1-1.el6                            glusterfs-epel                          64 k
 glusterfs-geo-replication                         x86_64                         3.3.1-1.el6                            glusterfs-epel                         104 k
Installing for dependencies:
 glusterfs-server                                  x86_64                         3.3.1-1.el6                            glusterfs-epel                         540 k

Transaction Summary
======================================================================================================================================================================
Install       4 Package(s)

Total download size: 2.5 M
Installed size: 9.1 M
Downloading Packages:
(1/4): glusterfs-3.3.1-1.el6.x86_64.rpm                                                                                                        | 1.8 MB     00:41
(2/4): glusterfs-fuse-3.3.1-1.el6.x86_64.rpm                                                                                                   |  64 kB     00:01
(3/4): glusterfs-geo-replication-3.3.1-1.el6.x86_64.rpm                                                                                        | 104 kB     00:01
(4/4): glusterfs-server-3.3.1-1.el6.x86_64.rpm                                                                                                 | 540 kB     00:07
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                  46 kB/s | 2.5 MB     00:55
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : glusterfs-3.3.1-1.el6.x86_64                                                                                                                       1/4
  Installing : glusterfs-fuse-3.3.1-1.el6.x86_64                                                                                                                  2/4
  Installing : glusterfs-server-3.3.1-1.el6.x86_64                                                                                                                3/4
  Installing : glusterfs-geo-replication-3.3.1-1.el6.x86_64                                                                                                       4/4
Installed products updated.
  Verifying  : glusterfs-fuse-3.3.1-1.el6.x86_64                                                                                                                  1/4
  Verifying  : glusterfs-3.3.1-1.el6.x86_64                                                                                                                       2/4
  Verifying  : glusterfs-server-3.3.1-1.el6.x86_64                                                                                                                3/4
  Verifying  : glusterfs-geo-replication-3.3.1-1.el6.x86_64                                                                                                       4/4

Installed:
  glusterfs.x86_64 0:3.3.1-1.el6                  glusterfs-fuse.x86_64 0:3.3.1-1.el6                  glusterfs-geo-replication.x86_64 0:3.3.1-1.el6

Dependency Installed:
  glusterfs-server.x86_64 0:3.3.1-1.el6

Complete!

[root@server ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.5.101 server.com
192.168.5.102 client
192.168.5.103 server0.com

gluster volume create lgv0 server.com:/data

gluster volume start lgv0

gluster volume info

[root@server ~]# gluster volume create lgv0 server.com:/data
Creation of volume lgv0 has been successful. Please start the volume to access data.


[root@server ~]# gluster volume start lgv0
Starting volume lgv0 has been successful

[root@server ~]# gluster volume info

Volume Name: lgv0
Type: Distribute
Volume ID: 08efd9f5-63f5-4982-89d0-6f150c5dee1f
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: server.com:/data
[root@server ~]# gluster volume set lgv0 auth.allow 192.168.5.102
Set volume successful
[root@server ~]#


Goto Client side 

# yum install gluster-client -y

# mkdir /gluster-mount

# mount.glusterfs server.com:/lgv0 /mnt/gluster-mount

# mount -a

# df -HT

[root@client ~]# df -HT
Filesystem    Type     Size   Used  Avail Use% Mounted on
/dev/mapper/vg_server-lv_root
              ext4     5.9G   2.8G   2.8G  50% /
tmpfs        tmpfs     523M    91k   523M   1% /dev/shm
/dev/sda1     ext4     508M    35M   448M   8% /boot


server.com:/lgv0
                      9.7G  1.7G  7.5G  19% /mnt/glusterfs



[root@client ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Fri Dec 21 06:44:38 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_server-lv_root /                       ext4    defaults        1 1
UUID=11534f37-3f19-4b75-a846-f08685dcdd97 /boot                   ext4    defaults        1 2
/dev/mapper/vg_server-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0


server.com:/lgv0 /mnt/gluster-mount glusterfs defaults,_netdev 0 0

Sunday, December 16, 2012

LVM partitions mount in rescue mode RedHat/Cent OS/Fedora

Boot your rescue media.
Scan for volume groups:
# lvm vgscan -v

Activate all volume groups:
# lvm vgchange -a y

List logical volumes:
# lvm lvs –all

With this information, and the volumes activated, you should be able to mount the volumes:
# mount /dev/mapper/VolGroup00-LogVolRoot  /mnt/mountpoint

Monday, October 29, 2012

RAMDISK Linux


Software RAM disks use the normal RAM in main memory as if it were a partition on a hard drive rather than actually accessing the data bus normally used for secondary storage such as hard disk. How do I create and store a web cache on a RAM disk to improve the speed of loading pages under Linux operating systems?


mkdir /tmp/ramdisk;
# chmod 777 /tmp/ramdisk
mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
where 256M is amount of RAM you wish to allocate for ramdisk. It’s clear that this value should be less than amount of free memory (use “free -m“).
By default 16 ramdisks are already created in RHEL/CentOS/Fedora

Monday, October 15, 2012

sshfs CentOS /RHEL/Fedora

This is a filesystem client based on the SSH File Transfer Protocol. Since most SSH servers already support this protocol it is very easy to set up: i.e. on the server side there's nothing to do.  On the client side mounting the filesystem is as easy as logging into the server with ssh.



  1. Login to your linux server as root
  2. Install fuse-sshfs
    #yum install fuse-sshfs -y
  3. Create a mount directory
    #mkdir /mnt/mountdir
  4. Mount the remote directory
    #sshfs user@192.168.0.1:/mountatremote /mnt/mountdir/
    SSHFS will then ask you to authenticate with the password for the user account you supplied
  5. To unmount the drive:
    #umount /sshfs/mount/