Tuesday, May 28, 2013

5 Load Balancers You Need to Know

By Kenneth Hess (Send Email)
Jul 31, 2011  

Load balancing refers to spreading a service load among multiple server computers. Balancing ensures maximum service availability by offering network traffic distribution services. For example, if your business has a primary business domain (e.g., www.yourbusiness.com), you want your site available to your current customers and your potential customers 100-percent of the time. Using load balancers will provide this level of availability.
If you require 100 percent uptime for your services, a load balancer is the way to go. Learn who the leaders are in the load balancing hardware and software space.When technical folks discuss load balancing, they generally mean hardware devices dedicated to the task of balancing network traffic loads. A load balancer is a server computer with a very specialized operating system tuned to manage network traffic using user-created rules. Enterprises and hosting companies rely on load-balancing devices to distribute traffic to create highly available services. This list highlights five of those products.
In addition to providing simple distributed service to multiple servers, load balancers help prevent denial-of-service attacks, allow legitimate users uninterrupted service access, protect against single point of failure outages and prevent traffic bottlenecks to systems.

1. F5 BIG-IP Load Traffic Manager (LTM)

The BIG-IP product family has a solution for almost any budget and application. If you're an F5 shop, the good news is you'll enjoy the same easy web-based administration interface included with other F5 equipment. Your load balancers can also handle your SSL certificates, which removes the pressure from your web servers and places it on network gear where it belongs. One of F5's major features is its WAN Optimization Manager, which speeds data transfers over the WAN and enables traffic between data centers to be optimized, encrypted and highly available. This feature makes creating a WAN-based disaster recovery (DR) solution easy and almost automatic.

2. Cisco

Every Cisco IOS-based router product has load balancing capabilities. This is exciting for Cisco shops because they don't have to buy separate hardware; simply add load balancing rules to your current equipment. Cisco is the clear leader in the router space, and included features like load-balancing capabilities is one of the reasons why.
Cisco's IOS includes every possible server load balancing feature possible, including port-bound servers, sticky sessions, TCP session reassignment, automatic unfail, slow start, SynGuard, dynamic feedback protocol, NAT, maximum connections and complete server load balancing algorithms to name a few.
Cisco's service and support are also second to none. Similar to another large company's time-tested adage, you'll never get fired for buying Cisco.

3. Radware AppDirector OnDemand Switch Series

Radware offers an array of network appliances to suit any load balancing requirement. Units are affordable, scalable, and smart. Smart goes a long way in contemporary data centers and Radware employs such smart technologies as health monitoring and detection, stateful persistency, high availability, redundancy, traffic redirection, global load balancing, denial of service mitigation, and significant performance optimizations.
Some notable features of Radware devices are easy updates and upgrades, application-aware services, and improved application response time through smart caching.

4. CoyotePoint Equalizer Appliances

CoyotePoint offers enterprise-level load balancing solutions at affordable prices. If your business sites and applications aren't enterprise-sized but require enterprise capability, you're in luck with CoyotePoint's array of products.
CoyotePoint's appliances support all web-based applications, including PHP, ASP, Oracle and Apache; Microsoft products, including SharePoint, Exchange, Outlook Web Access and Remote Desktop; and SSL VPN, Database clustering, Email services and Streaming Media.
The appliances fully support industry standard round-robin and weighted load-balancing algorithms.

5. Barracuda Load Balancer

The Barracuda Load Balancer includes standard load balancer features, plus intrusion prevention. That's right, intrusion prevention, not just detection. Prevention means your network has protection, even if you miss a critical patch or update. Barracuda's update service keeps your system ready to protect you from new threats automatically.
The Barracuda Load Balancer also includes service autodiscovery to ease the pain of initial configuration. Manage your changes, updates and configuration maintenance through the easy-to-use web interface. Other notable features are global load balancing and content caching.
Ken Hess is a freelance writer who writes on a variety of open source topics including Linux, databases, and virtualization. He is also the coauthor of Practical Virtualization Solutions, which was published in October 2009. You may reach him through his web site at http://www.kenhess.com.
Follow ServerWatch on Twitter
Page 1 of 1



