Monday, October 29, 2012

Howto setup Eclipse Juno on Ubuntu 12.04.1

The Eclipse PPA is dated and to install Juno for Ubuntu 12.04.1 manually kindly follow these steps 

1. Select and download Eclipse Juno .tgz for your architecture from http://www.eclipse.org/downloads/

2. Open terminal windows (Ctrl + Alt + T) and type following command

$ cd ~/Downloads
$ tar zxvf eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz
(Do not run this command as sudo or root)

$ sudo su

# mv eclipse /usr/lib/eclipse

# chown root:root /usr/lib/eclipse

# ln -s /usr/lib/eclipse/eclipse /usr/bin/eclipse

# exit

$ eclipse

this will start eclipse.

4. To add Juno update site, in Eclipse menu select 'Help' > 'Install New Software...'. Click on Add button and enter name as 'Juno' and location enter 'http://download.eclipse.org/releases/juno' and click on 'Ok' to save.
 
5. To add eclipse to Unity Launcher, open file editor and create eclipse.desktop file

$ sudo vi /usr/share/applications/eclipse.desktop

[Desktop Entry]
Type=Application
Name=Eclipse
Version=4.2.1
Comment=Eclipse Integrated Development Environment
Icon=/usr/lib/eclipse/icon.xpm
Exec=/usr/lib/eclipse/eclipse
Terminal=false
Categories=Development;IDE;


save the file and now go ahead and type eclipse in HUD and start eclipse.

Sunday, September 30, 2012

FreeNAS® - Deployment Guide

Few days back I was searching for alternative open source solutions for enterprise and I found quite a few options and of them FreeNAS seemed quite interesting. I immediately downloaded an .iso and within 10 minutes FreeNAS was installed and running.

FreeNAS® 8.2.0 is an Open Source Storage Platform  which supports sharing across Windows, Apple, and UNIX-like systems. It includes ZFS (Zettabyte File System), which supports high storage capacities (256 quadrillion zettabytes) and integrates file systems and volume management.

To deploy we need a server with atleast 4 GB RAM & 2 HDDs, smaller HDD as a dedicated boot drive for installing OS & larger capacity HDD for storing Data. FreeNAS OS can also be installed on USB flash drive or SATA DOM with 2 GB or more space.

Follow below mentioned steps to proceed with basic server deployment.

1) Boot the system using FreeNAS CD

2) In 'Console Setup' screen select option 'Install/Upgrade'

3) In 'Choose destination media' screen select smaller HDD to install OS

4) In 'Upgrade this FreeNAS installation' screen select 'No' to do fresh installation

5) In "FreeNAS installation" screen select 'Yes' to proceed with installation

6) Once installation is done, system will ask to remove CD & proceed to reboot the system, click on 'Ok'.

7) This will go back to 'Console Setup' screen, now select 'Reboot System' option and remove CD while system boots.

8) While booting, server picks up IP address from DHCP and once server is ready, the consoles displays system menu & URL to access FreeNAS Admin Interface over the network. Now we are ready to proceed with server configuration.

9) Open a browser on any desktop from the same network and open FreeNAS URL to access Admin Console. The very first thing you do is the set Admin / root password.

     - Click on [+] Account -> Admin Account -> Change Password & now provide password for Admin Interface. Ensure 'Change root password as well' is checked. Click on 'Change Admin Password' to save new password. With saving of password, the red 'Alert' button on right hand side of screen will stop blinking and turn to green.

10) Change basic server details & set fixed IP address for the server

     - Click on [+] 'Network' -> 'Global Configuration'
     Provide details as required for these fields
          - Enter Hostname
          - Enter Domain name
          - Enter gateway address for IPv4 Default Gateway
          - Enter DNS server IPs for Nameserver
          - Click on 'Save' at the bottom of the screen

     - Click on [+] 'Network' -> 'Interfaces', in this screen click on 'Add Interface' button and fill in details as mentioned below
     - Select NIC from dropdown box
     - Enter 'nic1' Interface Name
     - Do not check DHCP as we are configuring fixed IP address
     - Enter server ip address for 'IPv4 Address'
     - Select valid subnet mask for 'IPv4 Netmask'
     Rest of the information can be left blank and at the bottom of the page click on 'Ok' button to save changes. Now restart the server.
     
11)  In the browser, enter new FreeNAS URL and login to access Admin Console

12) Before we proceed lets increase the default space allocated for /etc partition, as we would need additional space for our deployment

     - Click on 'Shell' and run following command

     [root@freenas ~]# mount -uw /
     [root@freenas ~]# vi /conf/base/etc/md_size

     and update 10204 to 20480 or more depending upon the requirement and save the file

     [root@freenas ~]# mount -ur /

     and restart the server.

