December 17, 2009

Part 3 of the 5 part series on the step by step installation post focuses on installing the Sybase software. Part 1 has a list and links to the download pages for this software.

The 5 parts of this series are:

The instructions designed that non-Sybase DBA can perform these tasks. Sybase DBA will find that the steps are very similar to your standard ASE installation.

Read how to setup the Linux environment.

Sybase Software Installation

System preparation

Sybase uses a system SySAM to manage the licensing. This is no important during the installation process. The server will start with a temporary licenses, but if this step gets omitted the server will all a sudden stop working.

Please follow the SySAM installation steps in the installation guide.

User Account Setup

Before installing the software into the NFS share $SYBASE make sure that both nodes asece1 and asece2 have the user sybase and the group sybase added to the user accounts. This is important to manage the NFS shares. For simplicity add the sybase user the NFS server asecenfs too.

groupadd sybase
useradd -u 1000 -g sybase sybase
passwd sybase

This is the .bashrc of the sybase user.

# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg
test -s ~/.alias && . ~/.alias || true
export SYBASE=/sybase
. $SYBASE/SYBASE.sh

Network Setup

To make it easier to navigate through all these settings a simple naming and network address pattern has been chosen. Nothing fancy, but it does the trick.

asece1:
hostname: asece1.localhost.org
IP Address eth0: 192.168.1.211 (public address)
Default Gateway eth0: 192.168.1.1 (public address)
IP Address eth1: 192.168.2.211 (primary private address)
Default Gateway eth1: none
IP Address eth2: 192.168.3.211 (secondary private address)
Default Gateway eth2: none
asece2:
hostname: asece2.localhost.org
IP Address eth0: 192.168.1.212 (public address)
Default Gateway eth0: 192.168.1.1 (public address)
IP Address eth1: 192.168.2.212 (primary private address)
Default Gateway eth1: none
IP Address eth2: 192.168.3.212 (secondary private address)
Default Gateway eth2: none

It is important to include both nodes, plus the nfs server in all /etc/hosts files. You must also configure the public, primary private and secondary private ip address space.

The /etc/hosts file looks like this:

#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
# Public IP Addresses
192.168.1.210 asecenfs.localhost.org asecenfs
192.168.1.211 asece1.localhost.org asece1
192.168.1.212 asece2.localhost.org asece2
# Primary Private Network
192.168.2.211 asece1-ppriv.localhost.org asece1-ppriv
192.168.2.212 asece2-ppriv.localhost.org asece2-ppriv
# Secondary Private Network
192.168.3.211 asece1-spriv.localhost.org asece1-spriv
192.168.3.212 asece2-spriv.localhost.org asece2-spriv

NFS setup

The NFS configuration enables sharing the files between the nodes. For test purposes one of the nodes could have been used as the NFS server, but this would not be a close to reality scenario. Having a dedicated NFS server is just good practice. A better practice would be a clustered NFS server, but that’s overkill for this purpose.

This is the NFS configuration for the Sybase Cluster Edition test configuration:

On the NFS server the shared directories for the files need to be created.

mkdir /sybase

Add the following lines to the /etc/exports file.

/sybase *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Start the NFS services on the NFS server.

/sbin/chkconfig nfs on
/sbin/service nfs restart

This is very important. Because of the VMware environment the NFS setup is not very stable. At least not on my system. Before starting the Sybase nodes, the status of the NFS server has to be confirmed. Executing the commands above on the NFS server will prevent data corruption on one of the Sybase nodes due to a NFS issue.

On each Sybase nodes, asece1 and asece2 the local folder structure has to be established and stamped with the correct user permissions.

mkdir -p /sybase
chown -R sybase:sybase /sybase

On each Sybase nodes, asece1 and asece2, add the following lines to the /etc/fstab file to automatically mount the NFS shares.

asecenfs:/sybase /sybase nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 0 0

To get immediate access to the NFS shares without rebooting the nodes, manually mount the NFS shares on both servers.

mount /sybase

Raw Device Setup

In this setup 8 raw devices are created.

/dev/sdb master device 300 Mb
/dev/sdc quorum device 20 Gb
/dev/sdd data device 10 Gb
/dev/sde sybsystemprocs device 200 Mb
/dev/sdf system device 100 Mb
/dev/sdg sysmgmt device 200 Mb
/dev/sdh tempdb asece1 1 Gb
/dev/sdi tempdb asece2 1 Gb

For all 8 (sdb – sdi) devices repeat the following fdisk command sequence. Run this command on asece1 only. When following the example simply replace the device name.

asece1:~ # fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-200, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-200, default 200):
Using default value 200
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
asece1:~ #