Comment Page: 
1 
2 
By pia   May 21 2013 07:05 PDT
hai.. what the function of load balancer to every1?
By toomuch   April 11 2013 15:06 PDT
Juniper does have a load balancer any longer... RedLine is dead... What about Citrix NetScaler... that isn't even listed... Radware... well ok that ok... Cisco, are YOU JOKING?? the only way they got market share was by giving it away... buy a 65xx and get a free CSM or CSS and if that's not enough they throw in a 4710 ACE... Now that the DEAD... perfomance related at an affordable price can't beat Brocade's ADX or A10 AX-series... Yes A10 is fast and affordable... they should be they stole their technology from Brocade.... who ever made this list is out of touch... top 5 1) F5 2) Citrix (Netcaler) 3) Radware / Alteon 4) A10 5) Array, SilverPeak, Brocade, Kemp and all the rest. best bet is to have you requirement clearly defined and buy a device that'll deliver at best price point... most of the time that will rule out the top three...
By hashim   March 13 2013 11:47 PDT
Whats about junepar?
By Malcolm Turnbull   February 23 2013 13:10 PST
Seriously? This article is obviously from Barracuda Networks... It names a few expensive load balancer vendors then tacks Barracuda onto the end? What happened to Kemp Technologies their only real low end competitor? I must confess I'm biased as I own Loadbalancer.org. BTW why does no one buy CoyotePoint any more? I think they rock.
By Neel   November 28 2012 23:33 PST
Hi, of the 5 load balancers suggested, which one will come economical and good performance.....
By Tittu   November 27 2012 01:29 PST
spend some time with vblock series devices
By LBFrantic   November 27 2011 20:46 PST
Why not use off-the-shelf Wintel hardware/OS? See http://www.iqproxyserver.com for a next gen Windows reverse proxy.
By Sam   August 09 0002 00:00 PST
www.jetNEXUS.com - Innovative ADC Solutions well worth a mention.
By gfghwrghr   August 09 0002 00:00 PST
Please input this URL:\nhttp://www---- bestniceshoes ----com\nhttp://www---- bestniceshoes ----com\n\nBest quality, Best reputation , Best services !!!\nexquisite watches shirts,bags,hat and the decorations.We have good reputation, fashion products, favourable price.
By Z   August 09 0001 00:00 PST
Why are you only looking at old stuff ? You need to see Zeus range of virtual Load Balancers and Traffic Managers (http://www.zeus.com) - Virtual machines which beat hardware appliance performance and feature

Monday, May 27, 2013

A simple example of shell script

#!/bin/bash
for n in 1 2 3 4 'str1' 'str2' ; do
 echo i $n
done

for (( n=1; n<10; n++ )); do
  echo n $n
done

count=10
while [ $count -le 20 ]; do
  echo count $count
  count=`expr $count + 1`
done


opt=2
case "$opt" in
  "1")
     echo "case1"
     ;;
  "2")
     echo "case2"
     ;;
   *)
     echo "*"
     ;;
esac

echo $(( 1+2 ))
let x='1+2'; echo $x
echo `expr 1 + 2`

Friday, May 24, 2013

Build your own cloud – Tutorial

Make your own private cloud so you can access your files from any device, including PCs, smartphones and tablets, from anywhere in the world… 

(well, in the first place, this is a home based solution to personal storage on the cloud. If you have set up a web server that is accessible by the outside world, then you can access it anywhere from the world. - z.y. wang)

Cloud computing is more than a buzzword. It is an essential part of how we use technology today. On a personal level, we all store and retrieve data and we do this on multiple devices, like PCs, smartphones, tablets and media players. We also want a coherent experience with this data: we want to be able to retrieve and store any data from/on any device. In the old days, we had to manually sync every other device to a central location to have the same copy of data everywhere else. But this is a very cumbersome and confusing process. On top of that, you will also have to limit where data is being saved. In most of the cases this place is the central system from where we are syncing the other devices. This method is still not that bad if you are doing this between just two devices; but when you go beyond that, you will always think that there must be a better way to do this.
Imagine having all your data available to you on every device you own. You are not bound by limitations such as where you can store or retrieve the data. This is where the cloud comes into the picture and makes it all a reality. Cloud computing in a more general sense means making computing resources (like storage, processing power, software etc) available in the form of services (on public or private networks) which can then make those resources available from any other system.
In this feature we will be building our own cloud system, a cloud storage system to be precise. Much like Dropbox, Ubuntu One or SkyDrive, but our implementation will have more features. Before you move on, you may ask what is the point in doing this when we already have such popular services on our disposal. Here is why:
Not your cloud: While these services are popular and easy to use, you do not own them. You use them by agreeing to certain terms and conditions (we bet you haven’t even read them) that can be changed at any given time by the service providers. This may leave your files at risk.
Downtime: Sometimes you may lose access to your files because of server issues faced by your service provider. This can very problematic if you are unable to gain access to one of your important files when you really need it.
Privacy: Since your files are hosted elsewhere, they may be viewable to certain third-party agencies (like governments) without your consent. This worries a lot of people.
Features and restrictions: Most of these proprietary services do not have a lot of features and are very restrictive in terms of what you can do with the files.
Cloud Storage
The interface