13) Configure NTP server for FreeNAS server to sync & also enable it to be a NTP server for our network
     - Click on [+] 'Systems' -> 'NTP Servers' -> 'Add NTP Server'
     - Enter '1.in.pool.ntp.org' for Address and keeping rest as default click on 'Ok' button to save
     - Again click on 'Add NTP Server' & enter '2.asia.pool.ntp.org' for Address & click on 'Ok' button to save
    We can safely remove few other NTP servers
     - Click on [+] 'Systems' -> 'NTP Servers' -> 'View NTP Server' and delete '1.freebsd.pool.ntp.org' & '2.freebsd.pool.ntp.org' by clicking on 'Delete' button next to it.

14) Configure correct timezone
     - Click on [+] 'Systems' -> 'Settings' -> 'General'
     - Select 'Asia/Kolkata' for TimeZone and click on 'Save' button

15)
Configure 'System Log Status Window'
     - Click on [+] 'Systems' -> 'Settings' -> 'Advance'
     - Select checkbox next to 'Show console messages in the footer'
      And click on 'Save' to save.


16) Now lets proceed to configure ZFS Volume for storage
     - Click on [+] 'Storage' -> 'Volumes' -> 'Volume Manager'
     - In 'Volume Manager' screen, enter 'Volume name' for e.g. 'DATA'
     - In Member Disk, select displayed HDD(s) for eg ada1
     - For 'Filesystem type ' select 'ZFS' radio button
     - Click on 'Add Volume' to create ZFS volume

17) Prepare data storage directory
     - Click on 'Shell' and run following command
     [root@freenas ~]# zfs list
     NAME   USED  AVAIL  REFER  MOUNTPOINT
     DATA   364K   913G   112K  /mnt/DATA

     Lets make a directory to store all users data for e.g 'individual' 
     [root@freenas ~]# mkdir /mnt/DATA/individual
     [root@freenas ~]# ls -l  /mnt/DATA
     total 17                                                                       
     drwxrwxr-x  2 root  wheel  2 Aug 22 18:45 individual

     And the output should be similar as above
   
18) Proceed to create common user group for e.g 'usergrp'
     - Click on [+] 'Account' -> 'Groups' -> 'Add Group'
     - In 'Add Group' screen, provide 'usergrp' for 'Group Name' & click on 'Ok' to create

19) Proceed to create users
     - Click on 'Shell' and run following command, for eg to create user joel

     [root@freenas ~]# mkdir /mnt/DATA/individual/joel

     - close 'Shell' window
     - Click on [+] 'Account' -> 'User' -> 'Add User'
     - Enter username for eg 'joel'
     - Uncheck checkbox for 'Create a new primary group for the user'
     - From 'Primary Group' dropdown list box select 'usergrp'
     - For 'Home Directory', browse and select /etc/DATA/individual/joel
     - For 'Home Directory Mode', select all checkboxes under 'Owner' and uncheck all checkboxes under 'Group' & 'Other'
     - For 'Shell' select 'nologin'
    - Provide Full Name, Email & Password and then click 'Ok' button at the end of the page
     There is a bug in GUI as it is not able to set user permission correctly while user creation so Click on [+] 'Account' -> 'Users' -> 'View Users' and on right hand side section click on 'Modify User' for the newly created user
     - In the 'Modify User' screen goto 'Home Directory Mode' and select all checkboxes under 'Owner' and uncheck all checkboxes under 'Group' & 'Other'. This should correct all user permissions.

20) Now configure CIFS services
     - Click on [+] 'Services' -> 'CIFS'
     - For 'Authentication Model' select 'Local User'
     - For 'NetBIOS name' should be same as hostname
     - For 'Workgroup' provide workgroup name
     - For 'Description' provide description
     - Keep 'DOS charset', 'Unix charset' & 'Log level' as default
     - Uncheck for 'Local Master'
     - Check for 'Time Server for Domain'
     - Uncheck for 'Large RW support'
     - Check for 'Send files with sendfile(2)'
     - Uncheck for 'EA Support'
     - Check for 'Support DOS File Attributes'
     - Uncheck for 'Allow Empty Password'
     - For 'Auxiliary parameters' leave blank
     - Uncheck for 'Enable home directories' & 'Enable home directories browsing'
     - Leave blank for 'Home directories' & 'Homes auxiliary parameters'
     - Check 'Unix Extensions'
     - Check 'Enable AIO' and leave default values for 'Minimum AIO read size' & 'Minimum AIO write size'
     - Uncheck for 'Zeroconf share discovery'
     And click on 'Ok' to save.

     Now click on [+] 'Sharing' -> 'Windows (CIFS) Shares' -> 'Add Windows (CIFS) Share'
     - For 'Name' provide share name example 'data'
     - For 'Comment' leave blank
     - For 'Path' provide data directory path for eg '/mnt/DATA/individual'
     - Check for 'Browsable to Network Clients'
     Rest leave as unchecked and click on 'Ok', once clicked it will ask to enable service, click on 'Yes' to start CIFS services

