Sunday, October 19, 2008

Performance Monitoring

Install performance monitoring tools.

yum install sysstat


Network Performace

sar -n DEV 10 1000


CPUs Performance

mpstat 2 -P ALL


Overview Hardware

lspci

Tuesday, June 17, 2008

How to backup MySQL databases

1. create /backup directory
2. create startbackup.sh script file:

rm -f /backup/mysql*
### System Setup ###
BACKUP=/backup
NOW=$(date +"%d-%m-%Y")

### MySQL Setup ###
MUSER="mysqluser"
MPASS="password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
GZIP="$(which gzip)"


### Start MySQL Backup ###
# Get all databases name
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BACKUP/mysql-$db.$NOW-$(date +"%T").gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done

Tuesday, February 19, 2008

How to Disable SELinux

Temporarily switch off enforcement

echo 0 >/selinux/enforce


Permanently Permissive

just change SELINUX=enforcing to SELINUX=permissive in file /etc/selinux/config, and you're done. Reboot if you want to prove it.

Wednesday, February 13, 2008

RHEL / CentOS Support 4GB or more RAM ( memory )

RHEL / CentOS Support 4GB or more RAM ( memory )
If you have 4 GB or more RAM use the Linux kernel compiled for PAE capable machines. Your machine may not show up total 4GB ram. All you have to do is install PAE kernel package.

This package includes a version of the Linux kernel with support for up to 64GB of high memory. It requires a CPU with Physical Address Extensions (PAE).
The non-PAE kernel can only address up to 4GB of memory. Install the kernel-PAE package if your machine has more than 4GB of memory (>=4GB).

How Do I Install PAE kernel?
To install PAE kernel, use yum command:

# yum install kernel-PAE


Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kernel-PAE to pack into transaction set.
kernel-PAE-2.6.18-53.1.13 100% |=========================| 259 kB 00:01
---> Package kernel-PAE.i686 0:2.6.18-53.1.13.el5 set to be installed
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel-PAE i686 2.6.18-53.1.13.el5 updates 13 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 13 M
Is this ok [y/N]:
Downloading Packages:
(1/1): kernel-PAE-2.6.18- 100% |=========================| 13 MB 00:10
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: kernel-PAE ######################### [1/1]

Installed: kernel-PAE.i686 0:2.6.18-53.1.13.el5
Complete!

Just reboot the server and make sure you boot with PAE kernel i.e. 2.6.18-53.1.13.el5:
# reboot

Tuesday, January 29, 2008

nfs warning: mount version older than kernel

or you can not mount nfs, when yo try mount nfs, you recieve error:
root@bacula ~]# mount 10.119.238.100:/VOLUME1/BACULA/ /smartstor
mount: wrong fs type, bad option, bad superblock on 10.119.238.100:/VOLUME1/BACULA/,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


first, you must install nfs service
yum install nfs-utils
check it included portmap
/etc/rc.d/init.d/portmap start
then retry mount.

Thursday, January 10, 2008

Caching-Nameserver

Caching-Nameserver is a type of nameserver that will resolve a web addresses (domain names) from its next or master DNS, and will keep those entries in cache, after first time resolution it will resolve DNS queries locally, untill its TTL (Time To Live) is expired.
BIND 9 is used to resolve domain resolution queries from it own database, as it is SOA (Start Of Authority).
So now it is clear that in our setup the caching-nameserver will be used to resolve domain names externally (internet), while BIND 9 will be used to resolve domain names from our local network (internally).

install packages
yum -y install bind bind-chroot caching-nameserver

start service
service named restart

set autostart
chkconfig named on