Step by Step

We will be building our private cloud using the open source software called ownCloud. The name says it all: it allows you to build your own cloud storage infrastructure. OwnCloud started its life as a The KDE cloud computing project and is now available on almost all popular platforms. Created by KDE developer Frank Karlitschek, it is now developed by the ownCloud team.

Step 01

Installing the prerequisites
The ownCloud core is written in PHP5. Its prerequisites are basic, like those of any typical PHP web application. On the database side it supports SQLite, MySQL, Oracle and PostgreSQL. For our setup we’ll use MySQL to keep things simple yet scalable. If you are only doing a test setup, you can use SQLite, which is a zero configuration database system.
You will need to install the following on your Linux distribution:
PHP packages: php5, php5-gd, php-xml- parser,php5-intl
Database driver: php5-mysql. If you are planning to use any other database you will also need to install the respective database together with its PHP driver.
Curl packages: curl, libcurl3, php5-curl
SMB client: smbclient; this is used to mount Windows share.
Web server: apache2
For a Debian-based distribution, you can run the following command to install all the prerequisite packages:
$ sudo apt-get install apache2 php5 php5-gd php-xml-parser php5-intl php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl mysql-server

Step 02

Installing ownCloud – setting up the web root directory
Download the latest version of ownCloud from http://owncloud.org/releases/. For this tutorial we are using owncloud-4.5.6.tar.bz2 At this point you’ll need to set up the web server root directory. On Debian-based distributions it is /var/www. Extract the owncloud package in the web server root directory When in doubt, look at the Apache configuration file.
$ tar xjf owncloud-4.5.6.tar.bz2
$ cp -r -v owncloud/ /var/www/ ludcloud //
In our example, we are using ludcloud as the root installation directory.
OwnCloud needs to write to certain directories of its installation. To do that, the web server user (www-data for Debian-based distributions) must own apps, data and config directories of the installation. Run the following commands to give the required permissions:
$ cd /var/www/ludcloud
$ sudo mkdir data //
This folder is not present, but is needed during installation.
$ sudo chown -R www-data:www-data data
$ sudo chown -R www-data:www-data config
$ sudo chown -R www-data:www-data apps

Step 03

Installing ownCloud – configuring the web server
In this step we will be configuring Apache Web Server for ownCloud. OwnCloud requires .htaccess to be enabled on the Apache server. .htaccess files (or ‘distributed configuration files’) provide a way to make configuration changes on a per-directory basis. To enable the .htaccess in the web server, edit your web server configuration file (in Debian-based distributions it is /etc/apache2/sites-enabled/000-default) with AllowOverride All.
   <Directory /var/www/>
        Options Indexes
FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
   </Directory>
Next we need to enable an Apache module called mod_rewrite. Mod_rewrite provides a rule-based rewriting engine to rewrite requested URLs on the fly. To enable this module, run the following commands:
$ sudo a2enmod rewrite
$ sudo a2enmod headers
Once you have enabled the necessary modules, you can restart the service to apply the changes.
$ service apache2 restart

Step 04

Installing ownCloud – running the installation
Navigate to http://localhost/ludcloud. You will be presented with the installation screen for ownCloud.
The first thing to do here is to create an admin account. Enter the desired username and password to do so. To configure the database, click on Advanced then select MySQL. Then enter the MySQL username password along with the database name. If you do not have a separate database user configured then you can use the root username; ownCloud will create a dedicated database with a dedicated db user for use with ownCloud.
Click Finish Setup to complete the process.

Step 05

