Tuesday, November 14, 2006

Soft and Hard Links

Soft links

  • Pointers to programs, files, or directories located elsewhere.
  • If the original program, file, or directory is renamed, moved, or deleted, the soft link is broken.
  • If you type ls -F you can see which files are soft links because they end with @
  • To create a soft link called filelink.txt that points to a file called file.txt, use this: ln -s file.txt filelink.txt

Hard links

  • Pointers to programs and files, but NOT directories
  • If the original program or file is renamed, moved, or deleted, the hard link is NOT broken
  • Hard links cannot span disk drives, so you CANNOT have a hard link on /dev/hdb that refers to a program or file on /dev/hda
  • To create a hard link called hardlink.txt that points to a file called file.txt, use this: ln file.txt hardlink.txt
Hard and Soft Mounts in NFS

This is a UNIX terminology as to what the client does when it can't talk to an NFS Server. If you just mount a file system without specifying hard or soft, the default is a hard mount. Hard mounts are preferable because of the stateless nature of NFS. If a client sends an I/O request to the server (such as an ls -la), and the server gets rebooted, the client will wait until the server comes back on line. This preserves data transfers in the event of a server failure. There are disadvantages to this, as a simple mount request could hang. A soft mount will return with an error and fail. This kills the wait time, but can cause problems with data transfers.

Tuesday, September 12, 2006

How to import the public.gpg.key for yum
[root@midhun~]# yum update sendmail
Repository base already added, not adding again You have enabled checking of packages via GPG keys. This is a good thing.However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them.You can do that by running the command:
rpm --import public.gpg.key
Alternatively you can specify the url to the key you would like to usefor a repository in the 'gpgkey' option in a repository section and yum will install it for you. For more information contact your distribution or package provider.

When you get the above message, just import it from web (Here I am using CentOS) as shown below

[root@midhun ~]# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
MySQL Replication
1. Settings to be done in Master DB server:


Edit my.cnf file (/etc/my.cnf) and enter the following:
server-id = 1
log-bin

2. Login to mysql DB in master server and run the following command:
mysql> show master status;
Note down the following values: MASTER_LOG_FILE & MASTER_LOG_POS
Then give permission for the slave server
mysql>GRANT REPLICATION SLAVE ON *.* TO user@slave_IP IDENTIFIED BY 'password';
mysql>GRANT FILE ON *.* to user@ slave__IP identified by 'password';
3. Take the DB dump in master server and restore it in slave server.
4. Edit my.cnf file in slave server (/etc/my.cnf) and enter the following:
server-id = 2
master-host = Master_Server_IP
master-user = user
master-password = password
log-warnings
5. Login to mysql DB in slave server and run the following command:
mysql>CHANGE MASTER TO MASTER_HOST='Master_Server_IP', MASTER_USER='user',
MASTER_PASSWORD='password',
MASTER_LOG_FILE='Log filename',
MASTER_LOG_POS= number;
mysql>start slave;
6. Restart mysql service in both the servers.