Wednesday, May 9, 2007

NFS Server setting

Install NFS Server in Ubuntu

sudo apt-get install nfs-kernel-server nfs-common portmap

When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap using the following

sudo vi /etc/default/portmap

or use the following command

sudo dpkg-reconfigure portmap

Restart Portmap using the following command

sudo /etc/init.d/portmap restart

NFS Server Configuration

NFS exports from a server are controlled by the file /etc/exports. Each line begins with the absolute path of a directory to be exported, followed by a space-seperated list of allowed clients.

You need to edit the exports file using the following command

sudo vi /etc/exports

Here are some quick examples of what you could add to your /etc/exports

For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255

/files 192.168.1.1/24(rw,no_root_squash,async)

Or for Read Only from a single machine

/files 192.168.1.2 (ro,async)

save this file and exit

A client can be specified either by name or IP address. Wildcards (*) are allowed in names, as are netmasks (e.g. /24) following IP addresses, but should usually be avoided for security reasons.

A client specification may be followed by a set of options, in parenthesis. It is important not to leave any space between the last client specification character and the opening parenthesis, since spaces are intrepreted as client seperators.

Now you need to restart NFS server using the following command

sudo /etc/init.d/nfs-kernel-server restart

If you make changes to /etc/exports on a running NFS server, you can make these changes effective by issuing the command

sudo exportfs -a

Install NFS client support in Ubuntu

sudo apt-get install portmap nfs-common

This will install all the required packages for nfs client

Mounting manually

Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server

The mount point /files must first exist on the client machine.

Create files directory using the following command

sudo mkdir files

You need to mount the share using the following command

sudo mount server.mydomain.com:/files /files

Now you may need to restart services using the following command

sudo /etc/init.d/portmap restart

sudo /etc/init.d/nfs-common restart

Mounting at boot using /etc/fstab

If you want to mount using fstab file

sudo vi /etc/fstab

In this example my /etc/fstab was like this

server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr

Change “servername.mydomain.com:/files”, and “/files” to match your server name,share name, and the name of the mount point you created.

Testing Your Configuration

Use the following command in terminal to test

mount /files

the mount point /files will be mounted from the server.

Unison to replace rsync

From the experience I'm facing memory problem with rsync. So need to try Unison as an option.

Below is the Unison in brief or you can go to the unison file synchronizer to learn more

Unison, a free cross-platform file synchronization program, can not only provide you with multiple backups of your files, but more importantly, grant you the freedom to simultaneously use different computers with access to all of your files, thus liberating you from the confines of one particular machine. Unison allows you to access the same set of files from any computer (running Mac OS X, Windows XP, or UNIX/Linux variants) and keeps these files up-to-date by always maintaining the most recently-modified version of each file during synchronization. I personally use Unison to keep replicas of all of my personal files across several different computers. Because my documents and configuration files are accessible from every computer, I am free to use whichever one is the most convenient at the moment without the hassle of transferring files using floppy disks, USB drives, or email.

Setting up your Unison profile:

On the computer where you are invoking Unison, it looks for a profile located in the ~/.unison/ directory to know which two locations (called roots) to synchronize and which options to invoke Unison with. I have one common profile named common.prf with properties that are shared by all profiles:

# Helps out a lot on Windows
fastcheck = true

# place new files at the top of the list
sortnewfirst = true

# turn on ssh compression
rshargs = -C

ignore = Name Thumbs.db
ignore = Name *~
ignore = Name *.tmp
Among other things, this common profile tells Unison to perform a fast file name/date check for Windows (which greatly speeds up performance) and ignore certain temporary and useless files. Every profile I set up will include this one. Here is an example of a simple profile named simple.prf:
include common

root = /home/pgbovine/my-unison-root
root = ssh://pgbovine@some.fileserver.com//home/pgbovine/my-unison-root
directory for a profile named parameters are very important. These are the two locations that Unison is trying to synchronize between. In this case, the first root is the When I invoke Unison with the command unison simple, it looks in the ~/.unison/simple.prf and virtually appends all of the options listed in that profile onto the command-line when invoking Unison. The two rootmy-unison-root directory on my computer (where all of my data is stored), and the second root is the same directory on a remote file server (which must also be able to run Unison 2.9.1).

Wednesday, April 25, 2007

Clone server with rsync

boot server from cd

--Backup existing boot directory to temp if exist
#mv /boot /boot_tmp
#mkdir /boot
#mount /dev/sda1 /boot

--Install the boot loader to /dev/sda1 mounted as /boot
--Umount /dev/sda1 and format sda1 if grup exist before doing grup-install
#grub-install --root-directory=/ /dev/sda

--Change device map during boot from "/dev/sda" to "/dev/hda"
#vim /boot/grub/device.map

--Check the grup exist
#ls /boot
grub lost+found


--Set new server as rsync server
--Edit rsync new server configuration file
#vim /etc/defaul/rsync
ubah ke RSYNC_ENABLE=true

# vim /etc/rsyncd.conf
edit :
[boot]
path= /mnt/sda1
uid=root
read only= no

--restart rsync new server
# /etc/init.d/rsync restart

# ssh [remote ubuntu machine -master]
# sudo -s
# rsync -avr /boot/ rsync://192.168.20.211/boot


sda2
#mkdir /mnt/sda2
#mount /dev/sda2 /mnt/sda2
//server secondary [copy]
#vim /etc/defaul/rsync
ubah ke RSYNC_ENABLE=true

# vim /etc/rsyncd.conf
edit :
[sda2]
path= /mnt/sda2
uid=root
read only= no

--connect to old server using ssh
# /etc/init.d/rsync restart
# ssh [remote ubuntu old server]

--Issue command to rsync from old server
# rsync -avr / rsync://192.168.20.211/sda2

--At new server
--To list eth HWAddr to be replace in iftab
# ifconfig


eth0 Link encap:Ethernet HWaddr 00:10:18:27:BC:52
inet6 addr: fe80::210:18ff:fe27:bc52/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4175 errors:0 dropped:0 overruns:0 frame:0
TX packets:508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:610013 (595.7 KiB) TX bytes:174184 (170.1 KiB)
Interrupt:169

eth1 Link encap:Ethernet HWaddr 00:18:8B:7A:5F:2C
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:177

eth2 Link encap:Ethernet HWaddr 00:13:46:3C:08:64
inet addr:192.168.20.213 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::213:46ff:fe3c:864/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1460604 errors:0 dropped:0 overruns:0 frame:0
TX packets:696129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1989609400 (1.8 GiB) TX bytes:50333834 (48.0 MiB)
Interrupt:58 Base address:0x2f00

lo Link encap:Local Loopback
inet addr: 127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1608 errors:0 dropped:0 overruns:0 frame:0
TX packets:1608 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:80400 (78.5 KiB) TX bytes:80400 (78.5 KiB)

--Change new HWaddr at new server
#vim /mnt/sda2/etc/iftab

--Change new ip address at new server
#vi /mnt/sda2/etc/network/interfaces


--check mount point at new server
# vi /mnt/sda2/etc/fstab
reboot.

Whould work now

Install Oracle 10g on Ubuntu

1.Complete instruction to install Oracle 10g on Ubuntu.
2. Oracle xpres on Ubuntu
3.Happy learning.

Ubuntu Installation screen

1.Happy learning to install Ubuntu.