Adding extra storage
If you have lot of users on your server you can quickly run out of storage. That’s why it helps to have additional storage available. OwnCloud supports SMB (Windows share), FTP, WebDAV, OpenStack and Local File system.
To enable extra storage you’ll need to create and edit <ownCloud Root>/config/mount.php. Additional storage can be created either for a single user or a user group.
The following is an example mount.php with all the back-ends enabled:
<ownCloudRoot>/config/mount.php
// Example mount.php showing few of the supported backends enabled
<?php
return array(
// Mount options for group
    ‘group’=>array(
        ‘admin’=>array(
            ‘/$user/files/Admin_Files=>array(
// Accessing Local Filesystem
                ‘class’=>’OC_Filestorage_Local’,‘options’=>array(‘datadir’=>’/mnt/admin_extra_storage’)
            ),
        ),
    ),
//Mount options for users
    ‘user’=>array(
        ‘all’=>array(
// Accessing WebDav Storage
            ‘/$user/files/Web_Dav_Files'=>array(
                ‘class’=>’OC_Filestorage_DAV’,
                ‘options’=>array(
                    ‘host’=>’webdavhost.com/webdav.php’,
                    'user'=>'max',
                    ‘password’=>’secret’,
                    ‘secure’=>true)
                ),
        ),
        ‘user1’=>array(
//Accessing FTP Share
            ‘/user1/files/ftpdownloads’=>array(
                ‘class’=>’OC_Filestorage_FTP’,
                ‘options’=>array (
                     ‘host’=>’ftp.mywebhost.com'
                     'user'=>'max',
                     'password'=>'secret'
                     'root'=>'/ftpfiles')
                 ),
             ),
        )
);

Step 06

Configuring user authentication
If you have lots of users for your cloud, then creating individual users again in ownCloud could become tedious. If you already have a user authentication system in place, ownCloud can use it. OwnCloud supports LDAP, IMAP, SMB, OpenID, WebDAV and FTP. This support is provided in the form of apps. Apps are a way to extend ownCloud’s functionality.
To install additional user authentication back- ends, log into ownCloud, click Settings (gears icon) then Select Apps, then select an App which is not represented with bold fonts, then click Enable in the right pane. Bold means the app is already enabled.
You can use the following apps:
For LDAP: LDAP user and group back-end For OpenID: OpenID user back-end
For WebDAV: WebDAV user back-end
For IMAP, SMB, FTP: user_external
The following shows an example of using the user_external app for authenticating from IMAP, SMB and FTP. You will need to edit the <ownCloudRoot>/config/config.php file.
For IMAP:
‘user_backends’=>array(
  array(
    ‘class’=>’OC_User_IMAP’,
    ‘arguments’=>array(‘{imap.gmail.com:993/imap/ssl}INBOX’)
  )
)
For SMB:
'user_backends'=>array(
  array(
    ‘class’=>’OC_User_SMP’,
    ‘arguments’=>array(‘smbserver’)
  )
)
For FTP:
‘user_backends’=>array(
  array(
    ‘class’=>’OC_User_FTP’,
    ‘arguments’=>array(‘ftpserver’)
  )
)

Step 07

Accessing ownCloud over WebDAV
OwnCloud comes with full WebDAV support. WebDAV is an HTTP protocol that allows read/write file management over the web. The good thing about WebDAV is that the clients are already built into all the popular operating systems, such as Linux, Mac OS X and Windows.
WebDAV is automatically enabled on ownCloud. To access it you will need to use the following URL: www.yoursite.com/ludcloud/ files/webdav.php
Log in with your ownCloud credentials when prompted.
To access your ownCloud account from Nautilus (a popular Linux file manager), you can click File>Connect to Server under Type Select WebDAV and enter server details, click Connect.
You can also use the URL in the format
dav://username@yoursite/ludcloud/files/webdav.php and type it directly into the location bar of Nautilus.
If you want to access it from Mac OS X’s Finder, you can click on Go>Connect to Server… and enter the URL in the format http://www. yoursite.com/ludcloud/files/webdav.php. Enter your credentials when asked.

Step 08

Syncing files using desktop sync clients
If you like Dropbox then you will love this feature. You can use desktop sync clients to sync your files across multiple computers and devices. Desktop sync clients are available for Linux, OS X and Windows. Like ownCloud, desktop sync clients are also open source.
On Ubuntu you can install the package using Apt-get:
$ sudo apt-get install owncloud-client
For other distributions (Debian, CentOS, Fedora, openSUSE etc) you can use the following URL to get the ownCloud desktop sync clients: http://software.opensuse.org/download/pack age?project=isv:ownCloud:devel&package=ow ncloud-client
Download Windows and OS X sync clients from http://owncloud.org/sync-clients/
Desktop sync clients can be used for continuous sync, selective folder sync, multi-folder sync. Multi-folder sync means you can sync multiple ownCloud folders to multiple folder locations. This is an important feature which is not even provided by most popular cloud service providers.