21) Now lets ensure directories are created with proper rights
     - Click on 'Shell' and run following commands to check

     [root@freenas ~]# ls -l /mnt/DATA/individual/
     total 34
     drwx------  2 abhijit  wheel  10 Aug 23 18:30 abhijit
     drwxrwx---  2 joel     usergrp  11 Aug 23 18:26 joel
    
     if a directory is found with incorrect permission i.e 700 then run following command for those directories

     [root@freenas ~]# chmod 700 /mnt/DATA/individual/joel

     and check again
    
     [root@freenas ~]# ls -l /mnt/DATA/individual/
     total 34
     drwx------  2 abhijit  wheel  10 Aug 23 18:30 abhijit
     drwx------  2 joel     usergrp  11 Aug 23 18:26 joel

     if a directory is found with incorrect group i.e 'usergrp' then run following command for those directories
    
     [root@freenas ~]# chgrp usergrp /mnt/DATA/individual/abhijit

     and check again
    
     [root@freenas ~]# ls -l /mnt/DATA/individual/
     total 34
     drwx------  2 abhijit  usergrp  10 Aug 23 18:30 abhijit
     drwx------  2 joel     usergrp  11 Aug 23 18:26 joel

22) Lets create a common folder for users to share data amongst users
     - Click on 'Shell' and run following commands
     [root@freenas ~]# mkdir /mnt/DATA/individual/common
     [root@freenas ~]# chgrp usergrp /mnt/DATA/individual/common
     [root@freenas ~]# chmod 770 /mnt/DATA/individual/common

23) Configure Periodic Snapshot Task for data backup. For example configure snapshot once a day & set its lifetime to 1 week or more depending upon the storage space & requirement
     - Click on [+] 'Storage' -> 'Periodic Snapshot Tasks' -> 'Add Periodic Snapshot'
     - For 'Filesystem/Volume' select 'DATA' i.e ZFS Volume Name
     - Check for 'Recursive'
     - For 'Lifetime' set 1 Week
     - For 'Interval' select '1 day'
     - Check all weekdays for 'Weekdays'
     And click on 'Ok' to save.
     
24) Configure ZFS Scrub to proactively check data integrity. For example configure scrub to happen once every 7 days i.e every Saturday at 12:00 am. This activity is going to be bit heavy on server so plan when there are no or negligible data access
     - Click on [+] 'Storage' -> 'ZFS Scrub' -> 'View ZFS Scrub' and click on 'Edit' button for default rule
     - For 'Threshold days' change to '7'
     - For 'Day of week', select checkbox next to 'Saturday'
     - Uncheck checkbox next to 'Sunday'
     And click on 'Ok' to save.

And you should be ready to start using FreeNAS over the network. Mount samba share on your windows / linux client desktop and and start storing your data.

Monday, April 30, 2012

Sucess Story - Deploying Open Source in Enterprise

We were setting up 75 seater backoffice for our organisation and we decided to use Linux as desktop operating system in anticipation of reducing TCO.

Basic Requirement

First step taken was to ensure that our sysadmin team is Linux ready with training and studying online references.

Preparation

We evaluated multiple Linux distributions and Ubuntu topped our list for its ease of use and extensive online documentation. Next step was to list down open source alternative softwares for all applications / tools used by our backoffice team.

We did test run with a small user group to ascertain Ubuntu's suitability and reliability for its smooth implementation in a larger environment. Issues encountered during implementation and operations were documented along with their solutions. After the successful run for a month with this user group, it was then implemented at our new 75 seater backoffice.

Deployment

To ensure that Ubuntu installation is consistent across all desktops, the customised Ubuntu installation guide was used which was prepared during test run. The applications installed on desktops were Libre Office, VLC, Flash plugin, Java JRE, PDF reader, 7Zip, Gimp, Microsoft compatible fonts, hplip printer drivers, etc. And likewise-open was used to join Ubuntu desktops to Windows Domain.

As all 75 desktops were of similar configuration we first got one system ready and then used clonezilla to clone this system to remaining 74 systems.

Key benefits

- Reduced TCO which is crucial for growing organisation
- Easy integration of Ubuntu system in existing environment
- Secured environment
- Better system management
- Reduced downtime
- Vast online community support

Seeing the result and the success herein Ubuntu replaced the existing operating at our regional offices thereby giving brighter results with each new implementation.