NATIONAL POPULATION REGISTER (NPR) Project Name: NPR Version No: 1.0.0 Release Date: Group Name: NPR-ECIL Version Date: LINUX SERVER INSTALLATION AND CONFIGURATION FOR JAVA BASED NPR DATAENTRY SOFTWARE HYDERABAD - 500062 COPYWRITE 2011 ECIL All rights reserved. No part of this document may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, photocopying, scanning, without the prior written permission of the proprietors.
DOCUMENT STATUS SHEET 01. DOCUMENT TITLE NPR DATA ENTRY MODULE CLIENT SERVER EDITION INSTALLATION MANUAL 02. DOCUMENT REFERENCE NUMBER ECIL/NPR/BDESER/CSE/01 03. REVISION Version 1.0.0 04. DATE February 2011 05. REASONS FOR CHANGE First Issue DCR No. DATE DOCUMENT CHANGE RECORD ORIGINATOR APPROVED BY NPR TEAM ECIL 1. DOCUMENT REFERENCE No. 2. DOCUMENT ISSUE/REVISION No. 1.0 3. PAGE 4. PARAGRAPH 5. REASONS FOR CHANGE Page 2
Purpose BDE Linux Server Installation Guidelines 2011 This document is intended to establish guidelines for how all Linux servers should be installed for NPR DATA CENTER. This document is not intended to be a "checklist" like the Windows 2000 Installation checklist document because Linux installations are not as "standardized" as the Windows 2000 installations are. Linux installations tend to be customized to the application they are meant to run. Pre-Requisites This document assumes the following prerequisites 1. Red Hat Enterprise Linux Advanced Server 64 bit Version 5 or higher. 2. External RAID configured with 1+0 or 5 tuned on Database write operations with optimum blocks and stripe sizes. 3. High end QUAD Core Xeon 3 GHz or higher CPU based Server with Minimum 8GB RAM. 4. Two Hard drives in the Server to install the Operating System with a Capacity of minimum 60 GB configured as RAID 1, Mirroring for the O.S Disks. Page 3
INDEX Table of Contents 1. Installation Steps 5 a. Filesystem setup and Disk Partitioning 5 b. Custom Software/Applications Selection 6 2. Custom System Configurations 7 a. Services 7 b. Running the Server in Optimized, No Desktop/Graphics Load 8 c. Security Configuration 9 3. External Raid and Storage Partitioning 9 a. Creating Partitions, Format the External Storage 10 and Mounting the File Systems: b. Formatting the File Systems: 11 c. Auto mount, enabling the permanent configuration for Storage : 12 d. Creating npruser in the Server 12 e. data and /database configuration 12 4. Configuring NFS Server 14 5. Configuring NFS share on NPR-DEP Management Node 15 6. Database Master table population and user creation by the DBA 15 7. Database Naming Convention and user Privileges 15 Page 4
1. Installation Steps Insert RHEL 5 CD and reboot the system. Select English and press next. Enter the installation number if exist else select skip entering installation number and press OK. Select custom layout in the drop down box and click next. Click on new option. A partition window appears. Partition the disk as below given details. a. Filesystem setup and Disk Partitioning Use ext3 for the file system type. Ext3 is backward compatible with ext2, but supports journaling. A typical partition table would look like: <swap> Double the Size of RAM or 32GB Maximum. / Fill up to maximum size for this partition. The above sizes are general estimates. While it is possible to have Linux installed on smaller (and fewer) partitions, bigger is always better. Note that the swap partition must have the filesystem type set to "linux-swap". It is ideal to have a /boot partition up to max of 100MB in case O.S Mirror is not available. Click on next. Set the Hostname as ActiveServer for Active server and Passive Server for Passive server, edit the IP Configuration GUI, select manual configuration and allot the IP address as 16.0.0.254 for Active Server and 16.0.0.253 for Passive Servers. Click next. Select the time zone region Asia/Kolkata, uncheck UTC Time and Click next. Page 5
b. Custom Software/Applications Selection Set the root password, and add at least 1 user account. Click Customize now Option and Select the "Select Individual Packages" option. The next screen will allow you to pick individual packages. Sometimes it helps to switch from Tree View to Flat View. Select the Packages as given below Desktop Environment Select only Gnome, Desktop environment, others not allowed. Applications uncheck all the boxes (don t select anything from this). Development uncheck all boxes (don t select anything from this). Servers Select only mysql database, others must be unselected. Base systems Select Administrator tools and select Base, system tools and X window System. Language uncheck all (don t select anything from this). Click next. The setup will install the packages and Reboot the system. Welcome Screen Appears on reboot. Click Forward. Check the option yes, I agree and click forward. Click firewall as enabled and check SSH. Click yes and Add ports Port no: 3306 Tcp/ip Port no: 3306 Udp. Click Forward. Page 6
Select Selinux setting as Enforcing. Kdump option must be disabled. Select and set the date and time properly. Click next. In the Setup software updates menu, Select no and click forward. Click on No thanks, I ll connect later. Click on Finish updates setup and click Forward. User creation window appears. Enter the following Details Username: sysadmin Fullname: System Administrator Password: npr123 Confirm password: npr123 Sound card window appears. Click on forward. Additional cd s window appears. Click Finish. 2. Custom System Configurations a. Services Most of the server configuration can be done through "setup" at the command prompt. If X (or X-forwarding) is running, there are GUI control Panels as well. Type "redhat" followed by TAB twice at the command prompt to see a list of config scripts. "serviceconf" is a Windows-style GUI program that lets you set what daemons start at bootup. It also lets you stop/start/restart daemons. The "service" command also lets you do this at the command prompt. Page 7
Open the terminal login as su #prompt run the command #serviceconf Or Go to Administration->Server Settings-> Services Services Configuration GUI is displayed Turn off all other unnecessary daemons. Daemons that can be left running for system functionality include the following only: Network Manager acpid anacron apmdv atd auditd autofs cpuspeed crond gpm haldaemon sshd irqbalance messagebus microcode.ctl mysqld netfs nfslock nfs network portmap readahead_early readahead_later restorecond rpcgssd rpcidmapd rpcsvcgssd syslog xinetd Note : iptables is disabled temporarily and will be enabled when the application software is stabilized. b. Running the Server in Optimized, No Desktop/Graphics Load. Login as root after welcome menu completes edit the /etc/inittab file and change the following line using vi editor or any favorite editor open the terminal login as su #prompt enter the following command #vi /etc/inittab from: to: id:5:initdefault: id:3:initdefault: Page 8
save the file and reboot the system after reboot console display is seen with login prompt is seen, no graphical screen is allowed for the Server to reduce the additional CPU load for the graphical Desktop and other GUI Components, administrator can always login to init 5 mode for maintenance tasks. c. Security Configuration Firewall: Firewall must be enabled ant must allow the trusted ports only for SSH and NFS. Optional SCP Port must be allowed only from NPR-DEP Management Node. SELinux : SE Linux setting must be enabled on the Server. Note: Temporarily disable the firewall and SeLinux on the Server and can be added at a later stage along with the other full security measures. 3. External Raid and Storage Partitioning: Two Partitions named as /data and /database must be created on the external common Storage device connected to both the Active and Passive Servers. /data used as NFS Share to mount logically on all the Nodes, used for storing the tiff images and taking database backups and restores. /database used as the data dir to RDBMS for populating the data, as the records created by the data entry consoles must be populated in this directory. Data Sizing Calculation to Create Storage Partitions: /data approximate Sizing Calculation is described No. Of Records in the Tiff Image = 200 Size of each Tiff Image = 20MB Data Center Target Population = 1 Cr records Approximate size required = 102 KB Per record x 1 Cr records = 1 TB. /database approximate sizing calculation for the records populated from data entry consoles. Page 9
Size per record including (IRIS + Biometric) Data Center Target Population = 5MB = 1 Cr records Approximate size required = 5MB Per record x 1 Cr records = 52 TB. a. Creating Partitions, Format the External Storage and Mounting the File Systems: Note: Important Note to the audience who performs partition and Formatting on the Storage, please carefully identify the storage device which needs to be partitioned and formatted any wrong interpretation on identification of the storage will cause data loss and is unrecoverable in any case, please be careful in using the below commands to identify the target device. Creating Partition is mandatory and important for any storage device before formatting the storage. Partition is an Index to the File System on the Storage. Partition can be created using the Linux command fdisk. Step 1: open the terminal and login as root, enter su and enter the root password In the #prompt enter the following commands fdisk -l fdisk /dev/sdx where sdx must be replaced with the external storage device connected and identified by the system. enter n (to add a new partition) enter p (to create primary partition) enter the size as calculated for /data enter t (to change the partition type) enter fd (to change to Linux Auto raid Partition type) enter w (to save and write the settings) Page 10
reboot the system and create the second partition repeat the above steps and enter the size as calculated /database partition and again reboot the system. b. Formatting the File Systems: After completion of storage partitioning, it is the time to format the partition and create file systems on the storage. For formatting Linux supports different types of file systems but choose ext3 file system and format the storage using the commands. First Identify the partitions created earlier using the command fdisk -l /dev/sdx it must display two partitions created as per the above steps. Now format the two partitions using the commands mkfs.ext3 /dev/sdx1 for partition1 mkfs.ext3 /dev/sdx2 for partition 2 The above commands will take a moment of time based on the storage capacity, please wait till the storage formatting completes. Now it is the time to mount the file systems, create two directories named /data and /database using the commands mkdir p /data mkdir p /database mount the file systems using the commands mount /dev/sdx1 /data mount /dev/sdx2 /database Note : mount data and database as per the storage sizing calculated. To Check the mount points and disk space use the command df -h it must display /dev/sdx1 mounted with N capacity on /data /dev/sdx2 mounted with N capacity on /database Page 11
c. Auto mount, enabling the permanent configuration for Storage : To save the settings permanently edit the file /etc/fstab using vi or any favorite editors. Go to end of file and add the following lines /dev/sdx1 ext3 defaults 1 2 /data /dev/sdx2 ext3 defaults 1 2 /database Save the file and reboot the system, run the df command after reboot and can see the /data, /database partitions mounted automatically. d. Creating npruser in the Server: First user sysadmin must be created in the welcome screen as described above and create second user as npruser using the below commands, login as su #prompt. #useradd npruser #passwd npruser Enter the password as npr123 If anything required to remove the user enter the command. #userdel r username e. /data and /database configuration As it was already described that /data and /database partitions are used for storing TIFF images and data population, administrator must create directory structures for both the directories, open the terminal and login as root using su to get the #prompt. /data configuration : this partition must be exported as a logical drive to all the nodes on the network using NFS Protocol, to configure go to /data folder. First create share folder in data like #cd /data #mkdir share; #cd share; #mkdir appconfig tiffimages backups restores inputs Page 12
the above command will create 5 directories as named above and the detailed information regarding this is available in Datacenter Manual. /database configuration : this partition is meant for data population entered by the data entry operators thru the application package. Certain hierarchy must be followed for an ease of identification and maintenance operations, backups etc. performed by the Data base Administrator. To configure go /database folder #cd /database #mkdir mysql; #cd mysql; #mkdir data tmp log mysql can be replaced with any other database based on the project requirements. Edit the mysql global settings configuration file in with any favorite editor. Open the file /etc/my.cnf, Change datadir path to /database/mysql/data At later stage log and tmpdir must be added to /database partition Consult the DBA for anymore further optimizations requires. The following optimization and settings must be added in the my.cnf file [mysqld] lower_case_table_names=1 Granting Permissions /data and /database : Appropriate permissions and owner ship must be provided to /data and /database folders, login as su #prompt in the terminal and run the below commands. #chown R npruser.mysql /database #chown R npruser.mysql /data #chmod R 770 /database #chmod R 770 /data Page 13
4. Configuring NFS Server Network File System is a Protocol which logically shares/exports the file system on the Server to all the clients connected in the Network. in our case /data is the exported file system which needs to be logically shared over the network. To create a logical share over network open the terminal and login as su #prompt Edit the file /etc/exports using any favorite editor and enter the following. /data/share *.*(ro,sync) 16.0.0.252,16.0.0.253,16.0.0.254(rw,sync) Only the management node and Servers must have the read/write access to the share, rest all the other nodes must view the /data/share as read only, after editing run the commands. #exportfs -a #service nfs restart Checking Share on the Server It is also required to mount the NFS share in the server to take backup and restore tasks thru the application to do this copy the S98nfs from any of the client into the server folder /etc/rc3.d. Edit the file /etc/rc3.d/s98nfs and change the string ro to rw and save the file. Run the command #mkdir p /sharenfs #/etc/rc3.d/s98nfs #df -h Observe that /data/share is mounted as /sharenfs in the server also. Reboot the server and run the command df h Observe that /data /database and /sharenfs are mounted automatically in the init 3 and init 5 modes. Page 14
5. Configuring NFS share on NPR-DEP Management Node Nodes which are identified for Read/Write access to the share must be configured using the following commands, edit the file /etc/rc5.d/s98nfs change the string ro to rw Reboot the system and verify the /sharenfs is mounted with read/write access using the commands #df -h #cd /sharenfs #touch backups/j Note : Only NPR-DEP Management and few Administrator Nodes were identified for read/write access, Caution to the Administrator that the changes to S98nfs are allowed after installing NPR-DEP application and few selected Nodes are allowed for read/write don t try change to rw access if not required. 6. Database Master table population and user creation by the DBA Now it is time to handover the system to DBA to, 1. Create the database users/supervisors and administrators. 2. Granting the privileges to the database users. 3. Creating the database and structures. 4. Updating the master tables and other application related tables into the database. 5. Tuning the database parameters and other configuration parameters as per the data center requirements. : : 7. Database Naming Convention and user Privileges It is a mandatory instruction to the DBA and others to follow the naming convention and create database name as the following Nprdb statecode datacentercode nprdbdddd; dd = two digits; follow 2 digits convention for state code & data center code : Page 15
for example : state code is 34 and data center code is 23 then the database name must be as, if single digit codes then prefix 0 to the code, if state code 2 and data center code is 9 then nprdb3423 nprdb0209 Three users named npradm, nprsup, nprdeo must be created by the DBA with appropriate grants to the users npradm : used by the data entry application administrators, for creating supervisors, data entry operators, backup/restore tasks etc. full privileges to the user. nprsup : used by the data entry application supervisors, for managing data entry operators, quality check etc, full privileges to the user. nprdeo : used by the data entry operators to populate the data entered by the operators partial privileges to user(update/select/insert). END OF DOCUMENT Page 16