Step 09

Syncing files using mobile sync clients
OwnCloud syncing is not just limited to the desktop. You can use ownCloud’s mobile sync clients to sync your files on the go. OwnCloud mobile apps are available for the Android and iOS (iPhone/iPod touch/iPad) platforms. Both allow you to sync files on the go. The Android version of the app also allows you upload files from any Android app and offers automatic favourite file syncing. The latter feature will keep all your favourite files synced with the mobile device all of the time.
You can either purchase the Android app from the Google Play Store (https://play.google. com/store/apps/details?id=com.owncloud. android) or the Amazon Appstore (www. amazon.com/ownCloud-Inc/dp/B00944PQMK/ ref=sr_1_1?ie=UTF8&qid=1352459188&sr=8- 1&keywords=owncloud). If you are not keen on paying, you can either build the client yourself from the source (https://github.com/owncloud/ android) or download a prebuilt APK file from http://alefzero.eu/a/master.
The iOS version of the App is not open source and is only available in the Apple App Store at https://itunes.apple.com/us/app/owncloud/ id543672169?mt=8. The ownCloud developers say that this is because of Apple’s policy on open source applications in the App Store. The Android and iOS apps cost 63p and 69p (both 99¢) in their respective stores.

Step 10

Extending ownCloud functionality using community add-ons/apps
One of the best features about having your own setup is that you can customise it to your own needs. Using ownCloud, you not only get to customise it but also have the ability to add more features to it. OwnCloud has a vibrant community of people building add-ons for ownCloud, called apps, at apps.ownCloud.com. These apps are available in the Multimedia, PIM, Productivity, Games and Tools categories.
To see how to install apps in ownCloud, in this section we will install the Notes app, which provides notes functionality for ownCloud. Notes is a very capable note-taking app which supports MarkDown and syncing to standalone note-taking apps. You can use Papyrusex, a free note-taking Android app on the Google Play Store (https://play.google.com/store/apps/details?id=com.kallisto.papyrusex) to sync notes. You can also use zNotes (http://sourceforge.net/projects/znotes/) to sync notes on Linux, BSD, OS X and Windows platforms.
Download the Notes zip archive from http:// apps.owncloud.com/content/show.php/ Notes?content=155599. Extract the zip file and copy the extracted folder (in this case, Notes) into the <ownCloudRoot>/apps/ directory. Log into your ownCloud instance as an Admin user, then click Settings>Apps. In the Apps list you will notice a new entry called Notes. Click on it, then click Enable in the right pane to activate the installed app. After activation, refresh the ownCloud page and you’ll see Notes in the left navigation bar. Click on it to start using Notes.
Other apps may require additional steps; check with the documentation of the apps you are installing.

Conclusions

As you can see, creating your own personal cloud has some real benefits in terms of the features and the flexibility. Thanks to ownCloud you can now create the cloud of your dreams using open source software. The ownCloud developers have made sure that you don’t miss your data anywhere by creating sync clients for both desktops and mobile devices. OwnCloud installation is also flexible. As we have seen, you can choose from a wide variety of storage (including other cloud services) as well as plenty of very unconventional authentication mechanisms. If you still think there is something missing in ownCloud that you want, well fear not: you can add that feature yourself. Watch out for a future tutorial on how to write ownCloud apps on Linux User & Developer.

Create your own high-performance NAS using GlusterFS

GlusterFS is used in environments where high performance, redundancy and reliability are of a premium. The best part is that it’s exceedingly easy to use.

GlusterFS is a file system that is designed to provide network storage that can be made redundant, fault-tolerant and scalable. It’s particularly well suited to applications that require high-performance access to large files. With GlusterFS, you can have enterprise- or scientific-research-grade storage up and running in minutes, but it wouldn’t be our first choice for the type of simple file sharing that Samba or NFS are usually used for.
Although GlusterFS can do striping (chopping the files into parts), it isn’t the preferred approach. Typically, additional storage nodes, or ‘bricks’ as they are called, are used for either replicated (redundant) data or
for distributed storage that adds capacity and improves performance.
GlusterFS expects the clients to be running the FUSE (user-space) file system driver, but since version 3.x, GlusterFS automatically enables NFS access to the volumes. The built- in NFS server offers better performance when accessing lots of small files for applications such as web serving or a remote /home directory. Bear in mind, getting GlusterFS’s NFS working alongside existing NFS shares is outside the scope of this tutorial. The most amazing thing about GlusterFS is that it’s very simple to use and maintain, as we intend to show you here.











NAS
This tutorial will work with any of the major distributions

Resources

Multiple Linux boxes
A network
GlusterFS

Step by Step

Step 01

Set up the network
GlusterFS is at its best when connected to Gigabit Ethernet and a large array of servers and storage devices. However, a combination of two computers or even two VMs are sufficient when learning how to use GlusterFS.

Step 02

Become root
Become root by typing:
sudo -i
…on Ubuntu and derivatives. This saves having to type ‘sudo’ before every command. Use the ‘su’ command on other distros. Consider opening a terminal on another tab, for example, to carry out actions as a standard user.

Step 03

Install server
Compare version numbers between your distro and the website. If you manually install a newer server, you might have to update the clients as well. If your distro is offering a recent enough version, you can install by typing:
apt-get install glusterfs-server

Step 04

Switch to static IP
Open /etc/network/interfaces in a text editor. If present, remove the line:
iface eth0 inet dynamic
Add the lines
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
network 192.168.0.0
adjusting the details for your network. Restart the machine and test the network.

Step 05

Adding and removing volumes
Use the following command:
gluster volume create testvol 192.168.0.100:/data
This creates a volume called ‘testvol’ that is stored on the server at 192.168.0.100. The files are located in a directory called /data in the root file system of the server, and this is what GlusterFS refers to as a brick. Then, type:
gluster volume start testvol
Type
gluster volume info
to verify that it works. You can remove this volume, later on, by typing:
gluster volume stop testvol
and then
gluster volume delete testvol

Step 06

Mount the volume locally
We’ll now mount the volume, locally, from the server itself. Create a mount point using:
mkdir /mnt/gluster
Use the command:
mount.glusterfs 192.168.0.100:/ testvol /mnt/glusterfs
to mount it. Type:
echo “It works” > /mnt/gluster/test. txt
…then browse to the mount point to check it works.

Step 07

Mount the volume remotely
On a client machine, install the GlusterFS client packages (sudo apt-get install glusterfs-client on Ubuntu). Create a mount point and mount the GlusterFS volume with:
mkdir /mnt/gluster
and then
sudo mount.glusterfs 192.168.0.100:/testvol /mnt/gluster

Step 08

Mount on startup
Make the mount permanent on any client machine by adding it to /etc/fstab.
As root, open /etc/fstab in a text editor, and add the line:
192.168.0.100:/testvol /mnt/gluster glusterfs defaults,_netdev 0 0

Step 09

Share over NFS
Recent versions of GlusterFS automatically enable NFS access to volumes. To make it work, you need to add the portmap package to the server. Then, you can mount the volume using NFS by adding a mount point:
sudo mkdir /mnt/nfsgluster
and then typing
sudo mount -t nfs 192.168.0.100:/ testvol /mnt/nfstest/ -o tcp,vers=3
To make a client mount the share on boot, add the details of the GlusterFS NFS share to /etc/fstab in the normal way. For our example, add the line:
192.168.0.100:7997:/testvol / mnt/nfstest nfs defaults,_netdev 0 0

Step 10

Add second server
Begin by setting up a new server, as shown in the earlier steps. Give the new server an IP address such as 192.168.0.101. Note that you can run these commands on any GlusterFS server. Type:
gluster peer probe 192.168.0.101
and then type
gluster peer status
to check the status of the new server.

Step 11

Edit hosts file
Admin can be carried out from any Gluster server, so add the servers to the hosts file of your admin machine if you prefer to work with names rather than IP addresses. For example, edit /etc/hosts with a text editor, and add a line such as 192.168.0.100 server1 for each server.

Step 12

Add storage volume (distributed)
Add a distributed volume to the system by typing:
gluster volume create test-volume 192.168.0.100:/storage1 192.168.0.101:/storage2
Note that on a setup like this, a single server becoming damaged or unavailable is going to lead to a major loss of files.

Step 13

Add storage volume (duplicated)
To create a duplicated volume, for redundancy, type:
gluster volume create test-volume replica 2 192.168.0.100:/storage1 192.168.0.101:/storage2
To create a volume that is both duplicated and distributed, type:
gluster volume create test-volume replica 2 192.168.0.100:/ storage1 192.168.0.101:/ storage2 192.168.0.100:/storage3 192.168.0.101:/storage4
The order in which the servers are specified ensures that each contains a brick and a copy of the other brick, an arrangement that maintains redundancy if either server fails or becomes unavailable.

Step 14

Authorise clients
By default, any client can connect to a GlusterFS server. However, you can limit access using the command:
gluster volume set testvol auth. allow [list of addresses]
Note that this command supports the use of wildcards to authorise a range. You might find it more convenient to locate the configuration file for the volume in /etc/glusterd/vols/[name of volume]/. Open the file up in a text editor and scroll down to ‘option auth.addr./data.allow’. Replace the asterisk with a list or range of authorised client IP addresses.

Step 15

Adding and removing bricks
You can add extra bricks on the fly, but they must be in multiples of the existing storage. For example, if you have a duplicated storage volume, you must add two bricks to expand it. Use:
gluster volume add-brick testvol 192.168.0.100:/media/storage/extra
…to add an extra brick. New bricks are empty when they are first added, so they need to be rebalanced with this command:
gluster volume rebalance testvol start
You can remove bricks with a command like this:
gluster volume remove-brick testvol 192.168.0.100:/storage4
Note that the information stored on the brick will become inaccessible, but the data is not deleted.

Step 16

Examine the log directory
By default, GlusterFS stores its logs under /var/log/ and they are comprehensive. You can change the log directory for a volume with the command:
gluster volume log [directory]
…and you can locate the logs associated with a volume using:
gluster volume log locate [name of log]

Step 17

Add striped volumes
Striping, chopping files up and distributing them is possible but not the preferred option. If you have a use case that will benefit from this approach, use the following command:
gluster volume create striped-volume stripe 2 192.168.0.100:/storage1 192.168.0.101:/storage2

Step 18

Preparing a storage drive
You may like to prepare a blank storage drive for GlusterFS bricks. Ext4 and ext3 are supported along with XFS. Which one you choose depends on your requirements and your experience with each, but the consensus is that the advantages of XFS only start to come to the fore under huge loads and enormous storage spaces.

Step 19

Examine the storage
The easiest way to check on your mounted storage is with the df -h command. gluster volume info lists all mounted and active volumes and the bricks that they are composed of. You can examine the bricks and their contents by browsing the directories normally.

Original article here
http://www.linuxuser.co.uk/tutorials/create-your-own-high-performance-nas-using-glusterfs

Wednesday, May 15, 2013

install samba4 on panther

Well, installing samba in ubuntu may be easy. I was able to install samba in ubuntu LTS 12 in a minute, using apt. Everything went so smooth. But when I tried to install samba in ubuntu 10.10, which is no longer supported by now (May 2013), it turned out to be painful. Here is how I eventually made it successfully.

PART I

install samba4 on panther (ubuntu 10.10 Maverick)

1)download samba-4.0.5 source code from samba.org;

2)install some required dependencies: python-dnspython, git and a few others. (launchpad.com will help on this);

3)configure using waf as follows:
#cd path-to-samba4
#LDFLAGS="-lm -ldl -lutil" ./buildtools/bin/waf configure

#make
#make install

The default installation will be located at:
/usr/local/samba

alternatively, you may use the python way of doing it:
./install_by_python.sh


 PART II

the configure file. here is a simple example:

[global]
    workgroup = NHLBI.NIH.GOV
    server string = %h server (Samba, Ubuntu)
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    idmap config * : backend = tdb

[share]
    comment = this is my share 1
    path = /share
    guest ok = Yes



PART III
add the following rules to your iptables.

iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
iptables -A NPUT -p udp -m udp --dport 138 -j ACCEPTiptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPTiptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT

PART IV
Before you start your smbd daemon, you need to do two minor tasks:
(a)Make sure the ports (137,139 etc) are available. If you have other applications sunning similar services, make sure they don't conflict the ports;
(b) #touch /etc/printcap
This file does not exists by default. So you need to create one for the first time use.

 You may find the smbd binary in prefix/sbin/ directory. Run it. Then you can monitor your samba connections by:
#smbstatus
It will tell you how many clients are currently connected to your server.
Enjoy.