Wednesday, June 16, 2010

Install and configure munin for Server Monitoring

Munin is an efficient and lightweight Monitoring tool. Its available in ’server’ and ‘node’ packages. You can install server in a single machine and node in all other machines and then view all information/statistical data in server machine.
This quick copy and paste howto explains steps needed to setup server and multiple nodes. These steps are tested in CentOS 5.X Server.

Step 1. Prepare Server machine. For quick installation and dependency resolution, you can install DAG repository:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.elX.rf.i386.rpm
Step 2. Install munin (server) and munin-node (node) on this machine:
# yum install munin munin-node
Step 3. Setup a directory to store munin generated htmls, you can create a directory in your server DocumentRoot or in munin directory itself. Here we create it in munin’s directory:
# cd /etc/munin
# mkdir html
# chown munin:munin html -R
Step 4. If in previous step, you created a directory in your web server root, then you dont need to set an alias, else if you did the exact whats written in above step, create an alias:
# vi /etc/httpd/conf/httpd.conf
—–
Alias /server-health/ “/etc/munin/html/”

AllowOverride None
Options None
Order allow,deny
Allow from all

—–
Step 5. Configure munin for monitoring localhost (you are already in /etc/munin directory):
# vi munin.conf
—-
htmldir /etc/munin/html
[localhost]
address 127.0.0.1
use_node_name yes
—-
here we set the html directory and section for local machine. Feel free to change ‘localhost’ to any meaningful name like Monitoring Server etc. You can further read the file for more options.
Step 6. Start munin service:
# chkconfig munin-node on
# service munin-node start
Step 7. Restart your web server and then access the munin page from your browser by pointing it to http://localhost/server-health/. You can also password protect the munin page by using .htaccess or inserting rules in your httpd.conf file but its optional.
You should be able to view various parameters/values/trends related to disk,network,apache,mail etc of your local machine/server via browser. Let us configure multiple nodes now:
Step 8. SSH to any other machine/ server and install DAG repository as described in Step 1 and then install the munin node:
# yum install munin-node
Step 10. Configure the node to allow our main server get input from this machine. For this purpose, we need to add ‘Allow IP ADDRESS’ line in config file. Note that there’s already a Allow line which allow localhost to get values, we just need to add another line for server:
# vi /etc/munin/munin-node.conf

allow ^192\.168\.0\.1$

Here 192.168.0.1 (change it as per your settings) is the IP of server machine, written in regex form which is required here.
Step 11. Start the node now:
# chkconfig munin-node on
# service munin-node start
Now configure the Server to monitor the above machine:
Step 12. Goto Server machine and update munin.conf and add a new section:
# vi /etc/munin.conf

[App_Server]
address 192.168.0.5
use_node_name yes

Here, App_Server is the name (you can write any), and 192.168.0.5 is the IP address of the machine in which we configured munin-node in Step 9 to Step 11.
After a while, Check you browser and munin should include the update from node machine.

Wednesday, June 9, 2010

Chmod Command

Following are the symbolic representation of three different roles:

■u is for user,
■g is for group,
■and o is for others.
Following are the symbolic representation of three different permissions:

■r is for read permission,
■w is for write permission,
■x is for execute permission.
Following are few examples on how to use the symbolic representation on chmod.

1. Add single permission to a file/directory
Changing permission to a single set. + symbol means adding permission. For example, do the following to give execute permission for the user irrespective of anything else:

$ chmod u+x filename2. Add multiple permission to a file/directory
Use comma to separate the multiple permission sets as shown below.

$ chmod u+r,g+x filename3. Remove permission from a file/directory
Following example removes read and write permission for the user.

$ chmod u-rx filename4. Change permission for all roles on a file/directory
Following example assigns execute privilege to user, group and others (basically anybody can execute this file).

$ chmod a+x filename5. Make permission for a file same as another file (using reference)
If you want to change a file permission same as another file, use the reference option as shown below. In this example, file2’s permission will be set exactly same as file1’s permission.

$ chmod --reference=file1 file26. Apply the permission to all the files under a directory recursively
Use option -R to change the permission recursively as shown below.

$ chmod -R 755 directory-name/7. Change execute permission only on the directories (files are not affected)
On a particular directory if you have multiple sub-directories and files, the following command will assign execute permission only to all the sub-directories in the current directory (not the files in the current directory).

$ chmod u+X *

Friday, May 28, 2010

RHEV for Servers 2.2 Installation and Administrator

RHEV Manager acts as a centralized management system that allows system administrators to view and manage virtual machines and images. Red Hat Enterprise Virtualization Manager provides a comprehensive range of features including
 search capabilities,
 resource management,
 live migrations,
 Provisioning.

Features RHEV- Hypervisor

Red Hat Enterprise Virtualization Hypervisor (RHEV Hypervisor) is a thin virtualization layer deployed across the server infrastructure. It is based on the Kernel-based Virtualization Machine  (KVM), which is a core component of the Linux kernel.
High performance
Proven stability
Huge list of supported hardware (HBAs, SAN, NICs etc)
Linux Kernel mainstream support for KVM
Can be auto-updated using RHEV-M






Pre requisites

A client with Windows XP and .NET Framework 3.1 with Service Pack 1 is required to access the
  web-based administration portal. The web-based administration portal can be used as an alternative  to the administration portal available on the RHEV Manager server.