Add the following entries into the file /etc/raw at both nodes asece1 and asece2.

asece1:/etc # cat raw
# /etc/raw
#
# sample configuration to bind raw devices
# to block devices
#
# The format of this file is:
# raw<N>:<blockdev>
#
# example:
# ---------
# raw1:hdb1
#
# this means: bind /dev/raw/raw1 to /dev/hdb1
#
# ...
raw1:sdb1
raw2:sdc1
raw3:sdd1
raw4:sde1
raw5:sdf1
raw6:sdg1
raw7:sdh1
raw8:sdi1
asece1:/etc #

Execute the command below to create the raw devices at both nodes asece1 and asece2.

asece1:/etc # cd /etc/init.d
asece1:/etc/init.d # sh raw start
bind /dev/raw/raw1 to /dev/sdb1... done
bind /dev/raw/raw2 to /dev/sdc1... done
bind /dev/raw/raw3 to /dev/sdd1... done
bind /dev/raw/raw4 to /dev/sde1... done
bind /dev/raw/raw5 to /dev/sdf1... done
bind /dev/raw/raw6 to /dev/sdg1... done
bind /dev/raw/raw7 to /dev/sdh1... done
bind /dev/raw/raw8 to /dev/sdi1... done
asece1:/etc/init.d # /sbin/chkconfig raw on
asece1:/etc/init.d #

Make sure that the user sybase owns the raw devices at both nodes asece1 and asece2.

asece1:/etc/init.d # cd /dev/raw
asece1:/dev/raw # chown sybase raw[1-8]
asece1:/dev/raw # ls -al
total 0
drwxr-xr-x 2 root root 200 Nov 25 13:56 .
drwxr-xr-x 10 root root 7320 Nov 25 13:56 ..
crw-rw---- 1 sybase disk 162, 1 Nov 25 13:56 raw1
crw-rw---- 1 sybase disk 162, 2 Nov 25 13:56 raw2
crw-rw---- 1 sybase disk 162, 3 Nov 25 13:56 raw3
crw-rw---- 1 sybase disk 162, 4 Nov 25 13:56 raw4
crw-rw---- 1 sybase disk 162, 5 Nov 25 13:56 raw5
crw-rw---- 1 sybase disk 162, 6 Nov 25 13:56 raw6
crw-rw---- 1 sybase disk 162, 7 Nov 25 13:56 raw7
crw-rw---- 1 sybase disk 162, 8 Nov 25 13:56 raw8
crw-rw---- 1 root disk 162, 0 Nov 25 13:56 rawctl
asece1:/dev/raw #

The Linux system creates these raw devices as root user at every boot. There should be a start-up command added that will change permission automatically. If the owner of these raw devices is not sybase the database start-up fails.

Shared Memory Setup

The Linux kernel needs just one modification.

The file /etc/sysctl.conf needs the following line added.

kernel.shmmax=1073741824

This will set the shared memory to 1GB.

To activate the settings execute the following command:

/sbin/sysctl -p

Install Sybase ASE Cluster Edition software

As the sybase user go to the folder where the Sybase ASE Cluster Edition software is staged and execute the setup command. This will install the software into the $SYBASE directory. This command needs to be executed only once, on asece1.

./setup
InstallShield Wizard
Initializing InstallShield Wizard...
Searching for Java(tm) Virtual Machine...
........
Running InstallShield Wizard...

The installer will start and you will see this screen:

Sybase Install Start

Hit next to start the installation process.

Sybase Install Start

Select the country and accept the license agreement. Then click next.

Sybase Install Start

Make sure that you select the directory that corresponds with your $SYBASE setting. Hit next to continue.

Sybase Install Start

Select the full installation. Then hit Next.
Sybase Install Start

We don’t want to setup the license server. Select No and hit Next.

Then you will see this screen.
Sybase Install Start

Hot Ok to continue.

Sybase Install Start

We don’t want to setup the mail services. Select No and hit Next.
Sybase Install Start

I believe that’s the correct license setting. Hit Next to continue.
Sybase Install Start

That’s the list of what will be installed. Review the list and hit Next to start the software install.
Sybase Install Start

This is the progress screen of the software install.
Sybase Install Start

The installer confirms that the software is installed. Hit Next to continue.
Sybase Install Start

This is the last screen of the software installation. Make sure it reads successful and the hit Finish to close the installer.

Important: Before you continue make sure that the SySAM license is copied to the $SYBASE/SYSAM-2_0/licenses directory.

This completes the Sybase installation. Next you will see how to setup your cluster. Please click here to read the next part.

Powered by Translations.com GlobalLink OneLink SoftwarePowered By OneLink