• One or more physical servers to act as the Red Hat Enterprise Virtualization Hypervisors or Red Hat Enterprise Linux Hosts, each with:
  • Hardware virtualization support:
    a. AMD system with AMD-V enabled in the BIOS and AMD64 CPU extension; or
    b. Intel system with Intel VT enabled in the BIOS and Intel 64 CPU extensions.
  • Minimum 512MB of RAM.
  • Minimum 512MB of additional RAM for each virtual machine. The amount of RAM allocated to
    each virtual machine is dependent on the guest operating system.
  • Minimum 750MB storage for installation of the Hypervisor on hard disk drive, plus additional
    storage for swap. Refer to Red Hat Knowledgebase for more information on recommended swap sizes.
  • Ensure that all Hypervisor or host servers to be used within a single cluster have the same CPU  type. This enables virtual machines to reside on any host within the cluster and to be migrated  between hosts. For further information.
• One server to act as the Red Hat Enterprise Virtualization Manager, with:
  • Minimum 1 GB of memory.
  • Minimum 20 GB of local disk space.
• Server to provide storage for virtual machine and ISO images. Storage networking can be
  implemented using Network File System (NFS), Internet Small Computer System Interface (iSCSI)  or Fibre Channel Protocol (FCP).
• At least one network controller with a minimum bandwidth of 100 Mbps.

• Red Hat Enterprise Virtualization Hypervisor installation software; and/or
  A Red Hat Enterprise Linux 5.4 AMD64/Intel 64 system.
• Red Hat Enterprise Virtualization Manager installation software.
• Microsoft Windows Server 2003 (or R2) 32-bit edition, with:
  1. Windows Server 2003 Service Pack 2.
      It is possible to create installation media that has the Service Pack files integrated into
      the Windows Server 2003 installation folder. This allows the Service Pack to be installed
      simultaneously with the operating system. For instructions, refer to http://support.microsoft.com/
      kb/950349.
  2. Valid Microsoft Windows Server 2003 product key.
• The following Windows components:
  • Microsoft .NET Framework 3.5 Service Pack 1.
    Available from: http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-
    fdaa79a8ac3d/dotnetfx35.exe
  • Microsoft .NET Framework 3.5 Family Update for Windows Server 2003.
    Filename: NDP35SP1-KB958484-x86.exe
    Available from: http://www.microsoft.com/downloads/details.aspx?
    familyid=6c095bba-6100-4ec9-9c54-6450b0212565&displaylang=en&displaylang=en
  • Windows Power Shell 1.0
    Filename: WindowsServer2003-KB926139-v2-x86-ENU.exe
    Available from: http://www.microsoft.com/downloads/details.aspx?
    FamilyId=10EE29AF-7C3A-4057-8367-C9C1DAB6E2BF&displaylang=en
• Recommended utilities for transferring files between RHEV Manager and RHEV Hypervisor:
  • WinSCP: open source Secure Copy (SCP) client for Windows.
  • PuTTY: open source Secure Shell (SSH) client for Windows and Unix platforms.

On Linux NFS server for ISO
vdsm:kvm add user and group
# chkconfig nfs on
• Determine the NFS share directory. For example, if you intend to share /RHEV/Images, enter the
following line into the /etc/exports file.

/RHEV/Images *(rw,no_root_squash)

Restart the NFS service.

• The NFS export directory must be configured for read write access and must be owned by vdsm:kvm. If these users do not exist on your external NFS server use the following commands,
assuming that /RHEV/Images is the NFS share.
chown -R 36:36 /RHEV/Images
chmod g+s /exports/* -R
chmod u+s /exports/* -R

Installation









Managing



Installation RHEV hyper visor

The RHEV Manager's address is set
The RHEV Manager's port is set.

Enter the address of the NetConsole manager for remote console output.
Enter the NetConsole manager's hostname or IP address.
Optionally: append a port after the hostname or IP address
For example, 10.0.0.1:25285 or rhev.redhat.com:25285
If you are unsure, use the RHEV Manager's address, without a port.

a. Enter the NetConsole server and port. In most cases, this server will be the RHEV Manager.
   The NetConsole port is the same as the NetConsole port number specified during the
   installation of the RHEV Manager.
b. If the NetConsole server is successfully found, the following output is displayed before being
   returned to the configuration menu:
   The NetConsole manager address is set.
   The NetConsole manager port is set.
         Installation
Once all the previous steps are complete, the RHEV Hypervisor can be installed to the local storage device.
Storage, networking and the RHEV Manager must be configured before continuing.
1.  Select Install locally and reboot from the Hypervisor Configuration Menu.

2.  This option exits the menu and requires a reboot.
     Ensure local storage and networking is configured
     correctly on the previous menu before continuing.
     The current kernel boot parameters are
     crashkernel=128M@16M elevator=deadline processor.max_cstate=1
     Enter additional kernel boot parameters (press Enter to use the present  arguments):
     Press Enter to continue.
3.  Do you wish to continue (Y/n)?
     Press Y to continue.
The final installation sequence begins. Once the installation is complete the RHEV Hypervisor will
reboot. After rebooting, the RHEV Hypervisor is installed and integrated with Red Hat Enterprise Virtualization Manager for Servers. You should have a new host available in the Red Hat Enterprise Virtualization Manager interface.




















Features RHEV- Manager

Copyright (c) by Red Hat, Inc. This material may be distributed only subject to the terms and conditions set
forth in the Open Publication License, v1.0 or later (available at http://www.opencontent.org/openpub/).